; ProWrite Hard Disk Installer script
; Written by Mark Thomas

(if (< @user-level 1)
	(user 1)
	(user 2)
)

(message "Please hit proceed to start the hard drive installation of ProWrite.")

(if (> @user-level 1)
	(set drawer
		(askdir
			(prompt "Please select a drawer into which the ProWrite drawer is to be located.")
			(help "A drawer called 'ProWrite' will be created inside the drawer that you select.  All files for ProWrite will be installed into this 'ProWrite' drawer.")
			(default @default-dest)
		)
	)
	(set drawer @default-dest)
)

(set @default-dest (tackon drawer "ProWrite"))

(set pwfile (tackon @default-dest "ProWrite"))

(if (> @user-level 1)
	(if (exists @default-dest)
		(if
			(NOT
				(askbool
					(prompt "The drawer " @default-dest " already exists.  Do you wish to install over the current version of ProWrite installed?")
					(help "The drawer that you selected already exists, which indicates that a version of ProWrite is already installed on your hard drive.  If you select yes, then the installation will proceed over the currently installed version of ProWrite on your hard drive.  If you select no, then the installation will abort.")
				)
			)
			(abort "You chose not to install ProWrite over a version that is already installed on your hard drive.")
		)
	)
)

(makedir @default-dest (infos))

(set answer 1)
(if (> @user-level 1)
	(set answer
		(askbool
			(prompt "Do you wish to install the ProWrite program?")
			(help "The ProWrite program is necessary for running ProWrite.  It is the main program in the ProWrite package.")
		)
	)
)
(if answer
	( (askdisk
		(prompt "Please insert the Program disk in any drive.")
			(help "The Program disk is needed to install the files: ProWrite, PostScript Prep, Thesaurus, sample macros, and Main Dictionary.")
			(dest "Program")
		)

	(copyfiles
		(source "Program:")
			(dest @default-dest)
			(infos)
			(choices "ProWrite" "PostScript Prep")
		)

	(tooltype
		(dest (tackon @default-dest "ProWrite"))
			(noposition)
		)
		(tooltype
			(dest (tackon @default-dest "PostScript Prep"))
			(noposition)
		)

	)
)

(set answer 1)
(if (> @user-level 1)
	(set answer
		(askbool
			(prompt "Do you wish to install the Thesaurus?")
			(help "The Thesaurus file is needed to use the Thesaurus option in ProWrite.")
		)
	)
)
(if answer
	( (askdisk
		(prompt "Please insert the Program disk in any drive.")
			(help "The Program disk is needed to install the files: ProWrite, PostScript Prep, Thesaurus, sample macros, and Main Dictionary.")
			(dest "Program")
		)

	(copyfiles
		(source "Program:")
			(dest @default-dest)
			(infos)
			(choices "Thesaurus")
		)

	(tooltype
		(dest (tackon @default-dest "Thesaurus"))
			(noposition)
		)
	)
)

(set answer 1)
(if (> @user-level 1)
	(set answer
		(askbool
			(prompt "Do you wish to install the ProWrite example AREXX macros?")
			(help "The ProWrite example AREXX macros are macros that can be used if you have AREXX installed in you system.  If you do not have AREXX then you cannot use them, although you may still install them.\n\nAREXX comes standard with the 2.0 Workbench and is also available separately for the 1.3 Workbench.")
		)
	)
)
(if answer
	( (askdisk
		(prompt "Please insert the Program disk in any drive.")
			(help "The Program disk is needed to install the files: ProWrite, PostScript Prep, Thesaurus, sample macros, and Main Dictionary.")
			(dest "Program")
		)

	(copyfiles
		(source "Program:")
			(dest @default-dest)
			(infos)
			(choices "HangingIndent"
				"Indent"
					"UnIndent"
						"Transpose"
						"EndNote"
						"Math"
			)
		)

	(tooltype
		(dest (tackon @default-dest "HangingIndent"))
			(setdefaulttool pwfile)
		)
		(tooltype
			(dest (tackon @default-dest "Indent"))
			(setdefaulttool pwfile)
		)
		(tooltype
			(dest (tackon @default-dest "UnIndent"))
			(setdefaulttool pwfile)
		)
		(tooltype
			(dest (tackon @default-dest "Transpose"))
			(setdefaulttool pwfile)
		)
		(tooltype
			(dest (tackon @default-dest "EndNote"))
			(setdefaulttool pwfile)
		)
		(tooltype
			(dest (tackon @default-dest "Math"))
			(setdefaulttool pwfile)
		)
	)
)

(set answer 1)
(if (> @user-level 1)
	(set answer
		(askchoice
			(prompt "Select which dictionary to install, or none.")
			(help "The Main Dictionary is a small dictionary containing about 50,000 words.  The Big Dictionary is a dictionary containing over 100,000 words.  Most hard drive users will want to install the Big Dictionary.  If you do not want the dictionary option in ProWrite, then choose None.")
			(choices "Small Dictionary (50,000 words)"
				"Big Dictionary (100,000 words)"
					"None"
			)
			(default 1)
		)
	)
)
(if (= answer 0)
	( (askdisk
		(prompt "Please insert the Program disk in any drive.")
			(help "The Program disk is needed to install the files: ProWrite, PostScript Prep, Thesaurus, sample macros, Main Dictionary.")
			(dest "Program")
		)

	(copyfiles
		(source "Program:")
			(dest @default-dest)
			(infos)
			(choices "Main Dictionary")
		)

	(tooltype
		(dest (tackon @default-dest "Main Dictionary"))
			(noposition)
		)
	)
)
(if (= answer 1)
	( (askdisk
		(prompt "Please insert the Extras disk in any drive.")
			(help "The Extras disk is needed to install the files: Big Dictionary, File Convert, RAMStart, sample documents, and an optional Flow demo.")
			(dest "Extras")
		)

	(copyfiles
		(source "Extras:")
			(dest @default-dest)
			(infos)
			(choices "Big Dictionary")
		)

	(tooltype
		(dest (tackon @default-dest "Big Dictionary"))
			(noposition)
		)

	(delete (tackon @default-dest "Main Dictionary"))
		(delete (tackon @default-dest "Main Dictionary.info"))

	(rename (tackon @default-dest "Big Dictionary") (tackon @default-dest "Main Dictionary"))
		(rename (tackon @default-dest "Big Dictionary.info") (tackon @default-dest "Main Dictionary.info"))
	)
)

(set answer 1)
(if (> @user-level 1)
	(set answer
		(askbool
			(prompt "Do you wish to install the ProWrite sample documents?")
			(help "The ProWrite sample documents contain examples of a letter, a merge letter, data for the merge letter, and several resumes.")
		)
	)
)
(if answer
	( (askdisk
		(prompt "Please insert the Extras disk in any drive.")
			(help "The Extras disk is needed to install the files: Big Dictionary, File Convert, RAMStart, sample documents, and an optional Flow demo.")
			(dest "Extras")
		)

	(copyfiles
		(source "Extras:")
			(dest @default-dest)
			(infos)
			(choices "Documents")
		)

	(set docdrawer (tackon @default-dest "Documents"))

	(tooltype
		(dest docdrawer)
			(noposition)
		)
		(tooltype
			(dest (tackon docdrawer "Memo"))
			(setdefaulttool pwfile)
		)
		(tooltype
			(dest (tackon docdrawer "Merge Letter"))
			(setdefaulttool pwfile)
		)
		(tooltype
			(dest (tackon docdrawer "Chronological Resume"))
			(setdefaulttool pwfile)
		)
		(tooltype
			(dest (tackon docdrawer "Targeted Resume"))
			(setdefaulttool pwfile)
		)
		(tooltype
			(dest (tackon docdrawer "Merge Data"))
			(setdefaulttool pwfile)
		)
		(tooltype
			(dest (tackon docdrawer "Functional Resume"))
			(setdefaulttool pwfile)
		)
	)
)

(set answer 1)
(if (> @user-level 1)
	(set answer
		(askbool
			(prompt "Do you wish to install the File Convert utility?")
			(help "The File Convert utility is useful for converting other word processor documents into the ProWrite document format.\n\nSupported formats are BeckerText, excellence!, Final Copy, KindWords, Pen Pal, RTF, Scribble!, Textcraft, Textcraft Plus, TextPro, and WordPerfect.")
		)
	)
)
(if answer
	( (askdisk
		(prompt "Please insert the Extras disk in any drive.")
			(help "The Extras disk is needed to install the files: Big Dictionary, File Convert, RAMStart, sample documents, and an optional Flow demo.")
			(dest "Extras")
		)

	(copyfiles
		(source "Extras:")
			(dest @default-dest)
			(infos)
			(choices "Convert")
		)

	(tooltype
		(dest (tackon @default-dest "Convert"))
			(noposition)
		)
	)
)

(if (> @user-level 1)
	(if (askbool
		(prompt "Do you wish to install the Flow demo program?")
			(help "Flow is an outline processor and is available separately from New Horizons Software, Inc.  A demo version that does not save or print is included with the ProWrite package.")
		)
		( (askdisk
			(prompt "Please insert the Extras disk in any drive.")
				(help "The Extras disk is needed to install the files: Big Dictionary, File Convert, RAMStart, sample documents, and an optional Flow demo.")
				(dest "Extras")
			)

	(copyfiles
		(source "Extras:")
			(dest @default-dest)
				(infos)
				(choices "Flow" "Flow Info")
			)

	(tooltype
		(dest (tackon @default-dest "Flow"))
			(noposition)
			)
			(tooltype
				(dest (tackon @default-dest "Flow Info"))
				(noposition)
			)
		)
	)
)

(set sysmdrawer "SYS:Utilities")
(set sysanswer 1)
(if (> @user-level 1)
	( (set sysanswer
		(askbool
			(prompt "Do you wish to install the System Mover utility?")
				(help "The System Mover program is used for moving system files such as fonts, printer drivers, devices, libraries, and other files.  The natural place to install this program is in your SYS:Utilities drawer.")
			)
		)
	)
)
(if sysanswer
	( (askdisk
		(prompt "Please insert the Fonts & Devices disk in any drive.")
			(help "The Fonts & Devices disk is needed to install the files: System Mover, fonts, devices, and printer drivers.")
			(dest "Fonts & Devices")
		)

	(if (> @user-level 1)
		(set sysmdrawer
			(askdir
				(prompt "Please select the drawer where System Mover is to be installed.")
					(help "The System Mover program is used for moving system files such as fonts, printer drivers, devices, libraries, and other files.  The natural place to install this program is in your SYS:Utilities drawer.")
					(default "SYS:Utilities")
				)
			)
		)

	(copyfiles
		(source "Fonts & Devices:")
			(dest sysmdrawer)
			(infos)
			(choices "System Mover")
		)
		(tooltype
			(dest (tackon sysmdrawer "System Mover"))
			(noposition)
		)
	)
)

(set answer 1)
(if (> @user-level 1)
	(set answer
		(askbool
			(prompt "Do you wish to install the ProWrite fonts?")
			(help "This option will install the fonts that come with ProWrite into your system fonts drawer.  The fonts are used mainly for printing in Draft, NLQ, or PostScript mode, but can be used in any mode.\n\nIf the ProWrite fonts do not show up in the font list in ProWrite, then you may need to run FixFonts normally located in your SYS:System drawer.")
		)
	)
)
(if answer
	( (askdisk
		(prompt "Please insert the Fonts & Devices disk in any drive.")
			(help "The Fonts & Devices disk is needed to install the files: System Mover, fonts, devices, and printer drivers.")
			(dest "Fonts & Devices")
		)

	(foreach "FONTS:Times" "#?"
		(delete ("FONTS:Times/%s" @each-name))
		)
		(foreach "FONTS:Helvetica" "#?"
			(delete ("FONTS:Helvetica/%s" @each-name))
		)
		(foreach "FONTS:Courier" "#?"
			(delete ("FONTS:Courier/%s" @each-name))
		)
		(copyfiles
			(source "Fonts & Devices:fonts")
			(dest "FONTS:")
			(pattern "#?")
		)
	)
)

(set pranswer 1)
(if (> @user-level 1)
	(set pranswer
		(askbool
			(prompt "Do you wish to install a printer driver?")
			(help "Printer drivers are needed to use the print feature of ProWrite.")
		)
	)
)
(if pranswer
	( (set printer
		(askoptions
			(prompt "Select printer drivers to install. (Window 1 of 2)")
				(help "If you do not wish to select one of the printer drivers here, then remove all check marks from the boxes.\n\nIf your printer is not listed, then choose a printer that is compatible with your printer or look for your printer on the next option window.")
				(choices "Alphacom_Alphapro_101"
					"Brother_HR-15XL"
						"Calcomp_Colormaster"
							"Calcomp_Colormaster2"
							"CBM_MPS1000"
							"Diablo_630"
							"Diablo_Advantage_D25"
							"Diablo_C-150"
							"EpsonQ"
							"EpsonX"
							"EpsonXOld"
							"Generic"
							"Howtek_Pixelmaster"
							"HP_DeskJet"
							"HP_LaserJet"
							"HP_PaintJet"
				)
				(default 512)
			)
		)

	(askdisk
		(prompt "Please insert the Fonts & Devices disk in any drive.")
			(help "The Fonts & Devices disk is needed to install the files: System Mover, fonts, devices, and printer drivers.")
			(dest "Fonts & Devices")
		)

	(if (> printer 0)
		( (if (IN printer 0)
			(copyfiles
				(source "Fonts & Devices:devs/printers")
					(choices "Alphacom_Alphapro_101")
						(dest "DEVS:printers")
					)
				)
				(if (IN printer 1)
					(copyfiles
						(source "Fonts & Devices:devs/printers")
						(choices "Brother_HR-15XL")
						(dest "DEVS:printers")
					)
				)
				(if (IN printer 2)
					(copyfiles
						(source "Fonts & Devices:devs/printers")
						(choices "Calcomp_Colormaster")
						(dest "DEVS:printers")
					)
				)
				(if (IN printer 3)
					(copyfiles
						(source "Fonts & Devices:devs/printers")
						(choices "Calcomp_Colormaster2")
						(dest "DEVS:printers")
					)
				)
				(if (IN printer 4)
					(copyfiles
						(source "Fonts & Devices:devs/printers")
						(choices "CBM_MPS1000")
						(dest "DEVS:printers")
					)
				)
				(if (IN printer 5)
					(copyfiles
						(source "Fonts & Devices:devs/printers")
						(choices "Diablo_630")
						(dest "DEVS:printers")
					)
				)
				(if (IN printer 6)
					(copyfiles
						(source "Fonts & Devices:devs/printers")
						(choices "Diablo_Advantage_D25")
						(dest "DEVS:printers")
					)
				)
				(if (IN printer 7)
					(copyfiles
						(source "Fonts & Devices:devs/printers")
						(choices "Diablo_C-150")
						(dest "DEVS:printers")
					)
				)
				(if (IN printer 8)
					(copyfiles
						(source "Fonts & Devices:devs/printers")
						(choices "EpsonQ")
						(dest "DEVS:printers")
					)
				)
				(if (IN printer 9)
					(copyfiles
						(source "Fonts & Devices:devs/printers")
						(choices "EpsonX")
						(dest "DEVS:printers")
					)
				)
				(if (IN printer 10)
					(copyfiles
						(source "Fonts & Devices:devs/printers")
						(choices "EpsonXOld")
						(dest "DEVS:printers")
					)
				)
				(if (IN printer 11)
					(copyfiles
						(source "Fonts & Devices:devs/printers")
						(choices "generic")
						(dest "DEVS:printers")
					)
				)
				(if (IN printer 12)
					(copyfiles
						(source "Fonts & Devices:devs/printers")
						(choices "Howtek_Pixelmaster")
						(dest "DEVS:printers")
					)
				)
				(if (IN printer 13)
					(copyfiles
						(source "Fonts & Devices:devs/printers")
						(choices "HP_DeskJet")
						(dest "DEVS:printers")
					)
				)
				(if (IN printer 14)
					(copyfiles
						(source "Fonts & Devices:devs/printers")
						(choices "HP_LaserJet")
						(dest "DEVS:printers")
					)
				)
				(if (IN printer 15)
					(copyfiles
						(source "Fonts & Devices:devs/printers")
						(choices "HP_PaintJet")
						(dest "DEVS:printers")
					)
				)
			)
		)
		(set printer
			(askoptions
				(prompt "Select printer drivers to install. (Window 2 of 2)")
				(help "If you do not wish to select one of the printer drivers here, then remove all check marks from the boxes.\nIf your printer is not listed, then choose a printer that is compatible with your printer.")
				(choices "HP_ThinkJet"
					"ImageWriterII"
						"NEC_Pinwriter"
							"Okidata_293I"
							"Okidata_92"
							"Okimate_20"
							"Quadram_Quadjet"
							"Qume_LetterPro_20"
							"Seiko_5300"
							"Seiko_5300a"
							"Sharp_JX-730"
							"Tektronix_4693D"
							"Tektronix_4696"
							"Toshiba_P351C"
							"Toshiba_P351SX"
							"Xerox_4020"
				)
				(default 0)
			)
		)

	(askdisk
		(prompt "Please insert the Fonts & Devices disk in any drive.")
			(help "The Fonts & Devices disk is needed to install the files: System Mover, fonts, devices, and printer drivers.")
			(dest "Fonts & Devices")
		)

	(if printer
		( (if (IN printer 0)
			(copyfiles
				(source "Fonts & Devices:devs/printers")
					(choices "HP_ThinkJet")
						(dest "DEVS:printers")
					)
				)
				(if (IN printer 1)
					(copyfiles
						(source "Fonts & Devices:devs/printers")
						(choices "ImageWriterII")
						(dest "DEVS:printers")
					)
				)
				(if (IN printer 2)
					(copyfiles
						(source "Fonts & Devices:devs/printers")
						(choices "NEC_Pinwriter")
						(dest "DEVS:printers")
					)
				)
				(if (IN printer 3)
					(copyfiles
						(source "Fonts & Devices:devs/printers")
						(choices "Okidata_293I")
						(dest "DEVS:printers")
					)
				)
				(if (IN printer 4)
					(copyfiles
						(source "Fonts & Devices:devs/printers")
						(choices "Okidata_92")
						(dest "DEVS:printers")
					)
				)
				(if (IN printer 5)
					(copyfiles
						(source "Fonts & Devices:devs/printers")
						(choices "Okimate_20")
						(dest "DEVS:printers")
					)
				)
				(if (IN printer 6)
					(copyfiles
						(source "Fonts & Devices:devs/printers")
						(choices "Quadram_Quadjet")
						(dest "DEVS:printers")
					)
				)
				(if (IN printer 7)
					(copyfiles
						(source "Fonts & Devices:devs/printers")
						(choices "Qume_LetterPro_20")
						(dest "DEVS:printers")
					)
				)
				(if (IN printer 8)
					(copyfiles
						(source "Fonts & Devices:devs/printers")
						(choices "Seiko_5300")
						(dest "DEVS:printers")
					)
				)
				(if (IN printer 9)
					(copyfiles
						(source "Fonts & Devices:devs/printers")
						(choices "Seiko_5300a")
						(dest "DEVS:printers")
					)
				)
				(if (IN printer 10)
					(copyfiles
						(source "Fonts & Devices:devs/printers")
						(choices "Sharp_JX-730")
						(dest "DEVS:printers")
					)
				)
				(if (IN printer 11)
					(copyfiles
						(source "Fonts & Devices:devs/printers")
						(choices "Tektronix_4693D")
						(dest "DEVS:printers")
					)
				)
				(if (IN printer 12)
					(copyfiles
						(source "Fonts & Devices:devs/printers")
						(choices "Tektronix_4696")
						(dest "DEVS:printers")
					)
				)
				(if (IN printer 13)
					(copyfiles
						(source "Fonts & Devices:devs/printers")
						(choices "Toshiba_P351C")
						(dest "DEVS:printers")
					)
				)
				(if (IN printer 14)
					(copyfiles
						(source "Fonts & Devices:devs/printers")
						(choices "Toshiba_P351SX")
						(dest "DEVS:printers")
					)
				)
				(if (IN printer 15)
					(copyfiles
						(source "Fonts & Devices:devs/printers")
						(choices "Xerox_4020")
						(dest "DEVS:printers")
					)
				)
			)
		)
		(copyfiles
			(source "Fonts & Devices:devs")
			(pattern "#?")
			(dest "DEVS:")
			(files)
		)
		(message "Make sure that your printer driver is selected in Workbench preferences.")
	)
	(message "Make sure that you have a printer driver installed and selected." "  The System Mover utility can be used to install printer drivers and devices." (if sysanswer ("  The System Mover can be found in %s." sysmdrawer) "  The System Mover can be found on the Fonts & Devices disk.") "  To select a printer driver, use Workbench preferences.")
)

(exit)
