@echo off
if "%1" == "" goto usage
echo Warning the bootsector of drive %1 will be modified:
echo the syslinux bootloader will be installed on drive %1
echo ONLY for FAT12 or FAT16 formatted media!
echo .
echo (press ctrl+c and then y to cancel; any other key to continue)
pause
echo .

echo install syslinux to drive %1 ...
if not exist syslinux.com goto error1
syslinux.com %1
if errorlevel 1 goto error2
echo done. - the syslinux bootloader has been written to drive %1

goto end

:usage
echo usage: install g:
echo installs the syslinux bootloader to drive g:
echo drive g: MUST be FAT12 or FAT16 formatted
pause
goto end


:error1
echo Error: the file syslinux.com could not be found.
echo The bootsector on drive %1 has not been changed.
goto end

:error2
echo An error occurred when writing bootloader syslinux
echo to the  drive %1
goto end

:end
pause
exit
