echo off
if "%1" == "" goto usage

rem check that Disk One is in the machine
if not exist install.bat 	goto usage
if exist cpicts.zip		goto proceed
if exist cfinal.zip 		goto wrongdisk
if not exist cpicts.zip 	goto usage

:proceed
rem must install onto a hard disk i.e. c: -> z:
if %1==a: goto usage
if %1==A: goto usage
if %1==b: goto usage
if %1==B: goto usage

echo 
--------------------------------------------------------------
echo          Carriers at War - Hard Disk installation
echo --------------------------------------------------------------
echo 
This will create a directory called %1\CAW on your hard disk
echo and copy the game files to it. Carriers requires 3.5 Megabytes.


rem Copy Disk One across to the hard disk
if not exist %1\caw\caw1.exe 		mkdir %1\caw

echo Copying standard pictures
unzip -o -d cpicts 	    %1\caw   >nul:
echo Copying combat pictures
unzip -o -d ccombat	    %1\caw   >nul:
echo Copying ship pictures
unzip -o -d cships 	    %1\caw   >nul:
echo Copying plane pictures
unzip -o -d cplanes	    %1\caw   >nul:

rem Now lets ask for Disk Two and start on that
if exist cfinal.zip goto start2
:loop1
echo 

Please insert Carriers at War Disk Two into current drive.
pause 
if not exist cfinal.zip goto loop1
:start2

echo Copying scenario pictures
unzip -o -d cscen 	    %1\caw   >nul:
echo Copying data files
unzip -o -d covr	    %1\caw   >nul:
echo Copying intelligence files
unzip -o -d caiq 	    %1\caw   >nul:
echo Copying message files
unzip -o -d clst 	    %1\caw   >nul:
echo Copying main files
unzip -o -d cmain	    %1\caw   >nul:
echo Copying final files
unzip -o -d cfinal	    %1\caw   >nul:

rem and check that caw1.exe has made it across ( or no memory )
if not exist %1\caw\caw1.exe goto incomplete
goto finish

:wrongdisk
echo 
--------------------------------------------------------------
echo          Carriers at War - Hard Disk installation
echo --------------------------------------------------------------
echo          Wrong disk      - please try again	
echo --------------------------------------------------------------
echo 
Place Carriers at War Disk One in your drive and repeat
echo the installation proceedure.
echo 

goto exit

:incomplete
echo 
--------------------------------------------------------------
echo          Carriers at War - Hard Disk installation
echo --------------------------------------------------------------
echo          Memory error    - please try again	
echo --------------------------------------------------------------
echo 
There was not enough free space on your %1 drive to load all
echo the Carriers at War files. You will have to free up some space
echo on the %1 drive and repeat the installation proceedure.
echo 

goto exit

:usage
echo 
--------------------------------------------------------------
echo          Carriers at War - Hard Disk installation
echo --------------------------------------------------------------
echo          Usage error     - please try again	
echo --------------------------------------------------------------
echo 
Place Carriers at War Disk One in the a or b drive and goto that
echo drive by typing 'a: [enter]' or 'b: [enter]' then type
echo 'install drive [enter]' where drive is the hard disk you wish 
echo to install Carriers to.
echo 
For example, if you want to copy the game from your a: drive to 
echo the c: drive on your hard disk you would type
echo 
         a:         [enter]
echo          install c: [enter]
echo 

goto exit

:finish
echo 
--------------------------------------------------------------
echo          Carriers at War - Installation complete
echo --------------------------------------------------------------
echo 
Carriers at War has now been installed on your %1 drive.
echo To play the game type the following commands
echo 
         %1         [enter]
echo          cd \caw    [enter]
echo          caw        [enter]
echo 

goto exit

:exit
