; $VER: DFA 2.6 (25.05.95)
; Script to install DFA V 2.6
;
; V2.5:
; - Auto detecting french/international distribution :-)
; - Don't overwrite existing infos dor DFA/DFAEditor/DFAPrefs
; - Reorganized distribution
; - DFA:C is added to search path

;========================================================
; English strings

(set default_lang 256)

	; Globals...

(set #msg-doserror-msg	"Dos Error %ld detected")

(set #msg-imgdrawers-prompt	"Copying Image drawer...")
(set #msg-iicon				"Installing Icon...")

	; Specials...

(set #msg-transcript-msg "Installing DFA - THE address utility...")

(set #msg-olddfa-prompt
	(cat	"There is an old version of DFA on "
			"your harddisk!\n\n"
			"Do you want to uninstall it?\n"
	)
)

(set #msg-olddfa-help
	(cat	"If you select 'YES', the old DFA "
			"and all related files, i.e. locale "
			"catalogs, preferences etc. are deleted. "
			"The address files are not touched, "
			"so you won't loose any addresses! "
	)
)

(set #msg-udfaexe-choice	"DFA executables" )
(set #msg-udfadoc-choice	"DFA documentation")
(set #msg-udfarexx-choice	"DFA Arexx scripts")
(set #msg-udfareadme-choice	"DFA readme files")
(set #msg-udfaodu-choice	"OwnDevUnit library")
(set #msg-udirtree-choice	"DFA directory tree")

(set #msg-uninstall-prompt	"Please select the parts of DFA to uninstall!")
(set #msg-uninstall-help
	(cat	"You may select none, some or all of the "
			"displayed items. The installer will try "
			"to uninstall the different parts of DFA.\n"
			"Please notice that it is not possible to "
			"uninstall the 'Addressfiles' drawer, as "
			"this would be too 'dangerous'.\n"
			"For this reason the DFA main directory "
			"keeps existent as well as the 'DFA:' "
			"assign, performed in the user-startup.\n\n"
			"Deleting the DFA directory tree means that "
			"all existing drawers within the 'DFA:' "
			"directory are deleted with the exeption of "
			"the 'Addressfiles' drawer (see above).\n"
			"Furthermore, only EMPTY drawers are deleted, "
			"i.e. the directory tree is only uninstalled, "
			"if you uninstall the drawers' contents as "
			"well.\n\n"
			"The catalog files are uninstalled in every "
			"case.\n"
	)
)

(set #msg-udfaexe-msg		"The DFA executables are to be uninstalled.")
(set #msg-udfadoc-msg		"The DFA documentation is to be uninstalled.")
(set #msg-udfarexx-msg		"The DFA Arexx scripts are to be uninstalled.")
(set #msg-udfareadme-msg	"The DFA readme files are to be uninstalled.")
(set #msg-udfaodu-msg		"The 'OwnDevUnit' library is to be uninstalled.")
(set #msg-udirtree-msg		"The DFA directory tree is to be uninstalled.")

(set #msg-udfa1xexe-working	"Deleting DFA V1.x executable...")
(set #msg-udfa20lib-working	"Deleting dfa 2.0 library...")
(set #msg-udfa20prf-working	"Deleting DFA 2.0 preferences program...")
(set #msg-udfawarn-msg
	(cat	"If you've already installed DFA V2.x please make sure "
			"that you don't mix up version 2.6 and previous version's "
			"executables as using a mixture of different versions may "
			"cause the system to crash"
	)
)

(set #msg-udfa1xcat-working	"Deleting catalog files of DFA V1.x...")
(set #msg-udfa20cat-working	"Deleting catalog files of DFA V2.x...")


(set #msg-uprefsfile-prompt
	(cat	"Do you want to delete your old "
			"preferences file?\n"
	)
)

(set #msg-uprefsfile-help
	(cat	"If you select 'YES', the old DFA "
			"preferences file is deleted, i.e. "
			"you have to rearrange all windows "
			"and set all preferences."
			"Notice that old preferences files "
			"CAN be read by newer DFA versions. "
	)
)

(set #msg-uprefsfile-working	"Deleting preferences file of DFA...")

(set #msg-nodfa-msg
	(cat	"No old version of DFA found!\n"
			"You either don't have an old version installed, "
			"or it is on a place on your harddisk where it "
			"wasn't found.\n\nIf you have installed an old "
			"version of DFA anywhere on your system, please "
			"delete it manually or make sure that both "
			"versions don't run at the same time, as they "
			"are not compatible in some ways."
	)
)

(set #msg-dfashare-msg
	(cat	"*** DFA is SHAREWARE ***\n\n"
			"If you use it regularly, please remember "
			"that you have to register!\n\n"
			"Please notice that the amount of time the "
			"author is able to invest into DFA depends "
			"directly on the number of people who register.\n"
			"Details about the registration can be found in "
			"the Registration program or in the documentation!\n\n"
			"Enjoy using DFA.\n\n"
			"Dirk Federlein"
	)
)

(set #msg-dfadest-prompt	"Please select a place for the DFA distribution")
(set #msg-dfadest-help
	(cat	"Choose a destination partition or directory "
			"to contain the DFA distribution. A new drawer, "
			"called 'DFA' will be generated to contain some "
			"parts of the distribution by default. Other parts "
			"of the distribution may be installed to this "
			"drawer or the drawer you specify in the particular "
			"case. "
	)
)

(set #msg-mkdfadir-prompt
	(cat	"You have selected a drawer named 'DFA'!\n"
			"Does this mean you want to install the "
			"DFA application to THIS drawer?"
	)
)
(set #msg-mkdfadir-help
	(cat	"Select 'Yes' to install DFA directly into "
			"the existing drawer or select 'No' to "
			"install the 'DFA' package into a new drawer "
			"called 'DFA'."
	)
)

(set #msg-installto-msg "The DFA application will be installed into: \n\n" )
(set #msg-setdirtree-working "Setting up the DFA default directory tree...")

(set #msg-imgdrawers-prompt
	(cat	"Would you like to get the very special\n"
			"Image Drawers of MagicWB 2.0 installed?\n\n"
	)
)

(set #msg-imgdrawers-help
	(cat	"Usually the default drawer image is used for "
			"all drawers.\n\n"
			"If you select 'Yes', the beautiful MagicWB 2.0 "
			"'Image Drawers' are installed!\n"
	)
)

(set #msg-startup-prompt	"Now the DFA assignment will be included into your user-startup file. ")
(set #msg-startup-help
	(cat	"This is absolutely needed for the DFA application\n"
			"to run correctly, so don't skip this part."
	)
)

(set #msg-defexe-prompt "Copying default executables...")

(set #msg-serverdest-prompt "Please select a place for the DFA-Server executable")
(set #msg-serverdest-help
	(cat	"Choose a destination partition or directory "
			"to contain the DFA-Server executable.  The install "
			"program copies the DFA-Server executable 'DFA' "
			"to the location you choose. "
			"No extra drawer will be created! "
	)
)

(set #msg-xserver-working		"Extracting DFA-Server executable from archive...")
(set #msg-iserver-prompt		"Installing the DFA-Server executable...")
(set #msg-iservericon-prompt	"Installing DFA-Server Icon...")


(set #msg-editordest-prompt	"Please select a place for the DFA-Editor executable")
(set #msg-editordest-help
	(cat	"Choose a destination partition or directory "
			"to contain the DFA-Editor executable.  The install "
			"program copies the DFA-Editor executable 'DFAEditor' "
			"to the location you choose. "
			"No extra drawer will be created! "
	)
)

(set #msg-xeditor-working		"Extracting DFA-Editor executable from archive...")
(set #msg-ieditor-prompt		"Installing the DFA-Editor executable...")
(set #msg-ieditoricon-prompt	"Installing DFA-Editor icon...")

(set #msg-prefsdest-prompt	"Please select a place for the DFA-Prefs executable")
(set #msg-prefsdest-help
	(cat	"Choose a destination partition or directory "
			"to contain the DFA-Prefs executable.  The install "
			"program copies the DFA-Prefs executable 'DFAPrefs' "
			"to the location you choose. "
			"No extra drawer will be created! "
	)
)

(set #msg-xprefs-working	"Extracting DFA-Prefs executable from archive...")
(set #msg-iprefs-prompt		"Installing the DFA-Preferences executable...")
(set #msg-iprefsicon-prompt	"Installing DFA-Prefs icon...")

(set #msg-libdest-prompt	"Please select a place for the DFA-Library")
(set #msg-libdest-help
	(cat	"Choose a destination partition or directory "
			"to contain the DFA-Library.  The install "
			"program copies the DFA-Library 'dfa.library' "
			"to the location you choose. "
			"No extra drawer will be created! "
	)
)
(set #msg-xlib-working	"Extracting the DFA-Library from archive...")
(set #msg-ilib-prompt	"Installing the DFA-Library...")

(set #msg-locale-prompt	"Which language(s) do you want to get installed?")
(set #msg-locale-help
	(cat	"You may choose none, one or more languages. "
			"If you don't have an operation system that "
			"supports locale, please select no language "
			"at all.\n"
			"Locale support is given in Workbench 2.1 "
			"and above.\n"
			"Please note that English is the builtin "
			"language and does not need extra catalog "
			"files! "
	)
)

(set #msg-xlocale-ger-working	"Extracting german catalogs from archive...")
(set #msg-xlocale-fre-working	"Extracting french catalogs from archive...")

(set #msg-ulocale-ger-working	"Deleting obsolete german catalogs...")
(set #msg-ulocale-ger-working	"Deleting obsolete french catalogs...")

(set #msg-arexx-prompt
	(cat	"Do you want to install the example AREXX scripts?\n\n"
			"Please notice that Arexx scripts that you may "
			"have got together with DFA V1.x are NOT "
			"compatible to the new ones in some ways!\n\n"
			"For details about these Arexx scripts please "
			"read the documentation and look up the "
			"information given in the particular scripts. "
	)
)
(set #msg-arexx-help
	(cat	"The sample ARexx scripts can give you an idea "
			"how to use DFA in connection to ARexx and e.g. "
			"the Cygnus Ed (by ADSG).\n"
			"Please notice: Only arexx scripts that do not "
			"already exist, will be installed!\n"
	)
)

(set #msg-arexxdest-prompt	"Select the directory where to install the ARexx scripts")
(set #msg-arexxdest-help
	(cat	"If you want to *use* the Arexx scripts at once, "
			"select an directory that is already within your "
			"Arexx search path."
	)
)
(set #msg-xarexx-working	"Extracting Arexx scripts from archive...")
(set #msg-copyarexx-prompt		"Copying Arexx scripts...")

(set #msg-keydest-prompt	"Select the directory where to install the DFA keyfile")
(set #msg-keydest-help
	(cat	"The DFA keyfile can be copied to any drawer. "
			"The default directory where the keyfile is "
			"copied to is 's:'."
			"If you select another drawer, the environment "
			"variable 'KEYPATH' is set accordingly."
	)
)
(set #msg-ikeyfile-prompt		"Installing the DFA keyfile...")
(set #msg-setkeypath-working	"Setting environment variable 'KEYPATH'...")

(set #msg-iadrfile-prompt	"Do you want to install the default\naddress file?")
(set #msg-iadrfile-help
	(cat	"The default address file is named 'default.dfa' and "
			"will be copied into the 'DFA:AddressFiles' drawer. "
			"It contains the author's address which could be "
			"useful in some cases (Bug reports, Registration etc.) "
			"However, if you do already have such a file within "
			"your 'DFA:Addressfiles' drawer you may not want to overwrite it. "
	)
)

(set #msg-updadrfileconfirm-prompt
	(cat	"There exists an old dfa database file called 's:adr.file' on your harddisk.\n"
			"Do you want to copy it to its new default location ('DFA:Addressfiles/default.dfa') ?"
	)
)

(set #msg-adrfileconfirm-prompt
	(cat	"Be careful!\n "
			"There already exists a file called 'default.dfa' in the 'DFA:Addressfiles' directory.\n "
			"Do you really want to overwrite this file? \n"
	)
)

(set #msg-doclang-prompt	"Choose which documentation you want to get installed")
(set #msg-doclang-help		
	(cat	"Depending on the language you select, "
			"the corresponding TeX, AmigaGuide, "
			"ONLINE help and readme files will "
			"be installed."
	)
)
(set #msg-doclang-eng-choice	"English documentation")
(set #msg-doclang-fra-choice	"French documentation")
(set #msg-doclang-ger-choice	"German documentation")

(set #msg-ireadme-prompt	"Copying default readme files...")

(set #msg-docparts-prompt
	(cat	"Choose the kind of documentation you would "
			"like to get installed"
	)
)
(set #msg-docparts-help
	(cat	"The AmigaGuide documentation will only "
			"be usefull, if you have an amigaguide "
			"reader like 'Amigaguide' or 'Multiview' "
			"It _can_ be used for ONLINE help as well "
			"but you can used separate ONLINE help "
			"files for that purpose.\n"
			"They will be installed later on.\n"
			"The DVI file makes only sense if you have "
			"a TeX package or at least parts of it installed. "
	)
)
(set #msg-docparts-ag-choice	"AmigaGuide documentation")
(set #msg-docparts-tex-choice	"TeX documentation (.dvi file)")

(set #msg-agdocdest-prompt	"Select the location to install the Amigaguide documentation")
(set #msg-agdocdest-help
	(cat	"Choose a destination partition or directory "
			"to contain the Amigaguide documentation. "
			"The install program will copy the Amigaguide documentation "
			"to this directory."
	)
)
(set #msg-xag-working		"Extracting Amigaguide documentation from archive...")
(set #msg-ag-prompt			"Copying Amigaguide documentation...")

(set #msg-texdocdest-prompt	"Select the location to install the TeX documentation")
(set #msg-texdocdest-help
	(cat	"Choose a destination partition or directory "
			"to contain the TeX documentation. "
			"The install program will copy the TeX documentation "
			"to this directory."
	)
)
(set #msg-xtex-working		"Extracting TeX documentation from archive")
(set #msg-tex-prompt		"Copying TeX documentation...")

(set #msg-oparts-prompt
	(cat	"You may choose the online help files you like "
			"to get installed. (select <HELP> for details!)"
	)
)
(set #msg-oparts-help
	(cat	"BIG Amigaguide documentation:\n"
			"This is the 'ordinary' AmigaGuide documentation "
			"If you've already installed it you may save some "
			"harddisk space if you select it. However, please "
			"don't forget that the complete file must be loaded "
			"into RAM, if the ONLINE help is invoked!\n\n"
			"Seperate ONLINE help files:\n"
			"These files are much smaller than the BIG "
			"documentation file. They need less RAM and "
			"are loaded much faster."
			"However they need some KB on your harddisk.\n\n"
			"No online help:\n"
			"If you don't need/like the ONLINE help feature, "
			"you may choose to select no ONLINE help file "
			"at all. But don't complain, if there doesn't "
			"pop up a help requester if you press HELP! "
	)
)
(set #msg-oparts-bighelp-choice		"Big AmigaGuide documentation (200 KB) ")
(set #msg-oparts-smallhelp-choice		"Small ONLINE help files (recommended!) ")
(set #msg-oparts-nohelp-choice			"No ONLINE help at all ")

(set #msg-onlinedest-prompt	"Select the location to install the ONLINE help")
(set #msg-onlinedest-help
	(cat	"Choose a destination partition or directory "
			"to contain the online help. "
			"The install program will copy the online help files "
			"to this directory."
	)
)
(set #msg-xonline-working	"Extracting ONLINE help from archive")
(set #msg-noonlinehelp-msg
	(cat	"You chose not to install any online help "
			"at all. If you want to install it later, "
			"look in the Documentation.lha archive for "
			"the files 'DFAEditor.guide' and "
			"'DFAPrefs.guide'. Use the 'lhx'-utility "
			"from the 'Tools' directory to extract these "
			"files and read the documentation to learn "
			"how to set the corresponding tooltypes "
			"for the 'DFA-Editor' and the 'DFA-Prefs' "
			"program."
	)
)

(set #msg-odu-prompt	"Do you want to install the OwnDevUnit.library\n(Version 3.3)?")
(set #msg-odu-help
	(cat	"This library is only needed, if you want to "
			"use DFAfor dialing. Even then it is only needed, "
			"if you are using programms like 'getty' that "
			"sit on the serial device all the time.\n"
			"In such a case the OwnDevUnit.library allows "
			"DFA to signal the 'foreign' application that "
			"it wants to use the serial device.\n "
			"If it is not currently used, i.e. no data is "
			"transferred, DFA gets the serial port for "
			"dialing and returns it as soon as the dialing "
			"job is completed."
	)
)
(set #msg-odudest-prompt	"Select the directory where to install the OwnDevUnit.library")
(set #msg-odudest-help "")
(set #msg-iodu-prompt	"Installing the OwnDevUnit.Library...")

(set #msg-tooltypes-msg
	(cat	"Now several tooltypes are set:\n\n"
			"* To DFA:       - The path of the DFA-Editor program \n\n"
			"* To DFAEditor: - The path of the DFA-Prefs program  \n"
			"                - The path of the ONLINE help file   \n\n"
			"* To DFAPrefs:  - The path of the ONLINE help file   \n\n"
			"All icon positions are reset as well."
	)
)

(set #msg-end1-msg	"The DFA-Server program (DFA) can be found in\n%s\n")
(set #msg-end2-msg	"The DFA-Editor is located in %s\n")
(set #msg-end3-msg	"and the DFA-Prefs program was copied to\n%s\n")

(set #msg-exit-msg	"\nHave fun using DFA\n (and don't forget that it's SHAREWARE)")

;========================================================
; German strings

(if (= @language "deutsch")
(
	(set default_lang 1)

(set #msg-doserror-msg	"DOS Fehler %ld aufgetreten.")

(set #msg-imgdrawers-prompt	"Kopiere Image-Schublade...")
(set #msg-iicon				"Installiere Icon...")

	; Specials...

(set #msg-transcript-msg "Installation des Adress-Programms DFA...")

(set #msg-olddfa-prompt
	(cat	"Es existiert eine alte Version von DFA "
			"auf Ihrer Festplatte!\n\n"
			"Wollen Sie diese deinstallieren?\n"
	)
)
(set #msg-olddfa-help
	(cat	"Wenn Sie 'YES' whlen, wird die alte Version"
			"von DFA und alle mit dieser Version in Verbindung "
			"stehenden Dateien, wie z.B. Locale-Kataloge, "
			"alte Voreinstellungen u.s.w. gelscht.\n\n"
			"Bestehende Adress-Dateien bleiben unberhrt, "
			"soda Sie keine Adressen verlieren!"
	)
)

(set #msg-udfaexe-choice	"DFA Programme" )
(set #msg-udfadoc-choice	"DFA Dokumentation")
(set #msg-udfarexx-choice	"DFA Arexx Skripte")
(set #msg-udfareadme-choice	"DFA Kurzmitteilungen (READMEs)")
(set #msg-udfaodu-choice	"OwnDevUnit-Library")
(set #msg-udirtree-choice	"DFA Verzeichnis-Struktur")

(set #msg-uninstall-prompt	"Bitte whlen Sie die Teile von DFA, die Sie deinstallieren wollen!")
(set #msg-uninstall-help
	(cat	"Sie knnen keinen Punkt, einige oder alle "
			"dargestellten Punkte auswhlen. Der Installer "
			"wird versuchen, die verschiedenen Teile von DFA "
			"zu deinstallieren.\n"
			"Bitte beachten Sie, da es nicht mglich "
			"ist, die Schublade mit den Adressdateien "
			"zu loeschen, da dies 'zu gefhrlich' wre.\n"
			"Aus diesen Grnden bleibt das DFA-Hauptverzeichnis "
			"ebenso wie der DFA-Assign (der in der user-startup "
			"Datei ausgefhrt wird) bestehen.\n\n"
			"Das Lschen der DFA-Verzeichnis-Struktur bedeutet, "
			"da alle Unterverzeichnisse innerhalb des 'DFA:' "
			"Verzeichnisses gelscht werden, mit Ausnahme "
			"der 'Addressfiles'-Schublade (siehe oben).\n"
			"Weiterhin werden nur LEERE Verzeichnisse gelscht, "
			"d.h. die Verzeichnis-Struktur wird nur dann "
			"gelscht, wenn Sie auch den Inhalt der Schubladen "
			"lschen.\n\n"
			"Die Lokale-Dateien werden in jedem Fall gelscht.\n"
	)
)

(set #msg-udfaexe-msg		"Die DFA - Programme werden deinstalliert.")
(set #msg-udfadoc-msg		"Die DFA - Dokumentation wird deinstalliert.")
(set #msg-udfarexx-msg		"Die DFA - Arexx-Skripts werden deinstalliert.")
(set #msg-udfareadme-msg	"Die DFA - Kurzmitteilungen (READMEs) werden deinstalliert.")
(set #msg-udfaodu-msg		"Die 'OwnDevUnit'-Library wird deinstalliert.")
(set #msg-udirtree-msg		"Die DFA - Verzeichnis-Struktur wird deinstalliert.")

(set #msg-udfa1xexe-working	"Lsche DFA V1.x...")
(set #msg-udfa20lib-working	"Lsche die DFA-2.0-Library...")
(set #msg-udfa20prf-working	"Lsche das DFA-2-0-Preferences-Programm...")
(set #msg-udfawarn-msg
	(cat	"Wenn Sie bereits DFA V2.x installiert hatten, stellen Sie bitte sicher, "
			"da Sie die Version 2.6 nicht mit frheren Version 'mischen', "
			"da eine gleichzeitige Benutzung von Teilen aus verschiedenen Versionen "
			"zu unerwnschten Nebeneffekten und sogar Systemabstrzen fhren kann."
	)
)

(set #msg-udfa1xcat-working	"Lsche Katalog-Dateien von DFA V1.x...")
(set #msg-udfa20cat-working	"Lsche Katalog-Dateien von DFA V2.x...")


(set #msg-uprefsfile-prompt
	(cat	"Wollen Sie Ihre alte Preferences-Datei "
			"lschen?"
	)
)

(set #msg-uprefsfile-help
	(cat	"Wenn Sie 'YES' whlen, wird die alte Voreinstellungs-Datei "
			"gelscht, d.h. Sie mssen alle Fensterpositionen "
			"neu justieren und alle Einstellungen von Grund auf "
			"vornehmen.\n\n"
			"Bitte beachten Sie, da alte Voreinstellungs-Dateien "
			"von aktuellen DFA-Versionen gelesen werden knnen."
	)
)

(set #msg-uprefsfile-working	"Lsche die DFA-Voreinstellungs-Datei...")

(set #msg-nodfa-msg
	(cat	"Keine alte DFA-Version gefunden!\n"
			"Entweder habe Sie gar keine alte Version installiert, "
			"oder sie befindet sich an einem Platz auf Ihrer "
			"Festplatte, wo sie nicht gefunden werden konnte.\n\n"
			"Wenn sich eine alte Version von DFA irgendwo auf Ihrem "
			"System befinden sollte, lschen Sie diese bitte von "
			"Hand, oder stellen Sie sicher, da beide Versionen nicht "
			"zur selben Zeit laufen, da sie nicht kompatibel sind."
	)
)

(set #msg-dfashare-msg
	(cat	"*** DFA ist SHAREWARE ***\n\n"
			"Wenn Sie DFA regelmig benutzen, denken Sie bitte "
			"daran, da Sie sich registrieren lassen mssen!\n"
			"Bitte beachten Sie, da die Zeit, die der Autor in DFA "
			"investieren kann, nicht zuletzt von der Anzahl der "
			"Anwender abhngt, die bereit sind, sich registrieren "
			"zu lassen.\n"
			"Wie Sie sich registrieren lassen knnen, entnehmen Sie "
			"bitte dem Registrierungs-Programm oder der Dokumentation.\n\n"
			"Viel Spa mit DFA wnscht Ihnen\n"
			"Dirk Federlein"
	)
)

(set #msg-dfadest-prompt	"Bitte whlen Sie einen Platz fr das DFA-Verzeichnis")
(set #msg-dfadest-help
	(cat	"Whlen Sie eine Partition oder eine Schublade, "
			"die das DFA-Paket enthalten soll. Eine neue Schublade "
			"mit dem Namen 'DFA' wird angelegt, die mindestens einige "
			"grundstzliche Teile des DFA-Packets enthalten wird.\n"
			"Andere Teile des DFA-Packets knnen in dieses Verzeichnis "
			"oder die jeweils von Ihnen vorgegebene Schublade kopiert werden."
	)
)

(set #msg-mkdfadir-prompt
	(cat	"Sie haben eine Schublade mit dem Namen 'DFA' ausgewhlt!\n"
			"Bedeutet dies, da Sie das DFA-Packet in DIESES "
			"Verzeichnis installieren wollen?"
	)
)

(set #msg-mkdfadir-help
	(cat	"Whlen Sie 'Yes' um das 'DFA'-Packet direkt in "
			"die bereits bestehende Schublade zu installieren "
			"oder whlen Sie 'No' um eine neue Schublade  mit "
			"dem Namen 'DFA' fr die 'DFA'-Distribution anzulegen."
	)
)

(set #msg-installto-msg "Die DFA-Applikation wird installiert nach:\n\n" )
(set #msg-setdirtree-working "Installiere die DFA-Verzeichnis-Struktur...")

(set #msg-imgdrawers-prompt
	(cat	"Mchten Sie die besonderen 'Image'-Schubladen "
			"der MagicWB 2.0 installieren?\n\n"
	)
)
(set #msg-imgdrawers-help
	(cat	"Normalerweise wird das 'Default'-Icon fr alle "
			"neu angelegten Schubladen verwendet.\n\n"
			"Wenn Sie jedoch 'Yes' whlen, werden die wunderschnen MagicWB 2.0 "
			"'Image'-Schubladen installiert!\n"
	)
)

(set #msg-startup-prompt	"Die DFA-Zuweisung wird nun in Ihre 'user-startup'-Datei eingefgt.")
(set #msg-startup-help
	(cat	"Dieser Vorgang ist absolut notwendig, damit die DFA-Application\n"
			"korrekt funktioniert. berspringen Sie also nicht diesen Teil "
			"der Installation!"
	)
)

(set #msg-defexe-prompt "Kopiere Standard-Programme...")

(set #msg-serverdest-prompt "Bitte whlen Sie einen Platz fr das DFA-Server Programm!")
(set #msg-serverdest-help
	(cat	"Whlen Sie eine Partition oder ein Verzeichnis "
			"das das DFA-Server Programm enthalten soll.  Das "
			"Installier-Program kopiert den DFA-Server (Dateiname: 'DFA') "
			"an den gewnschten Ort.\n"
			"Es wird keine zustzliche Schublade erzeugt!"
	)
)

(set #msg-xserver-working		"Entpacke das DFA-Server Programm...")
(set #msg-iserver-prompt		"Installiere das DFA-Server Programm...")
(set #msg-iservericon-prompt	"Installiere das DFA-Server Icon...")


(set #msg-editordest-prompt	"Bitte whlen Sie einen Platz fr das DFA-Editor Programm")
(set #msg-editordest-help
	(cat	"Whlen Sie eine Partition oder ein Verzeichnis, "
			"welches das DFA-Editor Programm enthalten soll.  Das "
			"Installations-Programm kopiert den DFA-Editor (Dateiname: 'DFAEditor') "
			"an den von Ihnen angegebenen Ort.\n"
			"Es wird keine zustzliche Schublade angelegt!"
	)
)

(set #msg-xeditor-working		"Entpacke das DFA-Editor Programm...")
(set #msg-ieditor-prompt		"Installiere das DFA-Editor Programm...")
(set #msg-ieditoricon-prompt	"Installiere das DFA-Editor Icon...")

(set #msg-prefsdest-prompt	"Bitte whlen Sie einen Platz fr das  DFA-Voreinstellungs-Programm!")
(set #msg-prefsdest-help
	(cat	"Whlen Sie eine Partition oder ein Verzeichnis, "
			"welches das DFA-Preferences-Programm enthalten soll. "
			"Das Installations-Program kopiert das DFA-Preferences-Programm "
			"(Dateiname: 'DFAPrefs') an den Ort, den Sie vorgeben.\n"
			"Es wird keine weitere Schublade angelegt!"
	)
)

(set #msg-xprefs-working	"Entpacke das DFA-Voreinstellungs Programm...")
(set #msg-iprefs-prompt		"Installiere das DFA-Voreinstellungs Programm...")
(set #msg-iprefsicon-prompt	"Installiere das DFA-Voreinstellungs Icon...")

(set #msg-libdest-prompt	"Bitte whlen Sie einen Platz fr die DFA-Library")
(set #msg-libdest-help
	(cat	"Whlen Sie eine Partition oder ein Verzeichnis, "
			"das die DFA-Library enthalten soll.  Das Installations-Programm"
			"kopiert die DFA-Library (Dateiname: 'dfa.library') "
			"an den von Ihnen vorgegebenen Ort.\n"
			"Es wird keine zustzliche Schublade erzeugt!"
	)
)
(set #msg-xlib-working	"Entpacke die DFA-Library...")
(set #msg-ilib-prompt	"Installiere die DFA-Library...")

(set #msg-locale-prompt	"Welche Sprache(n) wollen Sie installieren?")
(set #msg-locale-help
	(cat	"Sie knnen keine, eine oder mehrere Sprache whlen. "
			"Wenn Sie noch ein Betriebs-System verwenden, das "
			"keine Landessprachenuntersttzung bietet (OS 2.0), "
			"so whlen Sie bitte KEINE Sprache aus.\n"
			"Landessprachen werden ab Amiga-OS 2.1 untersttzt.\n"
			"Bitte beachten Sie, da Englisch die fest eingebaute "
			"Sprache ist und daher keine zustzlichen Kataloge "
			"bentigt! "
	)
)

(set #msg-xlocale-ger-working	"Entpacke deutsche Kataloge...")
(set #msg-xlocale-fre-working	"Entpacke franzsische Kataloge...")

(set #msg-ulocale-ger-working	"Entferne berflssige deutsche Kataloge...")
(set #msg-ulocale-ger-working	"Entferne berflssige franzsische Kataloge...")

(set #msg-arexx-prompt
	(cat	"Mchten Sie die mitgelieferten Beispiel-Arexx-Skripts installieren?\n\n"
			"Bitte beachten Sie, da eventuell vorhandene "
			"Arexx-Skripts der Versionen 1.0 bis 1.2x nicht in "
			"jeder Hinsicht zu denen der Version 2.x kompatibel sind!\n\n"
			"Zu nheren Informationen zu den jeweiligen Arexx-Skripts "
			"lesen Sie bitte die Dokumentation und sehen Sie auch "
			"in den Skripts selbst nach."
	)
)
(set #msg-arexx-help
	(cat	"Die Beispiel-ARexx-Skripts knnen Ihnen einen Eindruck "
			"davon vermitteln, wie man DFA in Verbindung mit Arexx und z.B. "
			"dem Cygnus-Ed (von ADSG) verwenden kann.\n"
			"Bitte beachten Sie: Nur Arexx-Scripts, die noch nicht "
			"vorhanden sind, werden installiert!\n"
	)
)

(set #msg-arexxdest-prompt	"Whlen Sie das Verzeichnis fr die Arexx-Skripts")
(set #msg-arexxdest-help
	(cat	"Wenn Sie die Arexx-Skripts *sofort* verwenden wollen, "
			"whlen Sie bitte ein Verzeichnis, das sich bereits innerhalb "
			"des Arexx-Such-Pfades befindent (z.B. 'Rexx:')"
	)
)
(set #msg-xarexx-working	"Entpacke Arexx-Skripts...")
(set #msg-copyarexx-prompt		"Kopiere Arexx-Skripts...")

(set #msg-keydest-prompt	"Whlen Sie ein Verzeichnis fr das DFA-Keyfile")
(set #msg-keydest-help
	(cat	"Das DFA-Keyfile kann in jede Schublade kopiert werden.\n"
			"Das Standard-Verzeichnis fr das Keyfile ist die "
			"'s:'-Schublade."
			"Wenn Sie ein anderes Verzeichnis whlen, so wird "
			"automatisch die Variable 'KEYPATH' entsprechend gesetzt."
	)
)
(set #msg-ikeyfile-prompt		"Installiere das DFA-Keyfile...")
(set #msg-setkeypath-working	"Setze die Umgebungs-Variable 'KEYPATH'...")

(set #msg-iadrfile-prompt	"Mchten Sie die Standard-Adress-Datei installieren?")
(set #msg-iadrfile-help
	(cat	"Die Standard-Adress-Datei nennt sich 'default.dfa' und "
			"wird in das Verzeichnis 'DFA:AddressFiles' kopiert.\n"
			"Sie enthlt die Adresse des Autors, welche in manchen "
			"Fllen von Nutzen sein kann (Fehler-Berichte, Registrierungen, usw.)\n"
			"Wenn Sie aber bereits eine derartige Datei in diesem "
			"Verzeichnis besitzen, wollen Sie diese wahrscheinlich "
			"nicht berschreiben."
	)
)
(set #msg-updadrfileconfirm-prompt
	(cat	"Es existiert bereits eine alte DFA-Datei mit dem Namen 's:adr.file' auf Ihrer Festplatte.\n"
			"Wollen Sie diese an den neuen, standardmig dafr vorgesehenen Platz ('DFA:Addressfiles/default.dfa') kopieren?"
	)
)

(set #msg-adrfileconfirm-prompt
	(cat	"Achtung! Vorsicht!\n\n"
			"Es existiert bereits eine Datei mit dem Namen 'default.dfa' "
			"im Verzeichnis 'DFA:Addressfiles'.\n "
			"Wollen Sie dieses TATSCHLICH berschreiben?"
	)
)

(set #msg-doclang-prompt	"Whlen Sie, welche Dokumentation Sie installieren mchten!")
(set #msg-doclang-help
	(cat	"Abhngig von der Sprache, die Sie anwhlen, "
			"wird die entprechende TeX- und AmigaGuide-"
			"Dokumentation, ONLINE-Hilfe und Kurzinformationen "
			"(READMEs) installiert."
	)
)
(set #msg-doclang-eng-choice	"Englische Dokumenation")
(set #msg-doclang-fra-choice	"Franzsische Dokumentation")
(set #msg-doclang-ger-choice	"Deutsche Dokumentation")

(set #msg-ireadme-prompt	"Kopiere Standard-Kurzinformationen (READMEs)...")

(set #msg-docparts-prompt
	(cat	"Whlen Sie, welche Art der Dokumentation "
			"Sie installieren mchten!"
	)
)
(set #msg-docparts-help
	(cat	"Die AmigaGuide-Dokumenation ist nur sinnvoll, "
			"wenn Sie ein entsprechendes Anzeigeprogramm, "
			"wie z.B. 'Multiview' oder 'AmigaGuide' besitzen.\n"
			"Sie *kann* auch fr die Online-Hilfe verwendet "
			"werden, aber fr diesen Zweck sind normalerweise "
			"separate Dateien vorgesehen.\n"
			"Diese werden (auf Wunsch) spter installiert.\n\n"
			"Die TeX-Dokumentation ntzt Ihnen nur dann etwas, "
			"wenn Sie zumindest Teile eines TeX-Packetes "
			"(z.B. PasTeX von G.Hemann) installiert haben."
	)
)
(set #msg-docparts-ag-choice	"AmigaGuide Dokumentation")
(set #msg-docparts-tex-choice	"TeX Dokumentation (.dvi Datei)")

(set #msg-agdocdest-prompt	"Whlen Sie einen Platz fr die AmigaGuide-Dokumentation")
(set #msg-agdocdest-help
	(cat	"Whlen Sie eine Partition oder ein Verzeichnis, "
			"das die Amigaguide-Dokumentation enthalten soll.\n"
			"Das Installations-Programm wird die AmigaGuide-Anleitung "
			"dorthin kopieren."
	)
)
(set #msg-xag-working		"Entpacke die AmigaGuide-Dokumentation...")
(set #msg-ag-prompt			"Kopiere Amigaguide Dokumentation...")

(set #msg-texdocdest-prompt	"Whlen Sie einen Platz fr die TeX-Dokumentation")
(set #msg-texdocdest-help
	(cat	"Whlen Sie eine Partition oder ein Verzeichnis, "
			"das die TeX-Dokumentation enthalten soll.\n"
			"Das Installations-Programm wird die TeX-Anleitung "
			"dorthin kopieren."
	)
)
(set #msg-xtex-working		"Entpacke die TeX-Dokumentation...")
(set #msg-tex-prompt		"Kopiere die TeX Dokumentation...")

(set #msg-oparts-prompt
	(cat	"Whlen Sie die ONLINE-Hilfe-Dateien, die Sie "
			"installieren mchten. (<HELP> fr nhere Informationen!)"
	)
)
(set #msg-oparts-help
	(cat	"GROSSE AmigaGuide-Dokumentation:\n"
			"Dies ist die 'normale' AmigaGuide-Dokumentation. "
			"Wenn Sie diese bereits zuvor installiert haben, knnen "
			"Sie etwas Festplatten-Platz sparen, wenn Sie sie "
			"auch hier auswhlen. Beachten Sie aber, da die komplette "
			"Datei ins RAM geladen werden mu wenn Sie die "
			"ONLINE-Hilfe anfordern.\n\n"
			"Getrennte ONLINE-Hilfe-Dateien:\n"
			"Diese Dateien sind viel kleiner, als die GROSSE "
			"AmigaGuide-Dokumentatioin. Sie bentigen daher "
			"weniger RAM: und knnen viel schneller geladen "
			"werden. Allerdings bentigen Sie etwas zustzlichen "
			"Platz auf Ihrer Festplatte.\n\n"
			"Keine ONLINE-Hilfe:\n"
			"Wenn Sie keine Online-Hilfe brauchen oder wnschen, "
			"knnen sie die Installation der Online-Hilfe "
			"vermeiden. Wundern Sie sich aber bitte nicht, "
			"wenn sie dann nach dem Druck auf die Help-Taste "
			"keine Online-Hilfe erhalten."
	)
)
(set #msg-oparts-bighelp-choice		"GROSSE AmigaGuide-Dokumentation (200 KB) ")
(set #msg-oparts-smallhelp-choice	"Getrennte Online-Hilfe-Dateien (empfohlen!) ")
(set #msg-oparts-nohelp-choice		"Keine Online-Hilfe")

(set #msg-onlinedest-prompt	"Whlen Sie einen Platz fr die ONLINE-Hilfe")
(set #msg-onlinedest-help
	(cat	"Whlen Sie eine Partition oder ein Verzeichnis, "
			"das die Online-Hilfe enthalten soll.\n"
			"Das Installations-Programm wird die Online-Hilfe-Dateien "
			"dorthin kopieren."
	)
)
(set #msg-xonline-working	"Entpacke die ONLINE-Hilfe...")
(set #msg-online-prompt		"Kopiere die ONLINE-Hilfe...")

(set #msg-noonlinehelp-msg
	(cat	"Sie haben die Wahl getroffen, keine ONLINE-Hilfe "
			"zu installieren. Wenn Sie diese spter doch noch "
			"installieren mchten, dann suchen Sie im Archiv "
			"'Documentation.lha' nach den Dateien 'DFAEditor.guide' und "
			"'DFAPrefs.guide'. Verwenden Sie das 'lhx'-Utility "
			"Um diese Dateien zu entpacken und lesen in der "
			"Dokumentation nach, wie die entsprechenden "
			"Tooltypes fr den DFA-Editor und das "
			"DFA-Voreinstellungs-Programm zu setzen sind."
	)
)

(set #msg-odu-prompt	"Wollen Sie die OwnDevUnit.library\n(Version 3.3) installieren?")
(set #msg-odu-help
	(cat	"Diese Library wird nur bentigt, wenn Sie DFA "
			"zum Anwhlen von Telefonnummern verwenden wollen.\n"
			"Selbst dann ist sie aber nur notwendig, wenn Sie "
			"Programme, wie z.B. den 'getty' verwenden, die "
			"permanent die serielle Schnittstelle blockieren.\n"
			"In solch einem Fall erlaubt die 'OwnDevUnit'-Library "
			"es DFA, der fremden Applikation 'mitzuteilen', da "
			"DFA die serielle Schnittstelle verwenden mchte. Falls die "
			"serielle Schnittstelle nicht gerade z.B. Daten "
			"bertrgt, kann DFA die serielle Schnittstelle "
			"zum Anwhlen verwenden und sie 'zurckgeben', "
			"sobald die Anwahl beendet ist."
	)
)
(set #msg-odudest-prompt	"Whlen Sie einen Platz fr die 'OwnDevUnit'-Library")
(set #msg-odudest-help "")
(set #msg-iodu-prompt	"Installiere die 'OwnDevUnit'-Library...")

(set #msg-tooltypes-msg
	(cat	"Jetzt werden einige Tooltypes gesetzt:\n\n"
			"* In DFA:       - Der Pfad des DFA-Editor Programms \n\n"
			"* Im DFAEditor: - Der Pfad des DFA-Prefs Programms  \n"
			"                - Der Pfad der Online-Hilfe-Datei   \n\n"
			"* in DFAPrefs:  - Der Pfad der Online-Hilfe-Datei   \n\n"
			"Alle Icon Positionen werden zurckgesetzt."
	)
)

(set #msg-end1-msg	"Das DFA-Server-Programm (DFA) kann in\n%s gefunden werden\n")
(set #msg-end2-msg	"Der DFA-Editor ist in %s\n")
(set #msg-end3-msg	"und das DFA-Prefs-Programm wurde nach\n%s kopiert.\n")

(set #msg-exit-msg	"\nViel Spa bei der Verwendung von DFA\n (und denken Sie daran: Es ist SHAREWARE)")

)
)

(transcript #msg-transcript-msg)

	; *****************************
	; Try to uninstall DFA V1.x/2.0
	; *****************************

	;
	; Is an old DFA (V[12].x) present?
	;

(if (OR (exists "ENV:DFA/DFA.prefs")
		(exists "SYS:WBStartup/DFA")
		(exists "Locale:Catalogs/deutsch/dfa.catalog" (noreq))
		(exists "Locale:Catalogs/franois/dfa.catalog" (noreq))
		(exists "DFA:Prefs/Installation" (noreq)))
	(
		(if (askbool
			(prompt	#msg-olddfa-prompt )
			(help	#msg-olddfa-help )
			)
			(
				;
				; >= V2.2 -> Use formerly generated CLI scripts
				;

				(if (exists "DFA:Prefs/Installation/U_DFADir" (noreq))
					(
						;
						; Ask for uninstallation details...
						;

						(set uninstall
							(askoptions
								(prompt #msg-uninstall-prompt)
								(choices	#msg-udfaexe-choice
											#msg-udfadoc-choice
											#msg-udfarexx-choice
											#msg-udfareadme-choice
											#msg-udfaodu-choice
											#msg-udirtree-choice
								)
								(help	#msg-uninstall-help )
								(default -1)
							)
						)

						(if (IN uninstall 0)
							(
								(message	#msg-udfaexe-msg)

								(run "execute DFA:Prefs/Installation/U_DFABinaries")

								; Now deinstall default executables...

								(run "delete DFA:C/Registration")
								(run "delete DFA:C/Registration.info")

								(run "delete DFA:C/ClickForColors")
								(run "delete DFA:C/ClickForColors.info")

								(run "delete DFA:Tools/CheckBirthday")
								(run "delete DFA:Tools/CheckBirthday.info")

									; V2.5: Moved from /Tools to /C

								(run "delete DFA:C/CheckBirthday")
								(run "delete DFA:C/CheckBirthday.info")
							)
						)

						(run "delete DFA:Prefs/Installation/U_DFABinaries")


						(if (IN uninstall 1)
							(
								(message #msg-udfadoc-msg)

								(run "execute DFA:Prefs/Installation/U_DFADocs")
							)
						)

						(run "delete DFA:Prefs/Installation/U_DFADocs")

						(if (IN uninstall 2)
							(
								(message #msg-udfarexx-msg )

								(run "execute DFA:Prefs/Installation/U_DFARexx")
							)
						)

						(run "delete DFA:Prefs/Installation/U_DFARexx")

						(if (IN uninstall 3)
							(
								(message #msg-udfareadme-msg )

								(if (exists "DFA:Important!")
									(
										(run "delete DFA:Important! ALL")
									)
								)

								(if (exists "DFA:Wichtig!")
									(
										(run "delete DFA:Wichtig! ALL")
									)
								)
							)
						)

						(if (IN uninstall 4)
							(
								(message #msg-udfaodu-msg)

								(run "execute DFA:Prefs/Installation/U_ODULib")
							)
						)

						(run "delete DFA:Prefs/Installation/U_ODULib")

						(if (IN uninstall 5)
							(
								(message #msg-udirtree-msg )

								(run "delete DFA:prefs/installation/U_DFADir")
								(run "delete DFA:prefs/installation")

								(run "delete DFA:C")
								(run "delete DFA:C.info")
								(run "delete DFA:Prefs")
								(run "delete DFA:Prefs.info")
								(run "delete DFA:Tools")
								(run "delete DFA:Tools.info")
								(run "delete DFA:Documentation")
								(run "delete DFA:Documentation.info")
								(run "delete DFA:Libs")
								(run "delete DFA:Libs.info")
								(run "delete DFA:Rexx")
								(run "delete DFA:Rexx.info")
								(run "delete DFA:Wichtig!")
								(run "delete DFA:Wichtig!.info")
								(run "delete DFA:Important!")
								(run "delete DFA:Important!.info")
							)
						)
					)
					(
						;
						; Uninstall DFA  <= V2.2
						;

							; Remove DFA V2.0 executables...

						(if (exists "SYS:WBStartup/DFA")
							(
								;
								; Delete DFA executable
								;

								(working #msg-udfa1xexe-working)

								(run "delete SYS:WBStartup/DFA")
								(run "delete SYS:WBStartup/DFA.info")
							)
						)

						(if (exists "Libs:dfa.library")
							(
								;
								; Delete DFA library
								;

								(working #msg-udfa20lib-working)

								(run "delete Libs:dfa.library")
							)
						)

						(if (exists "SYS:Prefs/DFAPrefs")
							(
								;
								; Delete DFA executable
								;

								(working #msg-udfa20prf-working)

								(run "delete SYS:Prefs/DFAPrefs")
								(run "delete SYS:Prefs/DFAPrefs.info")
							)
						)

						(message	#msg-udfawarn-msg )

					)
				)

					; All version uninstalling...

				(if (NOT (= (getassign "Locale") ""))
					(
						;
						; Delete locale catalogs
						;

						(working #msg-udfa1xcat-working)

						(run "delete Locale:Catalogs/dansk/dfa.catalog")
						(run "delete Locale:Catalogs/deutsch/dfa.catalog")
						(run "delete Locale:Catalogs/italiano/dfa.catalog")
						(run "delete Locale:Catalogs/nederlands/dfa.catalog")
						(run "delete Locale:Catalogs/suomi/dfa.catalog")
						(run "delete Locale:Catalogs/svenska/dfa.catalog")

						(working #msg-udfa20cat-working)

						(run "delete Locale:Catalogs/deutsch/dfa.catalog")
						(run "delete Locale:Catalogs/deutsch/dfalib.catalog")
						(run "delete Locale:Catalogs/deutsch/dfaprefs.catalog")
						(run "delete Locale:Catalogs/deutsch/dfaeditor.catalog")

						(run "delete Locale:Catalogs/franois/dfa.catalog")
						(run "delete Locale:Catalogs/franois/dfalib.catalog")
						(run "delete Locale:Catalogs/franois/dfaprefs.catalog")
						(run "delete Locale:Catalogs/franois/dfaeditor.catalog")

					)
				)

				(if (exists "ENV:DFA/DFA.prefs")
					(
						;
						; Delete prefs
						;

						(if (askbool
								(prompt	#msg-uprefsfile-prompt)
								(help	#msg-uprefsfile-help)
							)
							(
								(working #msg-uprefsfile-working )

								(run "delete ENV:DFA/DFA.prefs")
								(run "delete ENVARC:DFA/DFA.prefs")
							)
						)
					)
				)
			)
		)
	)
	(
		(message #msg-nodfa-msg )
	)
)

(complete 0)

(message	#msg-dfashare-msg )

;
; Set the dir and archive name for the binaries
;

(set bindir "/Archive/")
(set binarchive "/Archive/DFA.lha")

(set scratchdir "t:DFA_Scratch")
(makedir scratchdir)
(set scratchdir (cat scratchdir "/"))

(set clearscratchdir (cat (cat "delete " (tackon scratchdir "#?")) " all"))

(set DFAdir
	(askdir
		(prompt #msg-dfadest-prompt )
		(default "Work:")
		(help	#msg-dfadest-help)
	)
)

	; Check if Directory is already named DFA

(if (= (fileonly DFADir) "DFA")
	(
		(set MakeDFADir
			(askbool
				(prompt	#msg-mkdfadir-prompt)
				(help	#msg-mkdfadir-help )

				(default 1)
			)
		)

		(if (= MakeDFADir 1)
			(
					; Use existing directory

				(set DFADir (pathonly DFADir))

				(message #msg-installto-msg (tackon DFADir "DFA"))

			)
			(

					; DFA Directory has to be created...

				(message #msg-installto-msg (tackon DFADir "DFA"))

				(makedir (tackon DFAdir "DFA")
					(infos)
				)
			)
		)


	)
	(
		; DFA Directory has to be created...

		(makedir (tackon DFAdir "DFA")
			(infos)
		)
	)

)

(working #msg-setdirtree-working)

(makeassign "DFA" (tackon DFAdir "DFA"))

(makedir "DFA:Rexx"
	(infos)
)
(makedir "DFA:C"
	(infos)
)
(makedir "DFA:Prefs"
	(infos)
)

	; The following directory is meant for storing the deinstallation
	; scripts for the binaries, docs etc.

(makedir "DFA:Prefs/installation")

(makedir "DFA:Libs"
	(infos)
)
(makedir "DFA:Documentation"
	(infos)
)
(makedir "DFA:AddressFiles"
	(infos)
)

	; Write DFA dir...

(run "echo delete " (tackon DFAdir "DFA") " > DFA:Prefs/installation/U_DFADir" )
(run "protect DFA:Prefs/installation/U_DFADir s add")

(complete 5)

(set ImageDrawers
	(askbool
		(prompt	#msg-imgdrawers-prompt)
		(help	#msg-imgdrawers-help)
		(default 1)
	)
)

(if (= ImageDrawers 1)
	(

		(set cmdstring (cat "ram:lhx e " binarchive))
		(set cmdstring (cat (cat cmdstring " Addressfiles.info ") scratchdir))

		(run cmdstring)

		(run "rename " (tackon scratchdir "Addressfiles.info ") (tackon scratchdir "DFA.info"))
		(run "copy " (tackon scratchdir "DFA.info ") DFAdir)
		(run clearscratchdir)

		(run "ram:lhx e " binarchive " C.info Addressfiles.info Documentation.info Rexx.info Libs.info Prefs.info DFA:")
	)
)

(run "assign Libs: DFA:Libs ADD")

(complete 10)

(startup "DFA"
	( command	"assign DFA: " (tackon DFAdir "DFA") "\n")
	( command	"assign Libs: DFA:Libs ADD \n")
	( command	"path DFA:C ADD")
	( prompt	#msg-startup-prompt)
	( help		#msg-startup-help)
)

(complete 12)

	;
	; Copying default programs...
	;

(working #msg-defexe-prompt)

(set cmdstring (cat "ram:lhx e " binarchive))
(set cmdstring (cat (cat cmdstring " C/CheckBirthday C/CheckBirthday.info ") scratchdir))

(run cmdstring)

(copyfiles
	(prompt	#msg-defexe-prompt)
	(source (tackon scratchdir "C/CheckBirthday"))
	(dest "DFA:C")
	(infos)
)

(run clearscratchdir )

(copyfiles
	(prompt	#msg-defexe-prompt)
	(source "/ClickForColors")
	(dest "DFA:C")
	(infos)
)

	; ****************************
	; Install the Registration Prg
	; ****************************

(set cmdstring (cat "ram:lhx e " binarchive))
(set cmdstring (cat cmdstring " C/Registration C/Registration.info DFA:"))

(run cmdstring)

(set @default-dest "DFA:")

(complete 15)


	; ************************
	; Install the DFA - Server
	; ************************

	;
	; Select destination drawer
	;

(set serverdest
	(askdir
		(prompt #msg-serverdest-prompt)
		(help	#msg-serverdest-help)
		(default "SYS:WBStartup")
	)
)

	;
	; Extract executable from archive
	;

(working #msg-xserver-working)

(set cmdstring (cat "ram:lhx e " binarchive))
(set cmdstring (cat cmdstring " WBStartup/DFA WBStartup/DFA.info "))

	;
	; ...and execute it
	;

(run cmdstring scratchdir)

	;
	; Copy file and .info
	;

(copylib
	(prompt	#msg-iserver-prompt)
	(help	@copylib-help)
	(source	(tackon scratchdir "WBStartup/DFA"))
	(dest	serverdest)
)

(if (NOT (exists (tackon serverdest "DFA.info")))
	(
		(copyfiles
			(prompt	#msg-iserver-prompt)
			(source	(tackon scratchdir "WBStartup/DFA.info"))
			(dest	serverdest)
		)
	)
)

(run clearscratchdir)

(run "echo delete " (tackon serverdest "DFA") " > DFA:Prefs/installation/U_DFABinaries" )
(run "protect DFA:Prefs/installation/U_DFABinaries s add")
(run "echo delete " (tackon serverdest "DFA.info") " >> DFA:Prefs/installation/U_DFABinaries" )

(complete 20)


	; ************************
	; Install the DFA - Editor
	; ************************

	;
	; Select destination drawer
	;

(set editordest
	(askdir
		(prompt #msg-editordest-prompt)
		(help	#msg-editordest-help )
		(default "DFA:C")
	)
)

	;
	; Extract executable from archive
	;

(working #msg-xeditor-working)

(set cmdstring (cat "ram:lhx e " binarchive))
(set cmdstring (cat cmdstring " C/DFAEditor C/DFAEditor.info "))

(run cmdstring scratchdir)

	;
	; Copy file
	;

(copylib
	(prompt	#msg-ieditor-prompt)
	(help	@copylib-help)
	(source	(tackon scratchdir "C/DFAEditor"))
	(dest	editordest)
)

(if (NOT (exists (tackon editordest "DFAEditor.info")))
	(
		(copyfiles
			(prompt	#msg-ieditor-prompt)
			(source	(tackon scratchdir "C/DFAEditor.info"))
			(dest	editordest)
		)
	)
)

(run clearscratchdir)

(run "echo delete " (tackon editordest "DFAEditor") " >> DFA:Prefs/installation/U_DFABinaries" )
(run "echo delete " (tackon editordest "DFAEditor.info") " >> DFA:Prefs/installation/U_DFABinaries" )

(complete 25)

	; ***************************************
	; Install the DFA - Preferences - Program
	; ***************************************

	;
	; Select destination drawer
	;


(set prefsdest
	(askdir
		(prompt #msg-prefsdest-prompt)
		(help	#msg-prefsdest-help)
		(default "DFA:Prefs")
	)
)

	;
	; Extract executable from archive
	;

(working #msg-xprefs-working)

(set cmdstring (cat "ram:lhx e " binarchive))
(set cmdstring (cat cmdstring " Prefs/DFAPrefs Prefs/DFAPrefs.info "))

(run cmdstring scratchdir)

	;
	; Copy file
	;

(copylib
	(prompt	#msg-iprefs-prompt)
	(help	@copylib-help)
	(source	(tackon scratchdir "Prefs/DFAPrefs"))
	(dest	prefsdest)
)

(if (NOT (exists (tackon prefsdest "DFAPrefs.info")))
	(
		(copyfiles
			(prompt	#msg-iprefs-prompt)
			(source	(tackon scratchdir "Prefs/DFAPrefs.info"))
			(dest	prefsdest)
		)
	)
)

(run clearscratchdir)

(run "echo delete " (tackon prefsdest "DFAPrefs") " >> DFA:Prefs/installation/U_DFABinaries" )
(run "echo delete " (tackon prefsdest "DFAPrefs.info") " >> DFA:Prefs/installation/U_DFABinaries" )

(complete 35)

	; *************************
	; Install the DFA - Library
	; *************************

	;
	; Select destination drawer
	;

(set libdest
	(askdir
		(prompt	#msg-libdest-prompt)
		(help	#msg-libdest-help)
		(default "DFA:Libs")
	)
)

	;
	; Extract executable from archive
	;

(working #msg-xlib-working)

(set cmdstring (cat "ram:lhx e " binarchive))
(set cmdstring (cat cmdstring " libs/dfa.library "))

(run cmdstring scratchdir)

(copylib
	(prompt	#msg-ilib-prompt)
	(help	@copylib-help)
	(source	(tackon scratchdir "libs/dfa.library"))
	(dest	libdest)
)

(run clearscratchdir)

(run "echo delete " (tackon libdest "DFA.library") " >> DFA:Prefs/installation/U_DFABinaries" )

(complete 40)

	; ********************
	; Install Locale files
	; ********************

	;
	; Locale: drawer present ?
	;

(if (AND (NOT (= (getassign "Locale") "")) (exists "libs:locale.library"))
	(
		;
		; Select language(s)
		;

		;
		; Determine, if french language is present
		;

		(set cmdstring (cat "ram:lhx e " binarchive))
		(set cmdstring (cat cmdstring " Locale/Catalogs/franais/dfa.catalog "))

		(run cmdstring scratchdir)

		(if (exists (tackon scratchdir "Locale/Catalogs/franais/dfa.catalog") (noreq))
			(
				(set language
					(askoptions
						(prompt #msg-locale-prompt)
						(help	#msg-locale-help)
						(choices	"Deutsch"
									"Franais"
						)
					)
				)
			)
			(
				(set language
					(askoptions
						(prompt #msg-locale-prompt)
						(help	#msg-locale-help)
						(choices	"Deutsch"
						)
					)
				)
			)
		)

		(run "delete" (tackon scratchdir "Locale/Catalogs/franais/dfa.catalog"))

		;
		; Copy catalogs
		;

		(if (IN language 0)
			(
					;
					; German catalogs
					;

				(working #msg-xlocale-ger-working)

				(if (NOT (exists "Locale:Catalogs"))
				(
					(run "MakeDir Locale:Catalogs" )
				)
				)

				(if (NOT (exists "Locale:Catalogs/deutsch"))
				(
					(run "MakeDir Locale:Catalogs/deutsch" )
				)
				)


				(set cmdstring (cat "ram:lhx e " binarchive))
				(set cmdstring (cat cmdstring " Locale/Catalogs/deutsch/dfa.catalog Locale/Catalogs/deutsch/dfaeditor.catalog Locale/Catalogs/deutsch/dfaprefs.catalog Locale/Catalogs/deutsch/dfalib.catalog "))

				(run cmdstring scratchdir)

				(copyfiles
					(source (tackon scratchdir "Locale/Catalogs/deutsch"))
					(dest "Locale:Catalogs/deutsch")
					(prompt #msg-xlocale-ger-working)
					(pattern "#?.catalog")
				)

				(run clearscratchdir)

			)
			(
				(if (exists "Locale:Catalogs/deutsch/DFA.catalog")
				(
					(working #msg-ulocale-ger-working)

					(run "delete Locale:Catalogs/deutsch/DFA.catalog")
					(run "delete Locale:Catalogs/deutsch/DFALib.catalog")
					(run "delete Locale:Catalogs/deutsch/DFAEditor.catalog")
					(run "delete Locale:Catalogs/deutsch/DFAPrefs.catalog")

				)
				)

			)
		)

		(if (IN language 1)
			(
					;
					; French catalogs
					;

				(working #msg-xlocale-fre-working)

				(if (NOT (exists "Locale:Catalogs"))
				(
					(run "MakeDir Locale:Catalogs" )
				)
				)

				(if (NOT (exists "Locale:Catalogs/franais"))
				(
					(run "MakeDir Locale:Catalogs/franais" )
				)
				)


				(set cmdstring (cat "ram:lhx e " binarchive))
				(set cmdstring (cat cmdstring " Locale/Catalogs/franais/dfa.catalog Locale/Catalogs/franais/dfaeditor.catalog Locale/Catalogs/franais/dfaprefs.catalog Locale/Catalogs/franais/dfalib.catalog "))

				(run cmdstring scratchdir)

				(copyfiles
					(source (tackon scratchdir "Locale/Catalogs/franais"))
					(dest "Locale:Catalogs/franais")
					(prompt #msg-xlocale-fre-working)
					(pattern "#?.catalog")
				)

				(run clearscratchdir)

			)
			(
				(if (exists "Locale:Catalogs/franais/DFA.catalog")
				(
					(working #msg-ulocale-fre-working)

					(run "delete Locale:Catalogs/franais/DFA.catalog")
					(run "delete Locale:Catalogs/franais/DFALib.catalog")
					(run "delete Locale:Catalogs/franais/DFAEditor.catalog")
					(run "delete Locale:Catalogs/franais/DFAPrefs.catalog")
				)
				)

			)
		)
	)
)

(complete 50)

	; *********************************
	; Install the example arexx scripts
	; *********************************

(set installrexx
	(askbool
		(prompt	#msg-arexx-prompt)
		(help	#msg-arexx-help)
		(default 0)
	)
)

(if (= installrexx 1)
	(
		(set rexxdest
			(askdir
				(prompt #msg-arexxdest-prompt)
				(help	#msg-arexxdest-help)
				(default "DFA:Rexx")
			)
		)

		(working #msg-xarexx-working)

		(if (AND (NOT (= (substr rexxdest (- (strlen rexxdest) 1 ) 1 ) ":" ))
		        (NOT (= (substr rexxdest (- (strlen rexxdest) 1 ) 1 ) "/" )))
			(
					;
					; Destination ends not in ":" or "/", append "/"
					;

				(set rexxdest (cat rexxdest "/"))
			)
		)

		(set cmdstring (cat "ram:lhx e -t " binarchive))
		(set cmdstring (cat cmdstring " Rexx/* "))

		(run cmdstring scratchdir)

		(copyfiles
			(prompt	#msg-copyarexx-prompt)
			(source (tackon scratchdir "Rexx"))
			(dest rexxdest)
			(pattern "#?")
		)

		(run clearscratchdir)

		(run "echo delete " (tackon rexxdest "ArexxErrorCodes.include") " > DFA:Prefs/installation/U_DFARexx" )

		(run "protect DFA:Prefs/installation/U_DFARexx s add")

		(run "echo delete " (tackon rexxdest "Call.rexx") " >> DFA:Prefs/installation/U_DFARexx" )
		(run "echo delete " (tackon rexxdest "DoCall.dfa") " >> DFA:Prefs/installation/U_DFARexx" )
		(run "echo delete " (tackon rexxdest "email.dfa") " >> DFA:Prefs/installation/U_DFARexx" )
		(run "echo delete " (tackon rexxdest "export_bt_ii.dfa") " >> DFA:Prefs/installation/U_DFARexx" )
		(run "echo delete " (tackon rexxdest "export_dfa.dfa") " >> DFA:Prefs/installation/U_DFARexx" )
		(run "echo delete " (tackon rexxdest "export_tex.dfa") " >> DFA:Prefs/installation/U_DFARexx" )
		(run "echo delete " (tackon rexxdest "importadm.dfa") " >> DFA:Prefs/installation/U_DFARexx" )
		(run "echo delete " (tackon rexxdest "insert_adr.ced") " >> DFA:Prefs/installation/U_DFARexx" )
		(run "echo delete " (tackon rexxdest "insert_adrletter.ced") " >> DFA:Prefs/installation/U_DFARexx" )
		(run "echo delete " (tackon rexxdest "insert_texadr.ced") " >> DFA:Prefs/installation/U_DFARexx" )
		(run "echo delete " (tackon rexxdest "LetterHead.txt") " >> DFA:Prefs/installation/U_DFARexx" )
		(run "echo delete " (tackon rexxdest "makephonelist.ced") " >> DFA:Prefs/installation/U_DFARexx" )
		(run "echo delete " (tackon rexxdest "printlaserlabels.dfa") " >> DFA:Prefs/installation/U_DFARexx" )
		(run "echo delete " (tackon rexxdest "RemindBirthday.rexx") " >> DFA:Prefs/installation/U_DFARexx" )
		(run "echo delete " (tackon rexxdest "TeXAddressList.dfa") " >> DFA:Prefs/installation/U_DFARexx" )
		(run "echo delete " (tackon rexxdest "gentemplate.dfa") " >> DFA:Prefs/installation/U_DFARexx" )
		(run "echo delete " (tackon rexxdest "postprocess.dfa") " >> DFA:Prefs/installation/U_DFARexx" )
	)
)

(complete 60)

	; ****************************************************
	; Copy Keyfile, if available (registered version only)
	; ****************************************************

(if (exists "/s/DFA.key")
	(
		(set keydest
			(askdir
				(prompt #msg-keydest-prompt)
				(default "S:")
				(help	#msg-keydest-help)
			)
		)

		(set error
			(trap 4
				(copyfiles
					(source "/S/DFA.key")
					(dest keydest)
					(prompt #msg-ikeyfile-prompt)
				)
			)
		)

		(if (> error 0)
			(message (#msg-doserror-msg @ioerr))
		)
	)

	(if (NOT (= keydest "s:")) || (NOT (= keydest "S:"))
		(
			(working #msg-setkeypath-working)

			(run setenv "KEYPATH" keydest)
			(run copy "Env:KEYPATH" "EnvArc:")

		)
	)
)

(complete 63)

	; ********************************
	; Install the default address file
	; ********************************
	;
	; V2.2: s:adr.file -> DFA:AddressFiles/default.dfa

(if (exists "s:adr.file")
	(
		(if (NOT (exists "DFA:AddressFiles/default.dfa"))
			(if (askbool
					(prompt #msg-updadrfileconfirm-prompt)
					(help "" )
				)
				(
					(set error
						(trap 4
							(copyfiles (source "s:adr.file") (dest "DFA:AddressFiles") (newname "default.dfa") (infos) )
						)
					)

					(if (> error 0)
						(message (#msg-doserror-msg @ioerr))
					)
				)
			)
		)
	)
	(
		(set installadrfile
			(askbool
				(prompt	#msg-iadrfile-prompt)
				(help	#msg-iadrfile-help)
			)
		)

		(if (= installadrfile 1)
			(

				(set cmdstring (cat "ram:lhx e " binarchive))
				(set cmdstring (cat cmdstring " Addressfiles/* "))

				(run cmdstring scratchdir)

				(if (exists "DFA:AddressFiles/default.dfa")
					(
						(if (askbool
								(prompt #msg-adrfileconfirm-prompt)
								(help "" )
							)
							(
								(set error
									(trap 4
										(copyfiles (source (tackon scratchdir "Addressfiles/default.dfa")) (dest "DFA:AddressFiles") (infos) )
									)
								)

								(if (> error 0)
									(message (#msg-doserror-msg @ioerr))
								)
							)
						)
					)
					(
						(set error
							(trap 4
								(copyfiles (source (tackon scratchdir "Addressfiles/default.dfa")) (dest "DFA:AddressFiles") (infos) )
							)
						)

						(if (> error 0)
							(message (#msg-doserror-msg @ioerr))
						)
					)
				)
			)
		)
	)
)


(complete 65)

	; *************************
	; Install the documentation
	; *************************

	;
	; Try to extract any french documentation
	;

(set cmdstring (cat "ram:lhx e " binarchive))
(set cmdstring (cat cmdstring " Documentation/franais/dfaeditor.guide "))

(run cmdstring scratchdir)

	;
	; Determine if german OR french is present on disk
	;

(if (exists (tackon scratchdir "Documentation/franais/dfaeditor.guide") (noreq))
	(
		;
		; Get doc language
		;

		(run clearscratchdir)

		(set doclanguage
			(askchoice
				(prompt #msg-doclang-prompt)
				(help	#msg-doclang-help)
				(choices	#msg-doclang-eng-choice
							#msg-doclang-fra-choice
				)
				(default 0)
			)
		)
	)
	(

		;
		; Get doc language
		;

		(set doclanguage
			(askchoice
				(prompt #msg-doclang-prompt)
				(help	#msg-doclang-help)
				(choices	#msg-doclang-eng-choice
							#msg-doclang-ger-choice
				)
				(default 0)
			)
		)

			;
			; If german -> use lang # 2
			;

		(if (= doclanguage 1)
			(
				(set doclanguage 2)
			)
		)
	)
)

	;
	; Set documentation source directory
	;

(if (= doclanguage 0)
	(
			;
			; English documentation
			;

		(set docsource "Documentation/english/")

		(makedir "DFA:Important!"
			(infos)
		)

		(if (= ImageDrawers 1)
			(
				(copyfiles
					(prompt	#msg-imgdrawers-prompt)
					(source "/Important!.info")
					(dest "DFA:")
				)
			)
		)

		(copyfiles
			(prompt	#msg-ireadme-prompt)
			(source "/Important!")
			(dest "DFA:Important!")
			(all)
			(infos)
		)

		(tooltype (dest "DFA:Important!") (noposition))

	)
)
(if (= doclanguage 1)
	(
		;
		; French documentation
		;
		(set docsource "Documentation/franais/")

		(makedir "DFA:Important!"
			(infos)
		)

		(if (= ImageDrawers 1)
			(
				(copyfiles
					(prompt	#msg-imgdrawers-prompt)
					(source "/Important!.info")
					(dest "DFA:")
				)
			)
		)

		(copyfiles
			(prompt	#msg-ireadme-prompt)
			(source "/Important!")
			(dest "DFA:Important!")
			(all)
			(infos)
		)

		(tooltype (dest "DFA:Important!") (noposition))
	)
)
(if (= doclanguage 2)
	(
		;
		; German documentation
		;

		(set docsource "Documentation/deutsch/")

		(makedir "DFA:Wichtig!"
			(infos)
		)

		(if (= ImageDrawers 1)
			(
				(copyfiles
					(prompt	#msg-imgdrawers-prompt)
					(source "/Wichtig!.info")
					(dest "DFA:")
				)
			)
		)

		(copyfiles
			(prompt	#msg-ireadme-prompt)
			(source "/Wichtig!")
			(dest "DFA:Wichtig!")
			(all)
			(infos)
		)

		(tooltype (dest "DFA:Wichtig!") (noposition))
	)
)

	;
	; Part(s) of the documentation to be installed
	;

(set docparts
	(askoptions
		(prompt	#msg-docparts-prompt)
		(help	#msg-docparts-help)
		(choices	#msg-docparts-ag-choice
					#msg-docparts-tex-choice
		)
	)
)

	;
	; AmigaGuide documentation
	;

(if (IN docparts 0)
	(
		(set guidedocdest
			(askdir
				(prompt #msg-agdocdest-prompt)
				(help	#msg-agdocdest-help)
				(default "DFA:Documentation")
			)
		)

		(working #msg-xag-working)

		(if (AND (NOT (= (substr guidedocdest (- (strlen guidedocdest) 1 ) 1 ) ":" ))
			(NOT (= (substr guidedocdest (- (strlen guidedocdest) 1 ) 1 ) "/" )))
			(
					;
					; Destination ends not in ":" or "/", append "/"
					;

				(set guidedocdest (cat guidedocdest "/"))
			)
		)

		(set cmdstring (cat (cat "ram:lhx e " binarchive) " "))
		(set cmdstring (cat cmdstring (tackon docsource "DFA.guide* ")))

		(run cmdstring scratchdir)

		(copyfiles
			(prompt	#msg-ag-prompt)
			(source (tackon scratchdir (tackon docsource "DFA.guide")))
			(dest guidedocdest)
		)

		(copyfiles
			(prompt	#msg-ag-prompt)
			(source (tackon scratchdir (tackon docsource "DFA.guide.info")))
			(dest guidedocdest)
		)

		(run clearscratchdir)

		(tooltype (dest (tackon guidedocdest "DFA.guide")) (noposition))

		(run "echo delete " (tackon guidedocdest "DFA.guide") " > DFA:Prefs/installation/U_DFADocs" )
		(run "protect DFA:Prefs/installation/U_DFADocs s add")
		(run "echo delete " (tackon guidedocdest "DFA.guide.info") " >> DFA:Prefs/installation/U_DFADocs" )

	)
)

(complete 72)

	;
	; TeX documentation - DVI file
	;


(if (IN docparts 1)
	(
		(set texdocdest
			(askdir
				(prompt #msg-texdocdest-prompt)
				(help	#msg-texdocdest-help)
				(default "DFA:Documentation")
			)
		)

		(working #msg-xtex-working)

		(if (AND (NOT (= (substr texdocdest (- (strlen texdocdest) 1 ) 1 ) ":" ))
			(NOT (= (substr texdocdest (- (strlen texdocdest) 1 ) 1 ) "/" )))
			(
					;
					; Destination ends not in ":" or "/", append "/"
					;

				(set texdocdest (cat texdocdest "/"))
			)
		)

		(set cmdstring (cat (cat "ram:lhx e " binarchive) " "))
		(set cmdstring (cat cmdstring (tackon docsource "DFA.dvi* ")))

		(run cmdstring scratchdir)

		(copyfiles
			(prompt	#msg-tex-prompt)
			(source (tackon scratchdir (tackon docsource "DFA.dvi")))
			(dest texdocdest)
		)
		(copyfiles
			(prompt	#msg-tex-prompt)
			(source (tackon scratchdir (tackon docsource "DFA.dvi.info")))
			(dest texdocdest)
		)

		(run clearscratchdir)

		(tooltype (dest (tackon texdocdest "DFA.dvi")) (noposition))

		(run "echo delete " (tackon guidedocdest "DFA.dvi") " >> DFA:Prefs/installation/U_DFADocs" )
		(run "echo delete " (tackon guidedocdest "DFA.dvi.info") " >> DFA:Prefs/installation/U_DFADocs" )
	)
)

(complete 80)

	; ***********************
	; Install the online help
	; ***********************

(set oparts
	(askchoice
		(prompt	#msg-oparts-prompt)
		(help		#msg-oparts-help)
		(choices	#msg-oparts-bighelp-choice
					#msg-oparts-smallhelp-choice
					#msg-oparts-nohelp-choice
		)
		(default 1)
	)
)

	;
	; The following "exists" command is needed to make
	; the installer _NOT_ crash on the HELP _defer_ assign!
	;

(if (exists "HELP:dummy" (noreq))
	(
		(set dummy "HELP:")
	)
	(
		(set dummy "DFA:Documentation")
	)
)

	;
	; Set DFA:Documentation for default!
	;

(set DefaultOnlineHelp "DFA:Documentation")

(if (= oparts 0)
	(
			;
			; BIG AmigaGuide file
			;

			;
			; ...already installed ?
			;

		(if (IN docparts 0)
			(
					;
					; Set both help vars to the main guide file
					;

				(set editorhelp (tackon guidedocdest "DFA.guide"))
				(set prefshelp (tackon guidedocdest "DFA.guide"))
			)
			(
					;
					; Not installed -- do it now
					;

				(set guidedocdest
					(askdir
						(prompt #msg-agdocdest-prompt)
						(help	#msg-agdocdest-help)
						(default DefaultOnlineHelp)
					)
				)

				(working #msg-xag-working)

				(if (AND (NOT (= (substr guidedocdest (- (strlen guidedocdest) 1 ) 1 ) ":" ))
					(NOT (= (substr guidedocdest (- (strlen guidedocdest) 1 ) 1 ) "/" )))
					(
							;
							; Destination ends not in ":" or "/", append "/"
							;

						(set guidedocdest (cat guidedocdest "/"))
					)
				)

				(set cmdstring (cat (cat "ram:lhx e " binarchive) " "))
				(set cmdstring (cat cmdstring (tackon docsource "DFA.guide DFA.guide.info ")))

				(run cmdstring scratchdir)

				(copyfiles
					(prompt	#msg-ag-prompt)
					(source (tackon scratchdir (tackon docsource "DFA.guide")))
					(dest guidedocdest)
				)
				(copyfiles
					(prompt	#msg-ag-prompt)
					(source (tackon scratchdir (tackon docsource "DFA.guide.info")))
					(dest guidedocdest)
				)

				(run clearscratchdir)

				(tooltype (dest (tackon guidedocdest "DFA.guide")) (noposition))

				(run "echo delete " (tackon guidedocdest "DFA.guide") " >> DFA:Prefs/installation/U_DFADocs" )
				(run "echo delete " (tackon guidedocdest "DFA.guide.info") " >> DFA:Prefs/installation/U_DFADocs" )
				(run "protect DFA:Prefs/installation/U_DFADocs s add")


					;
					; Set both help vars to the main guide file
					;

				(set editorhelp (tackon guidedocdest "DFA.guide"))
				(set prefshelp (tackon guidedocdest "DFA.guide"))

			)
		)
	)
	(
		(if (= oparts 1)
			(
					;
					; Special ONLINE help files
					;

				(if (= doclanguage 0)
					(
						;
						; english
						;

						(if (exists (tackon DefaultOnlineHelp "English/"))
							(
								(set onlinehelpdefdest (tackon DefaultOnlineHelp "English/"))
							)
							(
								(set onlinehelpdefdest "DFA:Documentation")
							)
						)

					)
				)

				(if (= doclanguage 1)
					(
						;
						; french
						;

						(if (exists (tackon DefaultOnlineHelp "Franais/"))
							(
								(set onlinehelpdefdest (tackon DefaultOnlineHelp "Franais/"))
							)
							(
								(set onlinehelpdefdest "DFA:Documentation")
							)
						)

					)
				)

				(if (= doclanguage 2)
					(
						;
						; german
						;

						(if (exists (tackon DefaultOnlineHelp "Deutsch/"))
							(
								(set onlinehelpdefdest (tackon DefaultOnlineHelp "Deutsch/"))
							)
							(
								(set onlinehelpdefdest "DFA:Documentation")
							)
						)

					)
				)

				(set onlinehelpdest
					(askdir
						(prompt #msg-onlinedest-prompt)
						(help	#msg-onlinedest-help)
						(default onlinehelpdefdest)
					)
				)

				(working #msg-xonline-working)

				(if (AND (NOT (= (substr onlinehelpdest (- (strlen onlinehelpdest) 1 ) 1 ) ":" ))
					(NOT (= (substr onlinehelpdest (- (strlen onlinehelpdest) 1 ) 1 ) "/" )))
					(
							;
							; Destination ends not in ":" or "/", append "/"
							;

						(set onlinehelpdest (cat onlinehelpdest "/"))
					)
				)

				(set cmdstring (cat (cat "ram:lhx e " binarchive) " "))
				(set cmdstring (cat cmdstring (tackon docsource "DFAEditor.guide* ")))

				(run cmdstring scratchdir)

				(set cmdstring (cat (cat "ram:lhx e " binarchive) " "))
				(set cmdstring (cat cmdstring (tackon docsource "DFAPrefs.guide* ")))

				(run cmdstring scratchdir)

				(copyfiles
					(prompt	#msg-online-prompt)
					(source (tackon scratchdir (tackon docsource "DFAEditor.guide")))
					(dest onlinehelpdest)
				)
				(copyfiles
					(prompt	#msg-online-prompt)
					(source (tackon scratchdir (tackon docsource "DFAEditor.guide.info")))
					(dest onlinehelpdest)
				)

				(copyfiles
					(prompt	#msg-online-prompt)
					(source (tackon scratchdir (tackon docsource "DFAPrefs.guide")))
					(dest onlinehelpdest)
				)

				(copyfiles
					(prompt	#msg-online-prompt)
					(source (tackon scratchdir (tackon docsource "DFAPrefs.guide.info")))
					(dest onlinehelpdest)
				)

				(run clearscratchdir)

				(tooltype (dest (tackon onlinehelpdest "DFAEditor.guide")) (noposition))

				(run "echo delete " (tackon onlinehelpdest "DFAEditor.guide") " >> DFA:Prefs/installation/U_DFADocs" )
				(run "echo delete " (tackon onlinehelpdest "DFAEditor.guide.info") " >> DFA:Prefs/installation/U_DFADocs" )

				(tooltype (dest (tackon onlinehelpdest "DFAPrefs.guide")) (noposition))

				(run "echo delete " (tackon onlinehelpdest "DFAPrefs.guide") " >> DFA:Prefs/installation/U_DFADocs" )
				(run "echo delete " (tackon onlinehelpdest "DFAPrefs.guide.info") " >> DFA:Prefs/installation/U_DFADocs" )

					;
					; Set both help vars to the onlinehelp files
					;

				(set editorhelp (tackon onlinehelpdest "DFAEditor.guide"))
				(set prefshelp (tackon onlinehelpdest "DFAPrefs.guide"))

			)
			(
				(if (= oparts 2)
					(
							;
							; NO ONLINE help
							;

						(message	#msg-noonlinehelp-msg)

						(set editorhelp "")
						(set prefshelp "")

					)
				)
			)
		)
	)
)

(complete 90)

	; **************************
	; Install 3rd party software
	; **************************

	;
	; Install OwndevUnit
	;

(set installodu
	(askbool
		(prompt	#msg-odu-prompt)
		(help	#msg-odu-help)
		(default 0)
	)
)

(if (= installodu 1)
	(
		(set odudest
			(askdir
				(prompt #msg-odudest-prompt)
				(help	#msg-odudest-help)
				(default "Libs:")
			)
		)

		(set cmdstring (cat "ram:lhx e " binarchive))
		(set cmdstring (cat cmdstring " libs/OwnDevUnit.library "))

		(run cmdstring scratchdir)

		(copylib
			(prompt #msg-iodu-prompt)
			(help	@copylib-help)
			(source (tackon scratchdir "libs/OwnDevUnit.library"))
			(dest odudest)
			(confirm)
			(optional)
		)

		(run clearscratchdir)

		(run "echo delete " (tackon odudest "OwnDevUnit.library") " > DFA:Prefs/installation/U_ODULib" )
		(run "protect DFA:Prefs/installation/U_ODULib s add")
	)
)

(complete 92)

(run "delete " scratchdir " all")


	; ******************
	; Set some tooltypes
	; ******************

	;
	; Tooltypes for the executables...
	;

(message #msg-tooltypes-msg)

(tooltype (dest (tackon serverdest "DFA")) (settooltype ("DFAEDITOR") (tackon editordest "DFAEditor")))
(tooltype (dest (tackon editordest "DFAEditor")) (settooltype ("DFAPREFS") (tackon prefsdest "DFAPrefs")))
(tooltype (dest (tackon editordest "DFAEditor")) (settooltype ("GUIDEFILE") (editorhelp)))
(tooltype (dest (tackon prefsdest "DFAPrefs")) (settooltype ("GUIDEFILE") (prefshelp)))

	;
	; Now reset some icon positions...
	;

	; for the executables...

(tooltype (dest (tackon serverdest "DFA")) (noposition))
(tooltype (dest (tackon editordest "DFAEditor")) (noposition))
(tooltype (dest (tackon prefsdest "DFAPrefs")) (noposition))
(tooltype (dest (tackon DFAdir "DFA")) (noposition))
(tooltype (dest "DFA:C/Registration")  (noposition))
(tooltype (dest "DFA:C/ClickForColors")  (noposition))

	; for the drawers...

(tooltype (dest (tackon DFAdir "DFA")) (noposition))
(tooltype (dest "DFA:Rexx") (noposition))
(tooltype (dest "DFA:C") (noposition))
(tooltype (dest "DFA:Prefs") (noposition))
(tooltype (dest "DFA:Libs") (noposition))
(tooltype (dest "DFA:Documentation") (noposition))
(tooltype (dest "DFA:AddressFiles") (noposition))

(complete 100)

(set EndMsg1 (#msg-end1-msg serverdest))
(set EndMsg3 (#msg-end2-msg editordest))
(set EndMsg2 (#msg-end3-msg prefsdest))

(set @default-dest DFAdir)

(exit EndMsg1 EndMsg2 EndMsg3 #msg-exit-msg)
