;
; Install-OLE
;
; The OLE system installation script.
;
; $(C): (1994, Rocco Coluccelli, Bologna)
; $VER: Install-OLE 1.07 (22.Oct.1994)
;


;
;	variables
;
(set OLE_disk "OLE_disk:")

;
;	english
;
	(set þASK_OLE_DIR
		(cat
			"In which disk or drawer should a drawer \"OLE\" "
			"be created where all files will be copied?"
		)
	)

	(set þASK_OLE_DIR_HELP
		(cat
			"Here you specify, where you want to install all OLE System "
			"support files. A drawer \"OLE\" will "
			"be created, so you select \"DH0:\" to install OLE System "
			"in a drawer \"DH0:OLE\".\n\n"
		)
	)

	(set þASK_OLE_PREFS
		"\nWhere can I copy the OLE configuration program?\n"
	)

	(set þASK_OLE_PREFS_HELP
		(cat
			"Here you specify, where you want to install the configuration "
			"program for the OLE System.\n\n"
		)
	)

	(set þASK_FW
		"\nDestination for Final Writer scripts\n"
	)

	(set þASK_FW_HELP
		(cat
			"Select the path where you want copy the scripts for Final Writer.\n"
			"Read the OLE documentation for more informations.\n\n"
		)
	)

	(set þASK_PCALC
		"\nDestination for Professional Calc scripts\n"
	)

	(set þASK_PCALC_HELP
		(cat
			"Select the path where you want copy the scripts for ProCalc.\n"
			"Read the OLE documentation for more informations.\n\n"
		)
	)

	(set þCOPY_LIBS
		"\nCopy the ARexx libraries in LIBS:\n"
	)

	(set þCOPY_LIBS_HELP
		(cat
			"The OLE System use some ARexx libraries and you have to copy "
			"them into your LIBS: drawer.\n\n"
		)
	)

	(set þSTARTUP
		"\nAdd a few lines to User-Startup\n"
	)

	(set þSTARTUP_HELP
		(cat
			"The OLE System use the \"OLE:\" assignement and "
			"need the \"PIPE:\" device mounted for any script.\n"
			"This part of the installation add the necessary "
			"commands to your \"User-Startup\" file.\n\n"
		)
	)

	(set þBAD_KICK
		"\nYou must have Kickstart 2.04 or higher installed to use the OLE System.\n"
	)

	(set þWELCOME
		(cat
			"\n\nThe OLE System\n\n\n"
	        "This script installs the version 1.0\n"
	        "of the OLE System on your Amiga.\n\n\n\n"
	        "The OLE System © 1994 Rocco Coluccelli\n"
	        "All rights reserved"
		)
	)



;
;	italiano
;
(if (= @language "italiano")
(
	(set þASK_OLE_DIR
		(cat
			"In quale disco o cassetto vorresti che sia creata la directory \"OLE\" "
			"che ospiterà tutti i file necessari a OLE System?"
		)
	)

	(set þASK_OLE_DIR_HELP
		(cat
			"Qui devi specificare dove vuoi che vengano copiati tutti "
			"i files di supporto necessari a costruire OLE System. "
			"Un nuovo cassetto \"OLE\" sarà creato nel posto da te scelto per "
			"accogliere tutti i files necessari.\n\n"
		)
	)

	(set þASK_OLE_PREFS
		"\nDove vuoi che venga copiato il programma di configurazione?\n"
	)

	(set þASK_OLE_PREFS_HELP
		(cat
			"OLE System è dotato di un programma di configurazione indispensabile, "
			"con cui potrai personalizzarne l'interfaccia. Tipicamente si aggiunge ai programmi "
			"di configurazione del WorkBench 2.x e superiori.\n\n"
		)
	)

	(set þASK_FW
		"\nDestinazione per gli script di Final Writer\n"
	)

	(set þASK_FW_HELP
		(cat
			"Scegli dove vuoi che vengano copiati gli script per Final Writer.\n"
			"Leggi la documentazione che accompagna OLE System "
			"per maggiori informazioni.\n\n"
		)
	)

	(set þASK_PCALC
		"\nDestinazione per gli script di Professional Calc\n"
	)

	(set þASK_PCALC_HELP
		(cat
			"Scegli dove vuoi che vengano copiati gli script per ProCalc.\n"
			"Leggi la documentazione che accompagna OLE System "
			"per maggiori informazioni.\n\n"
		)
	)

	(set þCOPY_LIBS
		"\nDevo copiare alcune librerie ARexx LIBS:\n"
	)

	(set þCOPY_LIBS_HELP
		(cat
			"OLE System fa uso di alcune librerie ARexx che devono necessariamente"
			"essere copiate nel cassetto LIBS:\n"
			"Nel caso in cui siano già presenti, verranno aggiornate.\n\n"
		)
	)

	(set þSTARTUP
		"\nDevo aggiungere alcune linee all User-Startup\n"
	)

	(set þSTARTUP_HELP
		(cat
			"OLE System utilizza l'assegnamento \"OLE:\" per riferirsi "
			"a tutti i suoi moduli. Alcuni script usano PIPE: per lo "
			"scambio dei dati\n."
			"Ora verranno aggiunti i comandi necessari alla \"User-Startup\".\n\n"
		)
	)

	(set þBAD_KICK
		(cat
			"\nOLE System richiede il Kickstart 2.04 "
			"o superiore per funzionare correttamente.\n"
		)
	)

	(set þWELCOME
		(cat
			"\n\nThe OLE System\n\n\n"
	        "Questo script installa la versione 1.0\n"
	        "di OLE System sul tuo Amiga.\n\n\n\n"
	        "The OLE System © 1994 Rocco Coluccelli\n"
	        "Tutti i diritti sono riservati"
		)
	)
))



;
; make sure we are running under a 2.04 ROM or higher
;
(if (< (/ (getversion) 65536) 37)
	(abort þBAD_KICK)
)

(complete 0)
(message þWELCOME)
(welcome)


;
;	ask for destination drawers or partitions for OLE files etc.
;
(set OLE_dest
	(tackon
		(askdir
			(prompt þASK_OLE_DIR)
			(help
				þASK_OLE_DIR_HELP
				@askdir-help
			)
			(default "REXX:")
		)
		"OLE"
	)
)

(set @default-dest OLE_dest)

(set OLE_prefs_dest
	(askdir
		(prompt þASK_OLE_PREFS)
		(default "SYS:Prefs")
		(help þASK_OLE_PREFS_HELP)
	)
)

(set FW_dest
	(askdir
		(prompt þASK_FW)
		(default "REXX:")
		(help þASK_FW_HELP)
	)
)

(set PCALC_dest
	(askdir
		(prompt þASK_PCALC)
		(default "REXX:")
		(help þASK_PCALC_HELP)
	)
)

(if (and
		(= @pretend 0)
		(= (exists OLE_dest) 0)
	)
	(makedir OLE_dest)
)

;
;	copy the main program in REXX:
;
(copyfiles
	(source (tackon OLE_disk "Scripts"))
	(dest "REXX:")
	(pattern "#?.rexx")
	(files)
)

(complete 10)

;
;	copy all support files
;
(copyfiles
	(source (tackon OLE_disk "Scripts/OLE"))
	(dest OLE_dest)
	(all)
)

(copylib
	(prompt þCOPY_LIBS)
	(help þCOPY_LIBS_HELP)
	(source (tackon OLE_disk "libs"))
	(dest "LIBS:")
	(confirm 3)
)

(complete 60)

;
;	copy the configuration program for the OLE System
;
(copyfiles
	(source (tackon OLE_disk "Scripts/OLE_System"))
	(dest OLE_prefs_dest)
	(infos)
)

(complete 70)

;
;	copy the startup modules
;
(copyfiles
	(source (tackon OLE_disk "Scripts"))
	(dest FW_dest)
	(pattern "#?.fw")
	(files)
)

(copyfiles
	(source (tackon OLE_disk "Scripts"))
	(dest PCALC_dest)
	(pattern "#?.pcalc")
	(files)
)

(complete 90)

(startup "OLE System"
	(prompt þSTARTUP)
	(help þSTARTUP_HELP)
	(command
		"Assign OLE: \"" OLE_dest "\"\n"
		"Assign >NIL: PIPE: EXISTS\n"
		"If WARN\n"
		"    Mount PIPE:\n"
		"EndIf\n"
	)
)

(if (= @pretend 0)
	(makeassign "OLE" OLE_dest)
)

(complete 100)
(exit)
