;**************************************************
;  Script to Initialize PageSetter³ on a floppy
;  Based System
;
;  Copyright ©1992 GOLD DISK Inc.
;**************************************************

(set clip_prompt (cat
	"Select the disk/drawer where you would like Professional Draw Clips "
	"installed. A new drawer \"Clips\" will be made here."))
(set clip_help (cat
	"The Professional Draw Clips supplied with PageSetter will be copied "
	"to this drawer. Since you have selected this option, you should have "
	"a blank formatted disk handy, please insert that disk and select it."))

(set fm_prompt
	"Select the disk/drawer where you would like FontManager installed.")
(set fm_help (cat
	"The FontManager Utility will be copied to this drawer. Since you have "
	"selected this option, you should have a blank formatted disk handy, "
	"please insert that disk and select it."))

(set cg_prompt
	"Select the disk/drawer where your collection of CGFONTS is.")
(set cg_help (cat
	"There has been an upgrade to the if.ss file which allows access to "
	"a wider range of Compugraphic characters. This file should be copied "
	"to your CGFonts: disk."))

(set pref_prompt (cat
	"Because of limited space on the installation disks, the Amiga "
	"printer drivers could not be included. Therefore you must select "
	"your favorite driver from another WorkBench Disk, which will be "
	"in its devs/printers sub-drawer. This driver will be copied to "
	"your PageSetter Disk."))
(set pref_help pref_prompt)

(set tool_prompt (cat
	"This will change the .info file for PageSetter so that it starts up "
	"in Black & White, non-Interlaced mode when run from the WorkBench."))
(set tool_help tool_prompt)

(set ram_prompt (cat
	"Do you want to use RAM: to reduce disk swapping?  If you "
	"have two floppy drives select the \"Don't Use RAM:\" "
	"option... If you have only one floppy drive but plenty "
	"of memory free (300k) select the \"Use RAM:\" option."))


;**************************************************
;  See what the user wants to install this round
;**************************************************

(set install_opts
	(askoptions
		(prompt
			"PageSetter Initialization for Floppy Disk Systems\n\n")
		(choices
			"Update your current CGFonts: disk"
			"Copy Professional Draw Clips"
			"Set Printer Preference"
			"Configure PageSetter for Low Memory"
		)
		(default 3)
		(help
			"Update CGFonts: If you already have a collection of CG Fonts "
			"then your CGFonts:if.ss file there needs to be upgraded.\n"
			"Copy Professional Draw Clips: Copies the Structured drawing "
			"Clip Art to a blank formatted disk (please have one handy).\n"
			"Set Printer: Allows you to set up your printer preference "
			"for the PageSetter Boot disk.\n"
			"Configure: This will change the .info file for PageSetter "
			"so it starts up in Black & White, non-Interlaced mode."
		)
	)
)

(set rambuffer 0)

(if (AND install_opts 7)
	(set rambuffer
		(askbool
			(prompt ram_prompt)
			(help ram_prompt)
			(choices "Use RAM:" "Don't use RAM:")
			(default 1)
		)
	)
)

(set rambuffer (select rambuffer 0 "RAM:installbuffer"))

;***************************************************************************
;  Open first installation disk
;***************************************************************************

;*****************************************
;  Set tool-types for low-mem
;*****************************************

(if (AND install_opts 8)
	(tooltype
		(prompt tool_prompt)
		(help tool_help)
		(dest "PS³Page:PageSetter")
		(settooltype "INTERLACE" "OFF")
		(settooltype "COLORMODE" "BW")
		(confirm)
	)
)

;*****************************************
;  Set printer preferences
;*****************************************

(if (AND install_opts 4)
	(
		(message pref_prompt)
		(set pref_dest
			(askfile
				(prompt "Select Printer Driver")
				(help pref_help)
				(default "df0:")
			)
		)
		(set driver (fileonly pref_dest))
		(set path (pathonly (pathonly (pathonly (pathonly pref_dest)))))
		(
			(copyfiles (source pref_dest)
				(dest "PS³Install:devs/printers"))
			(run (tackon path "prefs/preferences"))
		)
	)
)

;*****************************************
;  De-compress clips
;*****************************************

(if (AND install_opts 2)
	(if rambuffer
		(
			(askdisk
				(prompt "Please insert the disk labeled \"Disk 1\".")
				(help "Professional Draw Clips will be copied from this disk.")
				(dest "PS³Install")
			)
			(working "\n\nCopying Clips to buffer...")
			(copyfiles (source "PS³Install:c/lzx") (dest rambuffer) (nogauge))
			(copyfiles (source "PS³Install:Clips.lzh") (dest rambuffer) (nogauge))
			(set clip_dest
				(askdir (prompt clip_prompt) (help clip_help) (default "df0:"))
			)
			(working "\n\nInstalling Professional Draw Clips...")
			(textfile
				(dest "ram:install_script")
				(append "cd \"" clip_dest "\"\n")
				(append rambuffer "/lzx -m x " rambuffer "/Clips.lzh * \n")
			)
			(execute "ram:install_script")
			(delete rambuffer (safe))
		)
		(
			(set clip_dest
				(askdir (prompt clip_prompt) (help clip_help) (default "df0:"))
			)
			(askdisk
				(prompt "Please insert the disk labeled \"Disk 1\".")
				(help "Professional Draw Clips will be copied from this disk.")
				(dest "PS³Install")
			)
			(copyfiles (source "PS³Install:c/lzx") (dest "ram:") (nogauge))
			(working "\n\nInstalling Professional Draw Clips...")
			(textfile
				(dest "ram:install_script")
				(append "cd \"" clip_dest "\"\n")
				(append "ram:lzx -m x PS³Install:Clips.lzh * \n")
			)
			(execute "ram:install_script")
		)
))

;**************************************************************************
;  Open Third installation disk
;**************************************************************************

;*****************************************
;  Update if.ss file
;*****************************************

(if (AND install_opts 1)
	(
		(if rambuffer
			(
				(askdisk
					(prompt "Please insert the disk labeled \"Disk 3\".")
					(help "FontManager will be copied from this disk.")
					(dest "PS³Fonts")
				)
				(copyfiles (source "PS³Fonts:CGFonts/if.ss") (dest rambuffer))
				(copyfiles (source "PS³Fonts:CGFonts/cg.chardata") (dest rambuffer))
				(copyfiles (source "PS³Fonts:CGFonts/default.chardata") (dest rambuffer))
				(copyfiles (source "PS³Fonts:CGFonts/default2.chardata") (dest rambuffer))
				(copyfiles (source "PS³Fonts:CGFonts/tricond.chardata") (dest rambuffer))
				(set cg_dest
					(askdir (prompt cg_prompt) (help cg_help)
						(default "df0:")
					)
				)
				(copyfiles (source (tackon rambuffer "if.ss")) (dest cg_dest))
				(delete rambuffer (safe))
			)
			(
				(set cg_dest
					(askdir (prompt cg_prompt) (help cg_help)
						(default "df0:")
					)
				)
				(copyfiles (source "PS³Fonts:CGFonts/if.ss") (dest cg_dest))
				(copyfiles (source "PS³Fonts:CGFonts/cg.chardata") (dest rambuffer))
				(copyfiles (source "PS³Fonts:CGFonts/default.chardata") (dest rambuffer))
				(copyfiles (source "PS³Fonts:CGFonts/default2.chardata") (dest rambuffer))
				(copyfiles (source "PS³Fonts:CGFonts/tricond.chardata") (dest rambuffer))
			)
		)
	)
	(set cg_dest "PS³Fonts:CGFonts")
)

(set @default-dest "Floppy Drive")

;**************************************************
;  Go back to SYS: (first installation disk)
;**************************************************

(working "\n\nUpdateing s:PageSetter.INI...")

(if (AND install_opts 1)
	(textfile (dest "s:PageSetter.INI")
		(append "PD  PS³Page:\n")
		(append "PP  PS³Page:\n")
		(append "PR  PS³Page:Data\n")
		(append "TF  PS³Page:Filters\n")
		(append "PNT PS³Page:GrE\n")
		(append "FE  " cg_dest "\n")
		(append "AE  PS³Fonts:\n")
	)
)

(exit)
