(set is_update 0)
(complete 0)

(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_II\" 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, FCLibs, FCThes, and FCSpell\n"
			" are moved (as subdirectories) to the program's new location")
		(default @default-dest)
	)
)

; the FCSpell directory is a tell-tale sign that FC_II is already installed here
(if (exists (tackon FC_dest "FCSpell"))
	(set is_update 1)
)

(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 "
				"\"FCMoreFonts\" 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 the program disk
(askdisk
	(prompt "Please insert the disk labeled \"FCProgram_II\"" )
	(help	"The Final Copy program will be copied "
			"from the \"FCProgram_II\" Disk on to your system." )
	(dest "FCProgram_II" )
)

; Make dest directory with icon
(makedir (tackon FC_dest "FinalCopy_II") (infos))

; now, we want everything to be copied into this sub-dir
(set FC_dest (tackon FC_dest "FinalCopy_II"))
(set @default-dest FC_dest)

;copy the Final Copy drawer over
(copyfiles
	(source "FCProgram_II:")
	(dest FC_dest) (pattern "FinalCopy_II#?") (infos)
)

;copy the SampleMacros drawer over
(copyfiles
	(source "FCProgram_II:")
	(dest FC_dest) (pattern "SampleMacros#?") (infos)
)

;copy the SampleDocs drawer over
(copyfiles
	(source "FCProgram_II:")
	(dest FC_dest) (pattern "SampleDocs#?") (infos)
)

;copy the More program to the hard drive so everyone is
;guaranteed to have it.
(copyfiles
	(source "FCProgram_II:More")
	(dest FC_dest)
)

(tackon FC_dest "FCSpell")

(complete 20)

; Check if we are running 2.0
(if (< (/ (getversion) 65536) 37)
	(	; get system 1.3 disk
		(askdisk
			(prompt "Please insert the disk labeled \"FCSystem_1.3\""  )
			(help	"The Final Copy program and other tools will be copied "
					"from the \"" sys_disk "\" Disk on to your system." )
			(dest "FCSystem_1.3")
		)
		(copyfiles
			(source "FCSystem_1.3:")
			(dest FC_dest) (pattern "FC#?") (infos)
		)
	)
	(	; get system 2.0 disk
		(askdisk
			(prompt "Please insert the disk labeled \"FCSystem_2.0\""  )
			(help	"The Final Copy program and other tools will be copied "
					"from the \"" sys_disk "\" Disk on to your system." )
			(dest "FCSystem_2.0")
		)
		(copyfiles
			(source "FCSystem_2.0:")
			(dest FC_dest) (pattern "FC#?") (infos)
		)
	)
)

(complete 40)

; get the Speller disk
(askdisk
	(prompt "Please insert the disk labeled \"FCSpeller\"")
	(help	"The Final Copy Data Disk contains the Speller "
			"support files.  They are to be copied from the "
			"\"FCSpeller\" Disk on to your system.")
	(dest "FCSpeller")
)

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

(complete 60)

; get the Thesaurus disk
(askdisk
	(prompt "Please insert the disk labeled \"FCThesaurus\"")
	(help	"The Final Copy Data Disk contains the Thesaurus "
			"support files.  They are to be copied from the "
			"\"FCThesaurus\" Disk on to your system.")
	(dest "FCThesaurus")
)

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

(complete 80)

(if (> @user-level 1)
	(set answer1
		(askbool
			(prompt "Do you wish to install the additional Outline fonts?")
			(help	"The FCMoreFonts 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 \"FCMoreFonts\"")
		(help	"The FCMoreFonts disk contains additional "
				"outline fonts that are similar to the fonts "
				"native on most PostScript® printers.")
		(dest "FCMoreFonts")
	)

	(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 "FCMoreFonts:PSFonts")
		(dest PS_dest)
		(confirm 1) (all)
	)
  )
)

(complete 100)

(exit)
