2023-07-21 20:14:52 +02:00
|
|
|
@ECHO OFF
|
2023-07-20 16:55:45 +02:00
|
|
|
|
|
|
|
rem Convert (load) 1C configuration from 1C:Designer XML format to 1C configuration file (*.cf)
|
|
|
|
rem %1 - path to folder contains configuration files in 1C:Designer XML format
|
|
|
|
rem %2 - path to 1C configuration file (*.cf)
|
|
|
|
rem %3 - convertion tool to use:
|
|
|
|
rem ibcmd - ibcmd tool (default)
|
|
|
|
rem designer - batch run of 1C:Designer
|
|
|
|
|
2023-07-22 10:06:53 +02:00
|
|
|
IF not defined V8_VERSION set V8_VERSION=8.3.20.2290
|
|
|
|
IF not defined V8_TEMP set V8_TEMP=%TEMP%\1c
|
2023-07-20 16:55:45 +02:00
|
|
|
|
|
|
|
set V8_TOOL="C:\Program Files\1cv8\%V8_VERSION%\bin\1cv8.exe"
|
|
|
|
set IBCMD_TOOL="C:\Program Files\1cv8\%V8_VERSION%\bin\ibcmd.exe"
|
|
|
|
|
2023-07-21 20:14:52 +02:00
|
|
|
set IB_PATH=%V8_TEMP%\tmp_db
|
2023-07-20 16:55:45 +02:00
|
|
|
set CONFIG_PATH=%1
|
2023-07-22 10:06:53 +02:00
|
|
|
IF defined CONFIG_PATH set CONFIG_PATH=%CONFIG_PATH:"=%
|
2023-07-20 16:55:45 +02:00
|
|
|
set CONFIG_FILE=%2
|
2023-07-22 10:06:53 +02:00
|
|
|
IF defined CONFIG_FILE (
|
2023-07-20 16:55:45 +02:00
|
|
|
set CONFIG_FILE=%CONFIG_FILE:"=%
|
|
|
|
set CONFIG_FILE_PATH=%~dp2
|
|
|
|
)
|
|
|
|
set CONV_TOOL=%3
|
2023-07-22 10:06:53 +02:00
|
|
|
IF defined CONV_TOOL (
|
2023-07-20 16:55:45 +02:00
|
|
|
set CONV_TOOL=%CONV_TOOL:"=%
|
2023-07-22 10:06:53 +02:00
|
|
|
) ELSE set CONV_TOOL=ibcmd
|
2023-07-20 16:55:45 +02:00
|
|
|
|
2023-07-22 10:06:53 +02:00
|
|
|
IF not defined CONFIG_PATH (
|
2023-07-20 16:55:45 +02:00
|
|
|
echo Missed parameter 1 "path to folder contains configuration files in 1C:Designer XML format"
|
|
|
|
exit /b 1
|
|
|
|
)
|
2023-07-22 10:06:53 +02:00
|
|
|
IF not defined CONFIG_FILE (
|
2023-07-20 16:55:45 +02:00
|
|
|
echo Missed parameter 2 "path to 1C configuration file (*.cf)"
|
|
|
|
exit /b 1
|
|
|
|
)
|
|
|
|
|
|
|
|
echo Clear temporary files...
|
2023-07-22 12:05:08 +02:00
|
|
|
IF exist "%V8_TEMP%" rd /S /Q "%V8_TEMP%"
|
|
|
|
md "%V8_TEMP%"
|
|
|
|
md "%IB_PATH%"
|
|
|
|
IF not exist "%CONFIG_FILE_PATH%" md "%CONFIG_FILE_PATH%"
|
2023-07-20 16:55:45 +02:00
|
|
|
|
2023-07-22 10:06:53 +02:00
|
|
|
IF "%CONV_TOOL%" equ "designer" (
|
2023-07-20 16:55:45 +02:00
|
|
|
echo Creating infobase "%IB_PATH%"...
|
|
|
|
%V8_TOOL% CREATEINFOBASE File=%IB_PATH%; /DisableStartupDialogs
|
|
|
|
|
|
|
|
echo Loading infobase "%IB_PATH%" configuration from XML-files "%CONFIG_PATH%"...
|
|
|
|
%V8_TOOL% DESIGNER /IBConnectionString File=%IB_PATH%; /DisableStartupDialogs /LoadConfigFromFiles %CONFIG_PATH%
|
2023-07-22 10:06:53 +02:00
|
|
|
) ELSE (
|
2023-07-20 16:55:45 +02:00
|
|
|
echo Creating infobase "%IB_PATH%" from XML files "%CONFIG_PATH%"...
|
|
|
|
%IBCMD_TOOL% infobase create --db-path="%IB_PATH%" --create-database --import="%CONFIG_PATH%"
|
|
|
|
)
|
|
|
|
|
|
|
|
echo Export infobase "%IB_PATH%" configuration to "%CONFIG_FILE%"...
|
2023-07-22 10:06:53 +02:00
|
|
|
IF "%CONV_TOOL%" equ "designer" (
|
2023-07-20 16:55:45 +02:00
|
|
|
%V8_TOOL% DESIGNER /IBConnectionString File=%IB_PATH%; /DisableStartupDialogs /DumpCfg %CONFIG_FILE%
|
2023-07-22 10:06:53 +02:00
|
|
|
) ELSE (
|
2023-07-20 16:55:45 +02:00
|
|
|
%IBCMD_TOOL% infobase config save --db-path="%IB_PATH%" "%CONFIG_FILE%"
|
|
|
|
)
|
|
|
|
|
|
|
|
echo Clear temporary files...
|
2023-07-22 12:05:08 +02:00
|
|
|
IF exist "%V8_TEMP%" rd /S /Q "%V8_TEMP%"
|