;Install script for Deadlock Ish #7 HD-Compat
;--------------------------------------------
failat 40
setenv dlinstalldir ""
echo "[0m[4;32m                                "
echo "[4;31;43mDeadlock Issue #7 HD Compatible "
echo "[0m[1;32mCLI-Based Installer [0m(Official Installer coming soon)[0m"
echo 

echo "[1mEnter path you wish to install to : [0m" noline
if "$KickStart" GT "37.00"
   if exists "c:requestfile"
      c:requestfile drawer "ram:" savemode title="Select path to install to"  drawersonly  > env:DLInstallDir
      echo $dlinstalldir
   else
      setenv >Nil: DLInstallDir ?
   endif
else
   setenv >Nil: DLInstallDir ?
endif

if $DLInstallDir EQ ""
   echo "Installation aborted by User.."
else

if exists $DLInstallDir
; dir OR file FOUND
LAB Start
   cd >NIL: $DLInstallDir
   if fail
      echo '[33mError: [31mCannot change directory..'
   else
      echo "Attempting to install Deadlock #7 to directory" [33m$DlInstallDir[31m
      echo "Copying 'Deadlockdata.dat'.."  noline
      copy dl07:Deadlockdata.dat $DLInstallDir
      if not warn
	   echo "Done"
	   echo "Copying 'DeadlockGFX.dat'.." noline
	   copy dl07:DeadlockGFX.dat $DLInstallDir

	   if not warn
		echo "Done"
		echo "Copying 'dl07.exe'.." noline
		copy dl07:Dl07.exe $DlInstallDir
		if not warn
		   echo "Done"
		   echo 
		   echo "Creating Script.." 
			
		   echo assign dl07: $dlinstalldir > Deadlock07
		   echo "Deadlock will cater for both Normal monitors and Multisync monitors"
		   echo "the routines vary slightly."
		   ask  "Do you use a Multisync monitor (y/n) :"
		   if warn 
			echo "MULTISYNC switch added to Deadlock script"
  		        echo "dl07.exe multisync hdinstalled" >> Deadlock07
		   else
			echo "Deadlock will run as normal.."
			echo "dl07.exe hdinstalled" >> Deadlock07
		   endif
		   echo assign dl07: remove >> Deadlock07
		   echo ";this mag will run from workbench and cli" >> Deadlock07
		   echo ";but it is better to run from cli. see Readme file for info" >> Deadlock07
		   copy dl07:Deadlock07.info $dlinstalldir
		   
		   
		   echo "Install Complete"
		else
		skip fail

		endif
	   else
		skip	fail
           endif
      else
lab fail
           echo "Installation failed"
      endif
   endif

else
   echo "could not find $DLInstallDir"
   ask "Shall I create '$DLInstallDir' as a directory:"
   if warn
      echo "Making directory $DLInstallDir.." noline
      makedir "$DLInstallDir"
      echo "Done"
      
      skip Start BACK
    else
      echo "Install Aborted by User"      
    endif

   

endif
endif
