@echo off
set DST=D:\Progs
set BATDST=D:\batch
echo This setup will install the 'zbnfjax' Directory tree
echo on %DST%\zbnfjax
echo overwrites %BATDST%\zbnfjax.bat and ...\setZBNFJAX_HOME_new.bat
echo creates %BATDST%\setZBNF_HOME.bat if it is not existing.
echo !!! The user should be adapted the setZBNF_HOME.bat to some pathes 
echo !!! of the existing environment, JAVA paths, XML-Tools.
echo !!! The template-content is given in %BATDST%\setZBNFJAX_HOME_new.bat.
echo The ...\zbnfjax.bat is not necessary to adapt, only ...\setZBNFJAX_HOME.
echo To work proper, some XML-Tools are need. See setZBNFJAX_HOME.bat.
echo ...
echo If it isn't desired, please edit this file 
echo and the 'zbnfjax\batch_template\setZBNFJAX_HOME,bat'-file.
pause
if not exist %DST% mkdir %DST%
REM remove exisiting folder because it may be confuse.
if exist %DST%\zbnfjax rmdir /S /Q %DST%\zbnfjax
xcopy ..\zbnfjax\* %DST%\zbnfjax\* /S

if not exist %BATDST% mkdir %BATDST%

REM The file setZBNFJAX_HOME.bat may be adapted by user. Don't overwrite it, copy only if not exists.
if not exist %BATDST%\setZBNFJAX_HOME.bat copy /Y ..\zbnfjax\batch_template\setZBNFJAX_HOME.bat %BATDST%\*
REM But copy always the current version under _new. The user should adjust the content.
copy /Y ..\zbnfjax\batch_template\setZBNFJAX_HOME.bat %BATDST%\setZBNFJAX_HOME_new.bat

REM The zbnfjax.bat should not be adapted by the user. Overwrite an existing version.
copy /Y ..\zbnfjax\batch_template\zbnfjax.bat %BATDST%\*

echo done.



