(set is_update 0)
(set FC_dest (getassign "SW_FC" "a"))
(complete 0)

(if FC_dest
	(if (askbool
			(prompt "Your current copy of Final Copy appears to be located in the drawer named \""
					FC_dest
					"\". Do you want the update installed in that drawer?"
			)
			(help
				"PERVERT-CITY on PERVERT-TOUR'92 - ARTIFICIAL ARYAN & TOM PAX "
				"The installer has determined that you may already have a "
				"copy of Final Copy installed on your system. If this is wrong or "
				"you want the update installed elsewhere, select NO as an "
				"answer. Otherwise, select YES."
			)
			(default 1)
		)

		(set is_update 1)		; if user wants in same place

		(set FC_dest
			(askdir
				(prompt "In which disk or drawer should Final Copy be installed?")
				(help @askdir-help)
				(default FC_dest)
			)
		)
	)
)

(if (not FC_dest)
	(set FC_dest
		(askdir
			(prompt "In which disk or drawer should Final Copy be installed?")
			(help "The installation utility will create a drawer named "
				"\"FinalCopy\" in this directory.  All \"Final Copy\" "
				"files will be placed inside that directory. \n\n"
				" Tip for advanced users:\n "
				"  \"Final Copy\" may be moved to another directory as long as "
				" the sub-directories:\n"
				"   FCFiles, FCFonts, and FCLibs\n"
				" are moved (as subdirectories) to the program's new location")
			(default @default-dest)
		)
	)
)

(if (exists (tackon FC_dest "FinalCopy"))
	(if (exists (tackon FC_dest "FinalCopy/FinalCopy"))
		(set is_update 1)
		(set is_update 2)
	)
)

(set disk_space (getdiskspace FC_dest))

(if (AND (< disk_space 2200000) (NOT is_update))
  (
	(set answer1
		(askbool
			(prompt "There may not be enough room available on "
				"this drive to install \"Final Copy\".  Do you "
				"wish to continue?")
			(help "Final Copy needs approximately 2.5 Megabytes of "
				"disk space for a full installation.  If Final Copy "
				"is already installed on this partition or if you "
				"don't plan on using the additional outline fonts on the "
				"\"FCExtras\" disk, you may wish to continue.  Otherwise, "
				"press ABORT or NO now and either free some space on this "
				"partition or select a different partition for the "
				"installation.")
		)
	)
	(if (NOT answer1)
		(if (= @user-level 0)
			(abort "Final Copy needs approximately 2.5 Megabytes of "
				"disk space for a full installation.  The Volume \""
				@default-dest
				"\" does not have enough space available. You may override this "
				"warning in Intermediate or Expert mode.")
			(abort "Final Copy installation cancelled.")
		)
	)
  )
)

; get disk 1, "FCProgram"
(askdisk
	(prompt "Please insert the disk labeled \"FCProgram\"")
	(help	"The Final Copy program and other tools will be copied "
			"from the \"FCProgram\" Disk on to your system.")
	(dest "FCProgram")
)

;copy the Final Copy drawer over
(if (= is_update 2)
	(copyfiles
		(source "FCProgram:FinalCopy")
		(dest FC_dest) (pattern "#?") (infos)
	)
	(	(copyfiles
			(source "FCProgram:")
			(dest FC_dest) (pattern "FinalCopy") (infos)
		)
; Everything gets copied into the FC sub-dir
		(set FC_Dest (tackon FC_Dest "FinalCopy"))
	)
)

; delete IFFParse.library if it exists on their hard drive
; Note: this is the ONLY library that may be removed from "FCLibs" safely
(if (exists "LIBS:iffparse.library")
	(delete
		(tackon FC_dest "FCLibs/iffparse.library")
	)
)

(complete 35)

(askdisk
	(prompt "Please insert the disk labeled \"FCDataDisk\"")
	(help	"The Final Copy Data Disk contains the Speller "
			"and Thesaurus support files.  They "
			"are to be copied from the \"FCDataDisk\" Disk "
			"onto your system.")
	(dest "FCDataDisk")
)

;copy the Final Copy Data files drawer over
(copyfiles
	(source "FCDataDisk:")
	(dest FC_dest) (pattern "FCFiles#?") (infos)
)

(complete 70)

(if (> @user-level 1)
	(set answer1
		(askbool
			(prompt "Do you wish to install the additional Outline fonts?")
			(help	"The Final Copy Extras disk contains additional "
					"outline fonts that are similar to the native "
					"fonts on most PostScript® printers.  Saying YES "
					"will copy those fonts into the Final Copy PSFonts drawer")
			(default 1)
		)
	)
	(set answer1 1)
)

(if answer1
  (
	(askdisk
		(prompt "Please insert the disk labeled \"FCExtras\"")
		(help	"The Final Copy Extras disk contains additional "
				"outline fonts that are similar to the fonts "
				"native on most PostScript® printers.")
		(dest "FCExtras")
	)

	(set answer2
		(askbool
			(prompt "Place all outline fonts in same drawer?\n"
				"Saying YES will place all of the outline fonts on these disks "
				"inside the same directory, making them easier to access.  "
				"Otherwise, these additional fonts will be installed in a "
				"separate directory named \"PSFonts\".")
			(help "This will place the PostScript® similar fonts into "
				"the same directory as the original SoftWood outline fonts.  "
				"Otherwise, they will be placed in their own drawer, \"PSFonts\".")
			(default 0)
		)
	)

	(if answer2
		(set PS_dest (tackon FC_dest "FCFonts/SWOLFonts"))
		(	(set PS_dest (tackon FC_dest "FCFonts/SWOLFonts/PSFonts"))
			(makedir PS_dest (infos))
		)
	)

	(copyfiles
		(prompt "Please select the outline fonts you wish to install")
		(help @copyfiles-help)
		(source "FCExtras:psFonts")
		(dest PS_dest)
		(confirm 1) (all)
	)
  )
)

(complete 100)

(exit)
