.key destination ; destination should NOT include path
.bra {
.ket }

;************************************************************************
;									*
; This will install the Strip Poker 3 program to a HardDisk.		*
;									*
;	Copyright Artworx Software Company/Barrett & Smith Enterprises,	*
;	1991, All rights reserved.					*
;									*
;************************************************************************

;************************************************************************
;*									*
;*	Combined WB, CLI, Shell HD_Install Script			*
;*	  installs Strip Poker Three on any WB1.2, WB1.3, WB2.0 logical * 
;*	  file device							*
;*									*
;************************************************************************

Failat 30
if "{destination}" EQ ""
	echo "		[30;41m******* HD_Install Usage *******[0m" 
	echo ""
	echo "[4mFrom the WorkBench:[0m"
	echo "Just press and hold the [4mshift[0m key while you [4mclick once[0m on the"
	echo "[4mHD_Install[0m icon, and then [4mclick twice[0m on the icon of the Hard"
	echo "drive  [4mdestination[0m directory.  If you just click twice on the"
	echo "HD_Install icon, this usage note will be displayed again."
	echo ""
	echo "[4mFrom the CLI or Shell:[0m"
	echo "CD to the drive that you want to install the program on, then"
	echo "execute HD_Install <destination>.  It should look like this:"
	echo ""
	echo "	CD Games: "
	echo "	Execute Strip3:HD_Install Poker "
	echo "		[30;41mor[0m"
	echo "	CD DH1:games "
	echo "	Execute Strip3:HD_Install Poker " 
	echo ""
	echo "[30;41mPoker[0m is the directory you want created and have the files"
	echo "stored in.  Pausing for 25 seconds..."
	Wait 25
	skip ALLDONE
endif

;************************************************************************
;*									*
;* Set up destination directory in the parent directory; must check for	*
;* existence of the destination when called from CLI; CD at this point	*
;* should be parent directory of {destination}.				*
;*									*
;************************************************************************

if NOT exists {destination}
	echo "Making directory {destination}"
	makedir {destination}
	if NOT exists {destination}
		echo ".... couldn't make directory"
		skip DONE
	endif
	echo "Creating a drawer icon for {destination}"
	copy Strip3:icons/empty.info to {destination}.info
	if ERROR
		skip COPYERR
	endif
endif

;************************************************************************
;*									*
;* Copy executables to the destination.  				*
;*									*
;************************************************************************

echo "Copying game program files to {destination}"

copy Strip3:StripPokerThree#? to {destination}
if ERROR
	skip COPYERR
endif

copy Strip3:icons/Assign.info to {destination}
if ERROR
	skip COPYERR
else
	echo >{destination}/Assign "ASSIGN STRIP3: {destination}" 
endif


copy Strip3:#?.TXT to {destination}/
if ERROR
	skip COPYERR
endif

copy Strip3:images to {destination}/images ALL
if ERROR	
	skip COPYERR
endif

copy Strip3:sounds to {destination}/sounds ALL
if ERROR
	skip COPYERR
endif

copy Strip3:anims to {destination}/anims ALL
if ERROR	
	skip COPYERR
endif

;************************************************************************
;*									*
;* Check for the existence of the Strip Poker program support files.	*
;*									*
;************************************************************************

if NOT exists libs:iffparse.library
	copy Strip3:libs/iffparse.library to libs:
	if ERROR
		skip COPYERR
	endif
endif

if NOT exists libs:req.library
	copy Strip3:libs/req.library to libs:
	if ERROR
		skip COPYERR
	endif
endif

;************************************************************************
;*									*
;*	Add Saved Games directory					*
;*									*
;************************************************************************

if NOT exists {destination}/Saved_Games
	echo "Making load/save subdirectory Saved_Games"
	makedir {destination}/Saved_Games
	if NOT exists {destination}/Saved_Games
		echo "ERROR:.... couldn't make subdirectory in {destination}."
		skip DONE
	endif
endif

;************************************************************************
;*									*
;*	Copy the opponents disk to the hard drive			*
;*									*
;************************************************************************

copy Strip3_Opponents:images to {destination}/images ALL
if ERROR	
	skip COPYERR
endif

copy Strip3_Opponents:sounds to {destination}/sounds ALL
if ERROR
	skip COPYERR
endif

copy Strip3_Opponents:#?.TXT to {destination}/
if ERROR
	skip COPYERR
endif

;************************************************************************
;*									*
;*  Now need to add the assign for Strip3: to the User-Startup file	*
;*									*
;************************************************************************

echo ""
echo ""

if exists s:User-Startup
	echo "You need to add the following line to your"
	echo "[30;41ms:User-Startup[0m file:"
else
	echo "You need to add the following line to your"
	echo "[30;41ms:Startup-Sequence[0m file:"
endif

echo ""	
echo "		ASSIGN Strip3: {destination}"
echo ""

echo "Pausing 10 seconds..."
wait 10

;************************************************************************
;*									*
;*  All done...								*
;*									*
;************************************************************************

echo ""
echo "All done.  I hope you enjoy playing the game..."
skip DONE

LAB COPYERR
echo "ERROR:.... couldn't copy to {destination}."

LAB DONE
echo "Current Directory is "
CD

echo "Pausing 10 seconds..."
wait 10

LAB ALLDONE
