@echo off echo ####################################### echo ## ALX USB Installation Script ## echo ## ## echo ## Warning: all data will be erased! ## echo ####################################### :: check prerequisites if not exist syslinux.exe ( echo 'syslinux' not found goto error ) set DRIVE=%1 if "%DRIVE%" == "" goto usage echo. echo Stick location: '%DRIVE%' echo. echo Warning: all data on %DRIVE% will be erased! set QUESTION= set /p QUESTION=Enter 'yes' to continue or anything else to abort: if not "%QUESTION%" == "yes" goto aborted if not exist %DRIVE% goto notexist echo Formating Disk: %DRIVE% ... format %DRIVE% /FS:FAT32 /Q /Y >nul || goto error echo Writing bootloader ... syslinux -a -m -i %DRIVE% >nul || goto error echo Copying files ... if exist syslinux.cfg ( echo - syslinux.cfg copy syslinux.cfg %DRIVE%\ >nul || goto error ) else ( echo syslinux.cfg not found goto error ) if exist ..\livecdrootfs.sqsh ( echo - ..\livecdrootfs.sqsh copy ..\livecdrootfs.sqsh %DRIVE%\ >nul || goto error ) else ( echo ..\livecdrootfs.sqsh not found goto error ) md %DRIVE%\system || goto error if exist ..\system\alx-i486.tar.bz2 ( echo - ..\system\alx-i486.tar.bz2 copy ..\system\alx-i486.tar.bz2 %DRIVE%\system >nul || goto error ) else ( echo ..\system\alx-i486.tar.bz2 not found goto error ) if exist ..\system\images.conf ( echo - ..\system\images.conf copy ..\system\images.conf %DRIVE%\system >nul || goto error ) else ( echo ..\system\images.conf not found goto error ) if exist ..\isolinux\boot.cat ( echo - ..\isolinux\boot.cat copy ..\isolinux\boot.cat %DRIVE%\ >nul || goto error ) else ( echo ..\isolinux\boot.cat not found goto error ) if exist ..\isolinux\boot.lss ( echo - ..\isolinux\boot.lss copy ..\isolinux\boot.lss %DRIVE%\ >nul || goto error ) else ( echo ..\isolinux\boot.lss not found goto error ) if exist ..\isolinux\boot.msg ( echo - ..\isolinux\boot.msg copy ..\isolinux\boot.msg %DRIVE%\ >nul || goto error ) else ( echo ..\isolinux\boot.msg not found goto error ) if exist ..\isolinux\help.msg ( echo - ..\isolinux\help.msg copy ..\isolinux\help.msg %DRIVE%\ >nul || goto error ) else ( echo ..\isolinux\help.msg not found goto error ) if exist ..\isolinux\initrd.gz ( echo - ..\isolinux\initrd.gz copy ..\isolinux\initrd.gz %DRIVE%\ >nul || goto error ) else ( echo ..\isolinux\initrd.gz not found goto error ) if exist ..\isolinux\magelive ( echo - ..\isolinux\magelive copy ..\isolinux\magelive %DRIVE%\ >nul || goto error ) else ( echo ..\isolinux\magelive not found goto error ) echo. echo Finished! goto end : usage echo. echo Usage: echo %0 [drive letter] echo. echo Example: %0 m: goto end : aborted echo Aborted! goto end : notexist echo Drive '%DRIVE%' does not exist! goto end : error echo An error occured. Aborted. goto end : end