@echo off
cls
echo.
echo      Installation of Red Alert Campaign:
echo.
echo.
echo           * * * * * * * * * * * *
echo           * in The Line of Fire *
echo           * * * * * * * * * * * *
echo.
echo.
echo.
if not exist redalert.mix goto ERROR1
if not exist fireline.dat goto ERROR2
if not exist fireline.000 goto ERROR3
echo.
echo 1)  Install
echo 2)  Uninstall
echo 3)  Cancel
echo.
choice /c:123 Choose an Option:
if errorlevel 3 goto CANCEL
if errorlevel 2 goto UNINST
echo.
echo Choose which version of Red Alert you use:
echo.
echo 1)  DOS version
echo 2)  Win95 version
echo 3)  Quit
echo.
set oper=dos
choice /c:123 Choose an Option
if errorlevel 3 goto CANCEL
if errorlevel 2 set oper=w95

:INST
echo.
echo.
echo Installing...  Please wait.
if exist tempj\nul goto NOINST
echo.
echo.

md tempj
for %%f in (*.mix scg*.ini version.txt title.*) do move %%f tempj\%%f >nul
for %%f in (tutorial.ini rules.ini mission.ini) do move %%f tempj\%%f >nul
cd tempj
move redalert.mix ..\redalert.mix >nul
move sc-music.mix ..\sc-music.mix >nul
cd..
rename fireline.000 pura.exe
pura fireline.dat >nul
rename pura.exe fireline.000

if %oper%==w95 goto W95

del sc-win95.mix
del title.pcx
goto OHI

:W95
del sc-dos.mix
del title.cps

:OHI
cls
echo.
echo Installation complete.
echo.
echo View fireline.txt for more information.
echo.
echo.
echo.
echo To start the campaign you have to click 'Start new Game' button at
echo the start menu and choose allies.
echo.
echo.
echo.
echo I hope you have lots of fun with the campaign :)
echo.
goto END

:UNINST
if not exist tempj\nul goto NOT
del tutorial.ini >nul
del rules.ini    >nul
del mission.ini  >nul
del version.txt  >nul
del title.*      >nul
del sc-*.mix     >nul
cd tempj
for %%f in (*.*) do move %%f ..\%%f >nul
cd..
rd tempj
echo.
echo In the Line of Fire is uninstalled
echo.
goto END

:ERROR1
echo.
echo REDALERT.MIX is not found in this directory.
echo.
echo You have to install this campaign in your Red Alert directory.
echo.
goto END
:ERROR2
echo.
echo FIRELINE.DAT is not found in this directory.
echo.
goto END
:ERROR3
echo.
echo FIRELINE.000 is not be found in this directory.
echo.
goto END

:NOINST
echo.
echo You have to uninstall the campaign before you install it.
echo.
goto END

:NOT
echo.
echo Campaign is not installed!
echo.
goto END

:CANCEL
echo.
echo Installation aborted.
echo.
:END
