echo off
cls
echo Installing MIDIFILE READER on %1 drive...
if %1 '=='  goto NOPARM
if not exist %1\NUL goto SYNTAX
if not exist INSTALL.BAT goto NODRIVE
if exist %1\SPARTAN\MR\MR.EXE goto UPDATE
if exist %1\SPARTAN\MR\MR.PRO goto UPDATE
:NEW
echo New installation...
if not exist %1\SPARTAN\NUL mkdir %1\SPARTAN
if not exist %1\SPARTAN\MR\NUL mkdir %1\SPARTAN\MR
if exist MR.EXE copy MR.EXE %1\SPARTAN\MR\MR.EXE
if exist MRDEMO.EXE copy MRDEMO.EXE %1\SPARTAN\MR\MRDEMO.EXE
if exist MR.BAT copy MR.BAT %1\SPARTAN\MR.BAT
if exist MRDEMO.BAT copy MRDEMO.BAT %1\SPARTAN\MRDEMO.BAT
goto OTHER
:UPDATE
echo Update installation...
if exist %1\SPARTAN\MR\MR.EXE copy %1\SPARTAN\MR\MR.EXE %1\SPARTAN\MR\MR-OLD.EXE
if exist %1\SPARTAN\MR\MR.PRO copy %1\SPARTAN\MR\MR.PRO %1\SPARTAN\MR\MR-OLD.PRO
if exist MR.EXE copy MR.EXE %1\SPARTAN\MR\MR.EXE
if exist MRDEMO.EXE copy MRDEMO.EXE %1\SPARTAN\MR\MRDEMO.EXE
if exist MR.BAT copy MR.BAT %1\SPARTAN\MR.BAT
if exist MRDEMO.BAT copy MRDEMO.BAT %1\SPARTAN\MRDEMO.BAT
:OTHER
copy MRDEMO.MFF  %1\SPARTAN\MR
copy MRDEMO.TXT  %1\SPARTAN\MR
copy MR.HLP      %1\SPARTAN\MR
:PROFILE
if exist %1\SPARTAN\MR\MR.PRO echo WARNING***Old profile MR.PRO copied to MR-OLD.PRO...
if %2 '=='     goto GETVIDEO
if %2 == color goto COLOR
if %2 == Color goto COLOR
if %2 == COLOR goto COLOR
goto MONO
:GETVIDEO
getvideo
if errorlevel 1 goto COLOR
if errorlevel 0 goto MONO
goto MONO
:COLOR
echo Installing COLOR profile...
copy MR.PRO %1\SPARTAN\MR\MR.PRO
goto SUCCESS
:MONO
echo Installing MONOCHROME profile...
copy MRMONO.PRO %1\SPARTAN\MR\MR.PRO
goto SUCCESS
:SUCCESS
echo Installation successful...
%1
cd \SPARTAN
goto DONE
:NOPARM
echo Installation failed...(Must specify drive letter)
goto DONE
:NODRIVE
echo Installation failed...(Must make installation drive the current drive)
goto DONE
:SYNTAX
echo Installation failed...(Invalid drive letter?  Specify letter and colon)
goto DONE
:DONE
