Client update options
In order to provide updates for a client automatically, update requests have to be defined in the UPDATE_FILES option variable. The variable may be set for each data source separately, but also on global level (before first section). Files are updated, when connecting the client with the server. When defining the server connection in the data source, one has to ensure, that files to be updated are not yet opened, e.g. for another data source. Hence, it is more save to define the UPDATE_FILES option variable and server connection options on global level.
The UPDATE_FILES option variable contains one or more update requests separated by semicolon. Each update request defines source and target for updates separated by colon:
UPDATE_FILES=source:target;...
source - is a file name relative to the UPDATE_FILES location defined in the server's ini-file. It may contain sub-directory paths.
target - defines the client file or directory for files to be updated and may contain option variables defined in the client environment.
When downloading compressed files (.ozi, .zip), those will be unpacked to the location defined as target for the download, as soon as the extension of the target differs from source. All other files are copied directly.
When updating one or more files, last update timestamp is checked before downloading. Before starting the download process, a decision box pops up that allows skipping the update for each update file. In order to skip timestamp check and update the file in any case, '>' may be used instead of colon.
UPDATE_FILES=source>target;...
REPLICATION_SERVER=my-server.com
SERVER_PORT=6123
UPDATE_FILES=sample.dev.ozi:%ProjectRoot%/sample.dev;data.zip:%ProjectRoot%/data
On some platforms (e.g. MS Windows) updating program files is impossible as long as the program is running. Hence, one may consider a two step update for backing up, loading and updating files (see example below).
In order to download updates, the client has to connect to the database. The simplest way to do this, is calling the DBConnect server command.
@echo Downloading update files
setlocal
set UPDATE_FILES=MyProj.dev.ozi:MyProj.dev;odaba.zip:install;MyProj.zip:./
set UPDATE_MODE=accept
"...\odaba\DBConnect.exe" my_server_url 1234 >>NUL
@echo update files loaded.
:: create backup and replace library directory
if exist install/odaba (
if exist odaba.old rmdir /S /Q odaba.old
if exist odaba.old goto :error
ren odaba odaba.old
if not exist odaba.old goto :error
move install/odaba odaba
echo Update completed.
)
goto end
:error
echo Could not access odaba directory. Updates not installed.
pause
:end
endlocal