;;
;;  Pinball Illusions
;;  HDInstall, v1.1, 1995-01-06, 17:49:00
;;

(complete 0)

(set P3_dest
	(askdir
		(prompt
			"In which disk or drawer should the Pinball Illusions "
			"drawer be created?"
		)
		(help
			"The installation utility will create a drawer named"
			" \"Pinball3\" in this directory.  All Pinball Illusions\" "
			"files will be placed inside that directory.\n\n"
			"The selected directory must have about 3.5Mb free storage"
			"left.\n\n"
		)
		(default @default-dest)
	)
)

(makedir (tackon P3_dest "Pinball3") (infos))
(set P3_dest (tackon P3_dest "Pinball3"))
(set @default-dest P3_dest)
(set disk_space (getdiskspace P3_dest))

(askdisk
	(prompt "Please insert the disk labeled \"Disk 1\"")
	(help	"Disk 1 contains Pinball Illusions main program, intro and menu.")
	(dest "Pin3001" )
)

(set @execute-dir P3_dest)

(working "Installing Pinball Illusions from Disk 1.")
	(copyfiles
	(source "Pin3001:")
	(dest P3_dest)
	(pattern "(pinball#?|#?.(bin|mnu))")
)

(complete 20)

(copylib
	(prompt "Updating lowlevel.library...")
	(help
		"This action will update the \"lowlevel.library\" to a version"
		" that Pinball Illusions needs to function."
	)
	(source "Pin3001:Libs/lowlevel.library")
	(dest "Libs:")
	(confirm)
)

(copylib
	(prompt "Updating nonvolatile.library...")
	(help
		"This action will update the \"nonvolatile.library\" to a version"
		" that Pinball Illusions needs to function."
	)
	(source "Pin3001:Libs/nonvolatile.library")
	(dest "Libs:")
	(confirm)
)

(set a 0)
(set nv_dir "ENVARC:Highscores")
(if (> 1 @user-level)
	(if (= a (exists "Envarc:Sys/nv_location" (noreq)))
		(set nv_dir
			(askdir
				(prompt
					"Where would you like your highscores to be saved?"
				)
				(help
					"In order to get the highscores saved properly we need to"
					" create the file \"nv_location\" in your \"ENVARC:Sys/\""
					" directory. All applications utilizing the nonvolatile.library"
					" for saving data will use this path. This is as substitue to"
					" the battery backed up game-memory you will find on an CD32."
				)
				(default "ENVARC:Highscores")
			)
		)
	)
)

(makedir nv_dir)
(set nv_dir (cat "Echo >ENVARC:Sys/nv_location " nv_dir))
(run nv_dir)
(set ifile (cat "Echo >" (cat p3_Dest "/HD")))
(run ifile)

(complete 25)

(askdisk
	(prompt "Please insert the disk labeled \"Disk 2\"" )
	(help	"Disk 2 contains the Law & Justice Table.")
	(dest "Pin3002" )
)

(set @execute-dir P3_dest)

(working "Installing Law & Justice from Disk 2.")
(copyfiles
	(source "Pin3002:")
	(dest P3_dest)
	(all)
)

(complete 50)

(askdisk
	(prompt "Please insert the disk labeled \"Disk 3\"" )
	(help	"Disk 3 contains the Babewatch table.")
	(dest "Pin3003" )
)

(set @execute-dir P3_dest)

(working "Installing Babewatch from Disk 3.")
(copyfiles
	(source "Pin3003:")
	(dest P3_dest)
	(all)
)

(complete 75)

(askdisk
	(prompt "Please insert the disk labeled \"Disk 4\"" )
	(help	"Disk 4 contains the Extreme Sports table.")
	(dest "Pin3004" )
)

(set @execute-dir P3_dest)

(working "Installing Extreme Sports from Disk 4.")
(copyfiles
	(source "Pin3004:")
	(dest P3_dest)
	(pattern "#?.(bin|opt)")
)

(complete 100)
