training-guides/labs/lib/wbatch/template-begin_base_bat
Roger Luethi 49231a7bde labs: protect downloader.js from deletion
In its current location, the download helper for Window batch scripts,
downloader.js, gets deleted when the Windows batch scripts are generated
(due to a call to clean_dir).

This patch moves downloader.js to the tools directory where it remains
safe from clean_dir.

Change-Id: I48f3daf613e8517dfb9256af298e9e43f76289bc
2015-04-19 17:57:35 +02:00

38 lines
860 B
Batchfile

ECHO %time% Cleaning up autostart and log directories
DEL /S /Q %AUTODIR%
DEL /S /Q %LOGDIR%
ECHO %time% Looking for %IMGDIR%\%INSTALLFILE%
IF EXIST %IMGDIR%\%INSTALLFILE% goto got_install_iso
ECHO.
ECHO %INSTALLFILE% not found in %IMGDIR%.
ECHO.
ECHO Trying to download the install ISO from
ECHO %ISOURL%
ECHO.
ECHO Expect this to take several minutes or longer, depending on your
ECHO Internet connection.
ECHO.
cscript /nologo %TOOLSDIR%\downloader.js %ISOURL%
RENAME downloaded.bin %INSTALLFILE%
MOVE %INSTALLFILE% %IMGDIR%
IF EXIST %IMGDIR%\%INSTALLFILE% goto got_install_iso
ECHO.
ECHO %INSTALLFILE% still not found in %IMGDIR%.
ECHO Aborting.
ECHO.
goto :terminate
:got_install_iso
ECHO.
ECHO %time% Found %IMGDIR%\%INSTALLFILE%
ECHO.
ECHO %time% Initialization done. Hit any key to continue.
ECHO.
PAUSE
REM vim: set ai ts=4 sw=4 et ft=dosbatch: