; $VER: Install_ViNCEd 41.2 (8th Sep 1998)
; Script to install ViNCEd version 41.61
; © 1993-1998 THOR - Software
;
; The installer software is copyrighted © 1993 CBM/AI/ESCOM/GATEWAY, whatever...
;

; tell the user that we're 0% done
(complete 0)

;=============================================================================
;###procedures###
; useful procedure

(procedure TERMINATE (makeassign "..VNC..")

)

(procedure JOIN (

(if (not (exists (#name)))
	;then
	(abort (#exit-not-found name 0))
)

(if (set ioerr (run ("c:copy \"%s\" to t:__tempfile__" #name)))
	;then
	(abort (#exit-not-found name ioerr))
)

(if (set ioerr (run ("join t:__tempfile__ \"%s\" to \"%s\"" #joinsoure #name)))
	;then
	(abort (#exit-not-found name ioerr))
)
	
(run ("c:delete t:__tempfile__"))
		
))


(procedure INSTALL_LANGUAGE (

(set #locale (tackon #target "Locale"))

(if (not (exists #locale))
	(makedir #locale)
)

(set #locale (tackon #locale "Catalogs"))

(if (not (exists #locale))
	(makedir #locale)
)

(set #locale (tackon #locale #lang_arg))

(if (not (exists #locale))
	(makedir #locale)
)


(if (> @user-level 1)
	;then
      		(
		(set #locale
       			(askdir	 (prompt #where-locale)
		       			(help #where-locale-help)
					(default #locale)
			)
      		)
	)
)

(if (<> #locale "")
	(

		(set #locale (tackon #locale "VNC"))

		(if (not (exists #locale))
			(makedir #locale)
		)

		(set #locale_source (tackon "..VNC..:LOCALE/catalogs" (tackon #lang_arg "VNC")))

		(copyfiles
			(source #locale_source)
			(dest #locale)
			(all)
		)
	)

)

))

;==========================================================================
; termination stuff

(onerror (TERMINATE))

;==========================================================================
; get current WB version
(set #version (/ (getversion "LIBS:version.library") 65536))

;get language specific strings
;==========================================================================
;###english###
; English strings

(set default_lang 4)

(set #yes "Yes")
(set #no  "No")

(set #which-disk
(cat "In which disk should ViNCEd be installed?"
))

(set #exit-not-decoded
(cat "The SetVNC program can't be encoded. Conact the author at "
     "thor@math.tu-berlin.de."
))

(set #which-disk-help
(cat "\nThis section lets you choose in which disk the "
     "ViNCEd files should be installed. These should normally go in the same "
     "location as the Workbench files, i.e. the boot partition or -disk.\n\n"
     @askdir-help
))

(set #no-assign
(cat "\nThe destination has to be a system disk. The drawers S,DEVS,LIBS "
     "and C must exist there.\n\n"
))

(set #old-name
(cat "OLD"
))

(set #move-old
(cat "\n\nDo you want to backup the following files "
     "to the \"%s\" drawer?\n\n%s" 
))

(set #move-old-help
(cat "\nInstalling ViNCEd will replace some current Workbench files, "
     "the Startup- and MountList files. "
     "In order to preserve any changes you have previously made to these "
     "files, the installation process will copy them to the \"%s\" drawer "
     "where they can be found later on."
))

(set #move-old-1
(cat "Copy"
))

(set #move-old-2
(cat "Skip"
))

(set #ask-vnc
(cat "Please locate the ViNCEd source directory:"
))

(set #ask-vnc-help
(cat "Please specify here the directory where you've unpacked the "
     "archive to. The default I selected for you should work in "
     "(almost) all cases, so don't worry about selecting another "
     "source.\n\n"
     @askdir-help
))

(set #do-mount
(cat    "Do you want to add the mount entries for the ViNCEd handler?"
))

(set #mount-help
(cat    "If you want to install ViNCEd as a shell window driver "
	"you must MOUNT ViNCEd as a device, like the RAD ram disk or a "
	"hard disk. The information needed how to do this is "
	"included in mount entries, which must be added to the "
	"system list of devices. I advise you to answer with a YES "
	"since NOT mounting ViNCEd is rather useless. "
))

(set #modify-startup
(cat    "Do you want to mount ViNCEd automatically on startup?"
))

(set #override-con
(cat    "Replace the CON: handler by ViNCEd?"
))

(set #override-help
(cat    "With an extra command added to the startup-sequence "
	"ViNCEd can be configured to replace Commodore's "
	"system window handler, CON:. This results in opening "
	"every console window, like the windows used for ARexx, "
	"Ed and much more, as an ViNCEd window. If you choose to "
	"do so, I advice you NOT to turn on the "
	"\"Use Shell Mode by Default\" flag in the preferences "
	"editor. Read more about this in the guide."
))

(set #modify-startup-help
(cat    "The command to be added is \"%s\"\n\n"
	"This will mount ViNCEd automatically."
))

(set #which-name
(cat    "Mount ViNCEd under which name?"
))

(set #which-name-help
(cat    "ViNCEd can be mounted as VNC: or as NEWCON:. "
	"It works fine under both names, but you should use NEWCON: "
	"with Workbench 1.3 to replace the system window handler. "
))

(set #copy-lib
(cat    "Do you want to copy the vnc.library to the LIBS: drawer?"
))

(set #copy-lib-help
(cat    "The vnc.library is the heart of the ViNCEd window driver and "
	"contains the handler itself. The window handler won't work "
	"with it, and not installing it makes the installation useless."
))

(set #copy-setvnc
(cat    "Do you want to copy the SetVNC control "
	"program to the C: drawer?"
))

(set #copy-setvnc-help
(cat    "The SetVNC program acts as a preference program for the ViNCEd "
	"system. It provides not only a complete preferences editor, but "
	"also functions for job control. Please consult the guide to find "
	"out more about this program."
))

(set #do-locale
(cat    "Which languages do you want to install?"
))

(set #locale-help
(cat    "ViNCEd can be localized for various languages. Please mark "
	"here all languages you like to install. The necessary localization "
	"data will be then copied to your system as part of the "
	"installation process, namely to the LOCALE: drawer."
))

(set #do-prefs
(cat    "Do you want to install the preferences icon?"
))

(set #prefs-help
(cat    "This icon will be copied in your Prefs drawer and will "
	"invoke the preferences editor of ViNCEd, the SetVNC "
	"program. A nice graphical user interface will allow you "
	"to setup the parameters of ViNCEd then."
))

(set #copy-help
(cat    "O.K. to install the ViNCEd online Guide?"
))

(set #copy-help-help
(cat    "The ViNCEd guide is a complete documentation of "
	"the handler and the preferences editor, SetVNC. "
	"It is invoked by the Help key in the shell "
	"or by a Help button in the preferences editor. If you aren't "
	"really low on disk space, you should install it."
))

(set #help-dir
(cat    "Please select the drawer to install the guide in:"
))

(set #help-help
(cat    "ViNCEd comes with an online help guide, using Commodore's "
	"AmigaGuide or MultiView program. Please select the drawer to copy "
	"this database to."
))

(set #do-docs
(cat    "Do you want to install the ViNCEd include files?"
))

(set #docs-where
(cat    "Please select the drawer for the include and link library files:"
))

(set #docs-help
(cat    "If you want to use all the features of ViNCEd, you need "
	"the C- and assembler include files for writing own "
	"programs that call ViNCEd. It is recommended "
	"that you use the link library stub routines for this task. "
))

(set #browser-where
(cat    "Please locate your favorite AmigaGuide browser:"
))

(set #browser-help
(cat    "Please select a program that can display AmigaGuide files. "
	"This should be AmigaGuide or Multiview. As a last resort, "
	"select MORE or Ed that can be found in the Utilities or "
	"C: drawer of your workbench disk."
))

(set #do-scripts
(cat    "Do you want to install the shell scripts?"
))

(set #scripts-help
(cat    "The scripts replace the SetFont and the SetKeyboard command files "
	"in a ViNCEd compatible way. Three other tiny scripts are useful "
	"shortcuts for job control functions. "
))

(set #where-scripts
(cat    "Where shall I copy the scripts to?"
))

(set #where-scripts-help
(cat    "Shell scripts should be usually placed in the S directory of your "
	"startup device, where they will be found by the shell by default. "
	"However, if you prefer a different location, go ahead, but make "
	"shure the shell can find them, or they are useless."
))

(set #where-setvnc
(cat	"Please select the directory to install the "
	"SetVNC program in:"
))

(set #where-setvnc-help
(cat	"The SetVNC program is the ViNCEd control program "
	"and the preferences editor, all in one. It should "
	"usually go to the C: directory. I recommend NOT to "
	"put in into Prefs."
))

(set #where-locale
(cat	"Where to install the catalog files to? (A directory "
	"VNC will be created):"
))

(set #where-locale-help
(cat	"Please select the directory I shall copy the catalog "
	"files to, i.e. the files containing the translations "
	"of ViNCEd to different languages. A directory named "
	"VNC will be created for "
	"you at the location you've selected. "
	"The default is usually good enough."
))

(set #where-devs
(cat	"Where to install the mount icons to?"
))

(set #where-devs-help
(cat	"The mount icons are required to mount the ViNCEd handler on "
	"startup. They are read by the startup-sequence by the "
	"mount command at boot time. These icons should usually go "
	"into the DEVS/DosDrivers directory."
))

(set #where-prefs
(cat	"Where to install the prefs editor icon?"
))

(set #where-prefs-help
(cat	"Please select the directory where to copy the SetVNC icon "
	"to. This should usually be the Prefs drawer of your system. "
	"It is, by the way, not required that the SetVNC program is "
	"in the same directory as its icon."
))

(set #where-archive
(cat	"Where to install the preferences settings?"
))

(set #where-archive-help
(cat	"Please select the directory where I shall copy the "
	"preferences settings file to. This should be usually "
	"the ENVARC: assign of your system."
))

(set #where-rexx
(cat	"Please locate the directory containing the rexxsyslib.library:"
))

(set #where-rexx-help
(cat	"Please select here the directory containing the "
	"rexxsyslib.library. This file is usually contained in the "
	"LIBS drawer of your boot disk.\n"
	"I need this information to find out whether the "
	"rexxsyslib.library is an older version which is buggy and "
	"where I can apply a patch to to fix it. You will be asked "
	"about the patch separately again."
))	

(set #replace-old
(cat	"Install 3.6x settings and replace the old 3.5x prefs?"
))

(set #replace-old-help
(cat	"I found some old preferences settings in your ENVARC:sys drawer. "
	"The new versions of ViNCEd are still able to read the old "
	"format, but this support will be removed in one of the next "
	"releases. Not all of the old flags will be respected, however, "
	"by the new ViNCEd version, some details must be reconfigured. "
	"If you install a new preferences file, the old settings "
	"will be still kept in their original location, so nothing is "
	"lost; but they will be ignored by ViNCEd if a newer preferences "
	"release is available. If, after installation, you want to "
	"reestablish your old settings, you could simply delete the "
	"ENVARC:ViNCEd.prefs file, but don't forget to run \"SetVNC\" "
	"some time later since support for the old format won't last "
	"forever."
))

(set #copy-icon
(cat    "Do you want to replace the shell icon?"
))

(set #copy-icon-help
(cat    "If you want to use ViNCEd as shell editor, I advice you to "
	"replace the system icon by the icon that comes with this "
	"archive. It selects a ViNCEd path as shell window."
))

(set #where-shell
(cat    "Please select the directory the shell icon resides in:"
))

(set #where-shell-help
(cat    "If you want to replace the default shell icon, "
	"please tell me where you have put it. By default, this "
	"is either the root directory of your boot-volume, or "
	"the Systems drawer. Please note that I need the "
	"DIRECTORY, not the file!"
))

(set #where-lib
(cat	"Please select the directory to copy "
	"the vnc.library to:"
))

(set #where-lib-help
(cat	"The vnc.library is the main library of ViNCEd, "
	"it contains the all handler functions. You should "
	"usually install this in your LIBS: directory."
))

(set #do-patch
(cat    "Do you want to patch ARexx to remove a bug?"
))

(set #patch-help
(cat    "The rexxsyslib.library function WaitDosPacket has a bug "
	"which might cause crashes. This is not a "
	"specific ViNCEd problem, and "
	"may also occur with other programs. You should install "
	"this patch to repair the library."
))

(set #copy-stringsnip
(cat    "Do you want to install the StringSnip command?"
))

(set #install-stringsnip
(cat    "Do you want to install StringSnip at startup time?"
))

(set #stringsnip-help
(cat    "StringSnip is a small utility, which, if installed, enhances "
	"the editor features of string gadgets in a way comparable "
	"to ViNCEd. Amiga-X cut the contents, Amiga-C copies them and "
	"Amiga-V inserts the clipboard. Additional cursor key "
	"combinations like those provided by ViNCEd make this a useful "
	"tool, which works independent from ViNCEd."
))

(set #where-stringsnip
(cat	"Where to install the StringSnip program?"
))

(set #where-stringsnip-help
(cat	"Please select a directory where I shall copy the "
	"StringSnip utility to and where it is loaded from "
	"on startup. This should be usually the "
	"C: directory of your boot disk.\n"
	#stringsnip-help
))

(set #copy-multiassigns
(cat    "Do you want to install the TrueMultiAssigns command?"
))

(set #install-multiassigns
(cat    "Do you want to run TrueMultiAssigns at startup time?"
))

(set #multiassigns-help
(cat    "The TrueMultiAssigns program is a patch command that makes the "
	"pattern matching routines of AmigaDOS operating correctly on "
	"multi directory assigns. "
	"The TAB expansion directory cache of ViNCEd expects that this "
	"patch is installed, so please add it to the system. "
	"Several programs can be found for the same job, but all I "
	"inspected are more or less broken, including MultiCX and "
	"the old TrueMultiAssigns 1.02 by Marcus Wild, and don't work "
	"with ViNCEd. I recommend to use my patch, since it has been "
	"tested to support ViNCEd."
))

(set #where-multiassigns
(cat	"Where shall I install TrueMultiAssigns?"
))

(set #where-multiassigns-help
(cat	"Please select a directory where I shall copy the "
	"TrueMultiAssigns program to. It will be loaded from there "
	"at startup time. This should be usually the C: directory of "
	"your boot disk.\n"
	#multiassigns-help
))

(set #copy-tbiclass
(cat 	"Do you want to install the toolbutton image class?"
))

(set #where-tbiclass
(cat	"Where to install the toolbutton image class?"
))

(set #copy-tbiclass-help
(cat	"The toolbutton image class, written by Massimo Tantignone and "
	"included with his friendly permission, customizes ViNCEd's "
	"title bar images - the macro buttons as well as the iconification "
	"gadget. This class is not a MUST, ViNCEd will provide its own "
	"images if it is not available. It is therefore a matter of "
	"personal style whether you prefer ViNCEd's default or Massimo's "
	"tool button style.\n"
	"This class IS, TOO, NOT required if you're already running "
	"VisualPrefs because it is then provided anyhow."
))

(set #where-tbiclass-help
(cat	"The toolbutton image class should usually go to all the other "
	"image classes, namely to \"SYS:Classes/Images/titlebar.image\".\n"
	"There's usually little reason to put it elsewhere, but remember "
	"that ViNCEd tries to open this class as \"images/titlebar.image\" "
	"so a sub-directory named \"images\" is MANDATORY.\n"
	#copy-tbiclass-help
))

(set #copy-unixdirs
(cat    "Do you want to install the UnixDirs command?"
))

(set #install-unixdirs
(cat    "Do you want to run UnixDirs at startup time?"
))

(set #unixdirs-help
(cat    "This fine program, developped by Timo Kaikumaa, adds "
	"unix style directory addressing to the Amiga OS. To give "
	"an example, the dot (.) can be used to refer to the current "
	"directory, the double dot (..) is a replacement for the "
	"parent directory and the single slash refers to the root "
	"directory. By default, the star (*) gets also a legal "
	"wild card character, replacing the usual #? sequence.\n"
	"Thanks goes to Timo for allowing me to redistribute his "
	"patch."
))

(set #where-unixdirs
(cat	"Where to install the UnixDirs program?"
))

(set #where-unixdirs-help
(cat	"Please select a directory where to copy the UnixDirs program"
	"to. This should be usually the C: directory of your "
	"boot disk where this tool can be loaded from on "
	"startup-time.\n"
	#unixdirs-help
))

(set #copy-uxhelp
(cat    "O.K. to install the UnixDirs Guide?"
))

(set #copy-uxhelphelp
(cat    "This is the documentation for the UnixDirs "
	"program by Timo Kaikumaa. Unless you're really "
	"low on disk space, please install it as well."
))

(set #copy-topaz6
(cat	"Do you want to install the topaz6 font?"
))

(set #copy-topaz6-help
(cat	"The topaz6 font is a 6x8 font which replaces the XEN.8 font. "
	"Unlike the XEN font, which is a proportional font and "
	"therefore not well suited for ViNCEd, the topaz6.8 works fine. "
	"This font is complete and contains all special characters of "
	"the LATIN-ANSI character set."
))

(set #where-topaz6
(cat	"Where to install the topaz6 font?"
))

(set #where-topaz6-help
(cat	"Please select a directory where to copy the font files to. "
	"This should usually the FONTS: directory of your boot disk "
	"or any other place where it can be found by the system.\n"
	#copy-topaz6-help
))


(set #where-uxhelp
(cat	"Where to install the UnixDirs guide?"
))

(set #where-uxhelp-help
(cat	"Please select a directory where I shall copy the "
	"documentation of the UnixDirs program to. You're "
	"completely free in your choice."
))

(set #which-prefs
(cat	"Which ViNCEd configuration do you want to install?"
))

(set #which-prefs-help
(cat	"Please select one of the ViNCEd configurations listed above: "
	"The \"Default Prefs\" are the ViNCEd factory defaults, "
	"\"My Prefs\" are the settings I work with, "
	"\"XTerm like\" is what in my experience most people prefer. "
	"\"none\" means that no preferences will be installed; this means "
	"that ViNCEd will use the factory defaults unless there are "
	"still old preferences available that should not be overwritten.\n"
	"Most of these settings might still require some adjustments for "
	"your personal style, however. Use the \"SetVNC\" program in the "
	"Prefs drawer of your system to change these settings when the "
	"installation is complete."
))

(set #prefs-standard
(cat	"Default Configuration"
))

(set #prefs-mine
(cat	"My Configuration"
))

(set #prefs-xterm
(cat	"XTerm like"
))

(set #prefs-none
(cat	"none"
))

(set #exit-not-found
(cat    "Unable to find your file \"%s\" - DOS error %ld "
	"- installation aborted. "
))

(set #exit-text
(cat    "Installation of ViNCEd done. You should reboot now.\n"
	"Hope you enjoy ViNCEd as much as I do..."
))

;=============================================================================
;###german###
; German strings

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

(set #yes "Ja")
(set #no  "Nein")

(set #which-disk
(cat "Auf welcher Diskette oder Festplatte soll ViNCEd "
     "installiert werden?"
))

(set #which-disk-help
(cat "Hier können Sie wählen, auf welchem Gerät "
     "die ViNCEd-Dateien installiert werden sollen. "
     "Sie sollten normalerweise an dieselbe Stelle installiert werden "
     "wie die Workbench-Dateien, also auf die "
     "Boot-Partition bzw. Diskette.\n\n"
     @askdir-help
))

(set #no-assign
(cat "\nDas Ziel muß ein Systemlaufwerk sein. Die Ordner S,DEVS,LIBS "
     "und C müssen dort vorhanden sein.\n\n"
))

(set #old-name
(cat "ALT"
))

(set #move-old
(cat "\n\nSollen folgende Dateien zur Sicherheit in die "
     "Schublade \"%s\" kopiert werden?\n\n%s"
))

(set #exit-not-decoded
(cat "Das SetVNC Programm kann nicht entkodiert werden. Bitte benachrichtigen "
     "Sie mich unter thor@math.tu-berlin.de."
))

(set #move-old-help
(cat "\nDie Installation von ViNCEd ersetzt die einige der bisherigen "
     "Workbench-Dateien, so die Startup- und MountList Files. "
     "Damit alle Ergänzungen, die Sie früher an diesen Dateien "
     "vorgenommen haben, nicht verloren gehen, werden sie bei der "
     "Installation in die Schublade \"%s\" kopiert, woher Sie "
     "sie später zurückholen können."
))

(set #move-old-1
(cat "Kopieren"
))

(set #move-old-2
(cat "Überspringen"
))


(set #ask-vnc
(cat "Bitte wählen Sie den ViNCEd Quellordner aus:"
))

(set #ask-vnc-help
(cat "Bitte wählen Sie hier den Ordner aus, in den Sie das "
     "ViNCEd-Archiv entpackt haben. Die von mir gewählte "
     "Voreinstellung sollte in (fast) allen Fällen funktionieren, "
     "bemühen Sie sich also nicht eine andere auszuwählen.\n\n"
     @askdir-help
))

(set #do-mount
(cat    "Sollen die Mount-Einträge für den ViNCEd Handler kopiert werden?"
))

(set #mount-help
(cat    "Falls Sie ViNCEd als einen Shell-Fester Treiber verwenden "
	"möchten, muß es als ein Gerät vorher angemeldet werden, "
	"ebenso wie die RAD Ramdisk oder eine Festplatte. "
	"Die hierfür notwendigen Informationen befinden sich "
	"in Mount-Einträgen, die zu der Systemliste der Geräte "
	"hinzugefügt werden. Sie sollten hier mit JA antworten, "
	"denn es ist recht witzlos, ViNCEd nicht als ein Gerät "
	"anzumelden."
))

(set #modify-startup
(cat    "Wollen Sie ViNCEd beim Hochfahren des Systems automatisch einbinden?"
))

(set #modify-startup-help
(cat    "Das einzufügende Kommando ist \"%s\"\n\n"
	"Damit wird ViNCEd in das System eingebunden."
))

(set #override-con
(cat    "Soll der CON:-handler durch ViNCEd ersetzt werden?"
))

(set #override-help
(cat    "Durch ein zusätzliches Kommando in der Startup-sequence "
	"kann ViNCEd so konfiguriert werden, daß es den System-"
	"Fenstertreiber CON: ersetzt. Dies führt dazu, daß alle "
	"Programme, die ein Konsolenfenster öffnen, etwa ARexx, "
	"Ed und einige mehr, stattdessen ein komfortableres "
	"ViNCEd Fenster erhalten. Falls Sie diese Option einstellen "
	"möchten, sollten Sie aber das Flag "
	"\"Shell Modus als Voreinstellung\" im Voreinsteller nicht "
	"anwählen. Schauen Sie bitte auch in den Guide, um mehr "
	"hierüber zu erfahren."
))

(set #which-name
(cat    "ViNCEd unter welchem Namen einbinden?"
))

(set #which-name-help
(cat    "ViNCEd kann als VNC: oder als NEWCON: in das System eingebunden "
	"werden. Der Handler funktioniert unter beiden Namen gleich "
	"gut, aber unter Workbench 1.3 sollten Sie NEWCON: verwenden, "
	"um den Betriebssystemtreiber zu ersetzen."
))

(set #copy-lib
(cat    "Soll die vnc.library in den LIBS:-Ordner kopiert werden?"
))

(set #copy-lib-help
(cat    "Die vnc.library ist eine Funktionsbibliothek und stellt "
	"das Herz des gesamten ViNCEd Systems dar, ohne die nichts "
	"funktioniert. Sie enthält den Fenstertreiber, ohne den "
	"die ganze Installation recht witzlos wird."
))

(set #copy-setvnc
(cat    "Soll das SetVNC Programm in die C:-Schublade kopiert werden?"
))

(set #copy-setvnc-help
(cat    "Das SetVNC Programm ist der Voreinsteller für ViNCEd. "
	"Es enthält nicht nur eine graphische Oberfläche für die "
	"Voreinstellungen, sondern auch Funktionen für die Job-"
	"Kontrolle. Schauen Sie bitte in die Anleitung, um mehr "
	"über dieses Programm herauszufinden."
))

(set #do-locale
(cat    "Welche Übersetzungen sollen installiert werden?"
))

(set #locale-help
(cat    "ViNCEd beherrscht verschiedene Sprachen, benötigt aber "
	"dafür Katalogfiles, die als Teil der Installation in "
	"den LOCALE: Ordner kopiert werden. Bitte wählen Sie hier "
	"aus, welche Sprachen Sie installieren wollen."
))

(set #do-prefs
(cat    "Soll das Voreinsteller-Icon installiert werden?"
))

(set #prefs-help
(cat    "Dieses Piktogramm wird in den Prefs-Ordner kopiert "
	"und ruft das SetVNC-Programm als Voreinsteller von "
	"ViNCEd auf. Sie können dann mit einer netten graphischen "
	"Benutzeroberfläche die Voreinstellungen des ViNCEd-Systems "
	"Ihren Bedürfnissen anpassen."
))

(set #copy-help
(cat    "Möchten Sie die ViNCEd Online-Dokumentation installieren?"
))

(set #copy-help-help
(cat    "Der ViNCEd Guide ist eine vollständige Dokumentation des "
	"Fenstertreibers und des Einstellungsprogrammes SetVNC. "
	"Er wird aufgerufen, wenn Sie in der Shell die Help Taste "
	"oder einen Hilfe-Knopf im Voreinsteller drücken. "
	"Falls Ihre Platte nicht wirklich voll ist, sollten Sie "
	"diese Anleitung auch installieren."
))

(set #help-dir
(cat    "Bitte wählen Sie den Ordner, in den der Guide "
	"installiert werden soll:"
))

(set #help-help
(cat    "ViNCEd besitzt eine Online-Hilfe, die mittels Commodores AmigaGuide "
	"oder Multiview Programmes Hilfestellung bei der Arbeit mit ViNCEd bietet. Geben Sie "
	"hier an, in welchen Order der Datensatz kopiert werden soll."
))

(set #do-docs
(cat    "Sollen die ViNCEd Include-Dateien installiert werden?"
))

(set #docs-where
(cat    "In welchen Ordner sollen die Include-Files installiert werden:"
))

(set #docs-help
(cat    "Wenn Sie alle Möglichkeiten ViNCEds nutzen wollen, so benötigen "
	"Sie zum Erstellen von Programmen, die ViNCEd aufrufen, "
	"die Include-Files und die Link-Libraries. "
	"Sie sollten dann ViNCEd durch die stub-Funktionen "
	"dieser Link-Libraries aufrufen. "
))

(set #browser-where
(cat    "Bitte wählen Sie ihr favorisiertes AmigaGuide - Anzeigeprogramm:"
))

(set #browser-help
(cat    "Wählen Sie hier bitte ein Programm, mit dem man sich AmigaGuide "
	"Dateien anzeigen lassen kann. Dies sollte der AmigaGuide oder "
	"das Programm Multiview sein. Als letzen Ausweg kann hier "
	"MORE oder Ed angegeben werden. Diese Programme finden Sie "
	"in der Utilities oder C: Schublade Ihrer Workbench-Diskette."
))

(set #do-scripts
(cat    "Sollen die Shell-Skripte installiert werden?"
))

(set #scripts-help
(cat    "Zwei dieser Skripte ersetzen die SetFont und SetKeyboard Kommandos "
	"durch ViNCEd kompatible Shell-Skripte. Drei weitere Skripte "
	"dienen als Abkürzung für die Job-Kontrollfunktionen der "
	"VNC Bibliothek."
))

(set #where-scripts
(cat    "Wohin sollen die Skripte kopiert werden?"
))

(set #where-scripts-help
(cat    "Shell-Skripte gehören für gewöhnlich in den S:-Ordner Ihrer "
	"Boot-Platte, wo sie auch von der Shell gefunden werden können. "
	"Natürlich können Sie die Skripte auch an andere Stellen kopieren, "
	"jedoch sollten sie dort auch von der Shell gefunden werden, da sie "
	"sonst recht nutzlos sind."
))

(set #where-setvnc
(cat	"Bitte wählen Sie das Verzeichnis, in das das "
	"SetVNC-Programm installiert werden soll:"
))

(set #where-setvnc-help
(cat	"SetVNC ist das ViNCEd Kontrollprogramm und der "
	"Voreinsteller, alles in einer Datei. Es sollte "
	"für gewöhnlich in das C:-Verzeichnis installiert "
	"werden. Ich emfehle, es NICHT in Prefs zu installieren."
))

(set #where-locale
(cat	"Wohin sollen die Katalogdateien installiert werden? "
	"(Ein Verzeichnis namens VNC wird erzeugt):"
))

(set #where-locale-help
(cat	"Bitte wählen Sie hier das Verzeichnis, in das die "
	"Katalogdateien kopiert werden sollen, d.h. diejenigen "
	"Dateien, die die Übersetzungen von VNC in diverse Sprachen "
	"enthalten. Ein Verzeichnis namens VNC wird an der von Ihnen "
	"ausgewählten Stelle erzeugt. Für gewöhnlich ist die "
	"Voreinstellung gut genug."
))

(set #where-devs
(cat	"Wohin sollen die Mount-Icons installiert werden?"
))

(set #where-devs-help
(cat	"Die Mount-Icons werden benötigt, um den ViNCEd-Handler "
	"beim Hochfahren des Systems anzumelden. Sie werden beim "
	"Booten vom Mount-Kommando in der startup-sequence gelesen. "
	"Diese Icons sollten üblicherweise in das DEVS/DosDrivers "
	"Verzeichnis installiert werden."
))

(set #where-prefs
(cat	"Wo soll das Piktogramm des Voreinstellers installiert "
	"werden ?"
))

(set #where-prefs-help
(cat	"Bitte wählen Sie hier ein Verzeichnis, in das das "
	"Piktogramm des Voreinstellers installiert werden soll. Dies sollte "
	"üblicherweise das Prefs-Verzeichnis Ihrer Systempartition "
	"sein. Es ist übrigens nicht nötig, daß das SetVNC-Programm "
	"in das gleiche Verzeichnis wie sein Piktogramm installiert "
	"wird."
))

(set #where-archive
(cat	"Wohin sollen die Voreinstellungsdateien installiert werden?"
))

(set #where-archive-help
(cat	"Bitte wählen Sie ein Verzeichnis, in das die Voreinstellungsdateien "
	"installiert werden sollen. Dies sollte üblicherweise das ENVARC: "
	"Verzeichnis Ihres Systems sein."
))

(set #where-rexx
(cat	"Bitte spezifizieren Sie das Verzeichnis, in der sich die "
	"rexxsyslib.library befindet:"
))

(set #where-rexx-help
(cat	"Bitte geben Sie hier das Verzeichnis an, in dem sich die "
	"rexxsyslib.library befindet; dies sollte üblicherweise das "
	"LIBS-Verzeichnis Ihrer Boot-Diskette sein.\n"
	"Ich benötige diese Angaben, um festzustellen, ob es sich "
	"womöglich um eine ältere Version von ARexx handelt, die "
	"einen Bug enthält, den ich mit einem Patch entfernen "
	"könnte. Sie werden gleich nocheinmal gefragt, ob Sie diesen "
	"Patch wünschen - was ich aber emfehlen möchte."
))	

(set #replace-old
(cat	"Soll ich die neuen 3.6x Einstellungen installieren und "
	" die alten 3.5x Einstellungen ersetzen?"
))

(set #replace-old-help
(cat	"Ich habe die alten Einstellungsfiles in Ihrem ENVARC:sys "
	"Verzeichnis gefunden. Die neuen Versionen von ViNCEd können "
	"diese zwar immer noch lesen, aber die Unterstützung hierfür "
	"wird in einer der nächsten Versionen entfernt werden. "
	"Nicht alle der alten Flags werden von der neuen Version auch "
	"respektiert, einige Details müssen vermutlich neu eingestellt "
	"werden. Falls Sie eine neue Voreinstellungsdatei installieren, "
	"gehen die alten Einstellungen nicht verloren, sie verbleiben "
	"an ihrem ursprünglichen Platz; sie werden jedoch von ViNCEd "
	"ignoriert, solange eine neuere Version gefunden wird. Falls Sie, "
	"nach erfolgreicher Installation wieder Ihre alten Einstellungen "
	"verwenden möchten, könnten Sie einfach die ENVARC:ViNCEd.prefs "
	"Datei löschen. Vergessen Sie aber bitte nicht, irgendwann einmal "
	"\"SetVNC\" zu starten, denn die Unterstüzung für das alte Format "
	"wird nicht ewig erhalten bleiben."
))

(set #copy-icon
(cat    "Soll das Shell-Icon ersetzt werden?"
))

(set #copy-icon-help
(cat    "Falls Sie ViNCEd als Shell-Editor verwenden möchten, sollten "
	"sie das System-Icon durch das mitgeliferte Icon ersetzen, "
	"das als Shell-Fenster ein ViNCEd Pfad verwendet."
))

(set #where-shell
(cat    "Bitte spezifizieren Sie den Ordner, in dem sich das Shell-Icon "
	"befindet:"
))

(set #where-shell-help
(cat    "Falls Sie das Shell-Icon wirklich ersetzen wollen, müssen Sie "
	"hier angeben, wo es sich befindet. Dies ist üblicherweise "
	"das Hauptverzeichnis des Boot-Gerätes oder der Systems "
	"Ordner auf dem gleichen Gerät. Bitte beachten Sie, daß "
	"die Schublade benötigt wird und nicht das Icon selbst."
))

(set #where-lib
(cat	"Bitte wählen Sie das Verzeichnis, in das die "
	"vnc.library installiert werden soll:"
))

(set #where-lib-help
(cat	"Die vnc.library ist die Hauptbibliothek von "
	"ViNCEd, sie enthält alle Handler-Funktionen. Ohne sie "
	"geht gar nichts. Sie sollten sie für gewöhnlich in Ihr "
	"LIBS:-Verzeichnis installieren."
))

(set #do-patch
(cat    "Soll ein Fehler aus der ARexx Bibliothek entfernt werden?"
))

(set #patch-help
(cat    "The rexxsyslib.library Funktion WaitDosPacket hat einen Fehler, "
	"der manche anderen Programme abstürzen lassen kann. Dies ist "
	"kein spezifisches Problem von ViNCEd! Sie sollten diesen Patch "
	"installieren, um die Bibliothek zu reparieren."
))

(set #copy-stringsnip
(cat    "Soll das StringSnip-Kommand kopiert werden?"
))

(set #install-stringsnip
(cat    "Soll StringSnip beim Hochfahren gestartet werden?"
))

(set #stringsnip-help
(cat    "Stringsnip ist ein kleines Hilfsprogramm, das, einmal "
	"installiert, die Edier-Möglichkeiten der String-Gadgets "
	"entschieden verbessert. Zum einen werden Clipboard-Funktionen "
	"wie Amiga-C (Kopieren) Amiga-X (Ausschneiden) und Amiga-V "
	"(Clipboard-Inhalt einfügen) unterstützt, zum anderen werden "
	"Cursortastenkombinationen vergleichbar mit denen von ViNCEd "
	"zur Verfügung gestellt. StringSnip funktioniert auch unabhängig "
	"von ViNCEd und sollte als nützliches Tool installiert "
	"werden."
))

(set #where-stringsnip
(cat	"Wo soll StringSnip installiert werden?"
))

(set #where-stringsnip-help
(cat	"Bitte wählen Sie ein Verzeichnis aus, in das ich "
	"StringSnip kopieren soll und von wo aus es beim "
	"Hochfahren des Systems gestartet werden kann. Dies "
	"sollte üblicherweise das C:-Verzeichnis Ihrer "
	"Boot-Diskette sein.\n"
	#stringsnip-help
))

(set #copy-multiassigns
(cat    "Soll das TrueMultiAssigns Kommando kopiert werden?"
))

(set #install-multiassigns
(cat    "Soll der TrueMultiAssigns Patch beim Hochfahren "
	"gestartet werden?"
))

(set #multiassigns-help
(cat    "Das TrueMultiAssigns Programm korrigiert the AmigaDOS "
	"Jokerzeichen derart, daß sie korrekt mit Mehrfach-Assigns "
	"zusammenarbeiten. "
	"Der TAB Expansion Cache von ViNCEd benötigt diesen Patch, "
	"installieren sie ihn daher bitte. "
	"Zur Behebung der Probleme mit Mehrfach-Assigns können einige "
	"Programme auf dem AmiNet gefunden werden, jedoch sind alle, "
	"die ich getestet habe, mehr oder minder defekt, wie z.B. "
	"MultiCX oder auch das alte TrueMultiAssigns 1.02 von "
	"Marcus Wild, und funktionieren darum nicht korrekt mit "
	"ViNCEd. Ich emfehle Ihnen, meinen Patch zu verwenden, "
	"denn er wurde erfolgreich mit ViNCEd getestet."
))

(set #where-multiassigns
(cat	"Wo soll ich TrueMultiAssigns installieren?"
))

(set #where-multiassigns-help
(cat	"Bitte wählen Sie ein Verzeichnis aus, in das ich das "
	"TrueMultiAssigns-Programm installieren soll. Es wird von "
	"dort beim Hochfahren des Systems gestartet. Dieses "
	"Verzeichnis sollte üblicherweise das C:-Verzeichnis Ihrer "
	"Boot-Diskette sein.\n"
	#multiassigns-help
))

(set #copy-tbiclass
(cat 	"Soll die ToolButton-Klasse installiert werden?"
))

(set #where-tbiclass
(cat	"Wo soll die ToolButton-Klasse installiert werden?"
))

(set #copy-tbiclass-help
(cat	"Die Toolbutton-Klasse, geschrieben von Massimo Tantignone und "
	"freundlicherweise mit seiner Erlaubnis in diesem Archiv enthalten, "
	"beinhaltet die Knöpfe, die ViNCEd in der Titelleiste des Fensters "
	"anzeigt, etwa für die Makros oder für das Ikonifizierungsgadget. "
	"Diese Klasse ist KEIN MUSS. ViNCEd funktioniert auch ohne sie und "
	"wird in diesem Falle die entsprechenden Graphiken selbst erzeugen. "
	"Es ist damit eine Frage des persönlichen Geschmackes, ob Sie die "
	"ViCNEd-Voreinstellungen oder Massimos Graphiken bevorzugen.\n"
	"Diese Klasse wird auch nicht benötigt, wenn Sie bereits "
	"VisualPrefs installiert haben, denn sie wird ebenfalls von diesem "
	"Programm erzeugt."
))

(set #where-tbiclass-help
(cat	"Die Toolbutton-Klasse sollte üblicherweise zu allen anderen "
	"Image-Klassen kopiert werden, nämlich nach "
	"\"SYS:Classes/Images/titlebar.image\".\n"
	"Es gibt üblicherweise kaum einen Grund, sie an eine andere "
	"Stelle zu kopieren, aber beachten Sie bitte, daß ViNCEd "
	"sie unter dem Namen \"images/titlebar.image\" zu Öffnen "
	"versucht, ein Verzeichnis namens \"images\" ist daher ein Muß.\n"
	#copy-tbiclass-help
))

(set #copy-unixdirs
(cat    "Soll das UnixDirs Kommando installiert werden?"
))

(set #install-unixdirs
(cat    "Soll UnixDirs beim Booten gestartet werden?"
))

(set #unixdirs-help
(cat    "Dieses hilfreiche Programm, entwickelt von Timo Kaikuma, bringt "
	"dem Amiga DOS Unix-artige Verzeichnisnamen bei. Um ein paar "
	"Beispiele zu nennen, kann der Punkt (.) nun als Abkürzung für "
	"die augenblickliche Directory und der doppelte Punkt (..) als "
	"Name des übergeordneten Verzeichnisses verwendet werden. Ebenso "
	"ist der Schrägstrich nun ein Ersatz für das Wurzelverzeichnis. "
	"Per Voreinstellung ist der Stern (*) nun auch ein gültiges "
	"Jokerzeichen, das die sonst übliche #? Sequenz ersetzt.\n"
	"Dank geht an Timo, der mir erlaubte, UnixDirs hier erneut "
	"zu veröffentlichen."
))

(set #where-unixdirs
(cat	"Wo soll das UnixDirs-Programm installiert werden?"
))

(set #where-unixdirs-help
(cat	"Bitte wählen Sie ein Verzeichnis aus, in das das "
	"UnixDirs-Programm installiert werden soll. Dies sollte "
	"üblicherweise das C:-Verzeichnis Ihrer Boot-Diskette sein, "
	"von wo aus es beim Hochfahren des System geladen "
	"werden kann.\n"
	#unixdirs-help
))

(set #copy-uxhelp
(cat    "Soll der UnixDirs-Guide installiert werden?"
))

(set #copy-uxhelphelp
(cat    "Dies ist die Dokumentation des UnixDirs "
	"Programmes von Timo Kaikumaa. Sie sollten sie "
	"ebenfalls installieren, es sei denn, Sie haben "
	"wirklich keinen freien Plattenplatz mehr."
))

(set #where-uxhelp
(cat	"Wo soll der UnixDirs-Guide installiert werden?"
))

(set #where-uxhelp-help
(cat	"Bitte wählen Sie ein Verzeichnis aus, in das die "
	"Anleitung des UnixDirs-Programmes installiert werden "
	"soll. Sie sind hierbei ganz frei in Ihrer Wahl."
))

(set #copy-topaz6
(cat	"Soll der topaz6-Zeichensatz installiert werden?"
))

(set #copy-topaz6-help
(cat	"Der topaz6 Zeichensatz ist ein 6x8 Zeichensatz, der den "
	"XEN.8-Font ersetzt. Entgegen dem XEN-Zeichensatz, der ein "
	"Proportionalzeichensatz ist und darum für ViNCEd ungeeignet "
	"ist, funktioniert der topaz6.8 problemlos. Der Zeichensatz ist "
	"vollständig und enthält alle Sonderzeichen des LATIN-ANSI "
	"Zeichensatzes."
))

(set #where-topaz6
(cat	"Wo soll der topaz6-Zeichensatz installiert werden?"
))

(set #where-topaz6-help
(cat	"Bitte wählen Sie ein Verzeichnis, in das ich die Zeichensatz-"
	"Dateien installieren soll. Dies sollte üblicherweise das "
	"FONTS:-Verzeichnis Ihrer Boot-Diskette sein, oder jedes andere "
	"Verzeichnis, wo der Zeichensatz vom System gefunden werden "
	"kann.\n"
	#copy-topaz6-help
))

(set #which-prefs
(cat	"Welche Konfiguration installieren?"
))

(set #prefs-standard
(cat	"Standard-Konfiguration"
))

(set #prefs-mine
(cat	"Meine Konfiguration"
))

(set #prefs-xterm
(cat	"XTerm-artige Konfiguration"
))

(set #prefs-none
(cat	"keine"
))

(set #which-prefs-help
(cat	"Bitte wählen Sie eine der ViNCEd-Konfigurationen oben aus: "
	"Die \"Standard-Konfiguration\" besteht aus der ViNCEd-internen, "
	"eingebauten Einstellung, \"Meine Konfiguration\" ist die "
	"Konfiguration, mit der ich selbst arbeite, die "
	"\"XTerm-artige Konfiguration\" ist das, was meiner Erfahrung nach "
	"die meisten Leute bevorzugen. \"keine\" bedeutet, daß keine "
	"Voreinstellungen installiert werden. ViNCEd verwendet dann die "
	"eingebauten Einstellungen, es sei denn, es befinden sich noch "
	"Eintellungen von der letzten Installation im System, die dann "
	"nicht überschrieben werden.\n"
	"Die meisten Einstellungen benötigen "
	"natürlich noch einige kleine Anpassungen an Ihren persönlichen "
	"Stil; verwenden Sie dazu das \"SetVNC\"-Programm in dem "
	"Prefs-Verzeichnis, sobald die Installation beendet ist."
))

(set #exit-not-found
(cat    "Kann das File \"%s\" nicht finden - DOS Fehler %ld "
	"- Installation abgebrochen."
))

(set #exit-text
(cat    "ViNCEd Installation beendet. Sie sollten jetzt den Rechner "
	"neu starten.\n"
	"Ich hoffe, sie mögen ViNCEd genauso wie ich..."
))

))

;
;==========================================================================
;###script###
;say hi !
;
(welcome)
;==========================================================================
;intialize some strings.
;unfortunately, the installer does distinguish between empty strings
;and non-initialized strings. Ooops.
(set #archive "")
(set #guide-path "")
(set #libs "")
(set #where-docs "")
(set #stringdest "")
(set #uxdest "")
(set #uxguidedest "")
(set #multidest "")
(set #topazdest "")
(set #cdir "")
(set #devsdir "")
(set #prefsdrawer "")
(set #where-guide "")
(set #guide-path "")
(set #script-location "")
(set #icon-pos "")
(set #tbidest "")

;===========================================================================
; get target directory where update is to be installed

(set #old_wb "SYS:")

(set #target (askdir    (prompt #which-disk)
			(help #which-disk-help)
			(disk)
			(default #old_wb)
))

(if (not (and (exists (tackon #target "S/Startup-Sequence"))
	      (exists (tackon #target "DEVS"))
	      (exists (tackon #target "LIBS"))
	      (exists (tackon #target "C")) ))
	 ;then
	 (abort #no-assign)
)

;set @default-dest to user selected target
(set @default-dest #target)

;get directory to save old files
(set #stash_old (tackon #target #old-name))

;==========================================================================
;rename old files

(set #startup-sequence  (tackon #target "S/Startup-Sequence"))
(set #mountlist	  	(tackon #target "DEVS/MountList"))
(set #devssettings	(tackon #target "DEVS/VNC-Configuration"))
(set #oldsettings	(tackon #target "Prefs/ENVARC/Sys/VNC-Configuration"))
(set #oldarexx		(tackon #target "LIBS/rexxsyslib.library"))

;get all existing files
(set #oldfiles "")

(if (exists #startup-sequence)
	;then
	(set #oldfiles (cat #oldfiles #startup-sequence "\n"))
)

(if (exists #mountlist)
	;then
	(set #oldfiles (cat #oldfiles #mountlist "\n"))
)

(if (exists #oldsettings)
	;then
	(set #oldfiles (cat #oldfiles #oldsettings "\n"))
)

(if (exists #devssettings)
	;then
	(set #oldfiles (cat #oldfiles #devssettings "\n"))
)

(if (exists #oldarexx)
	;then
	(set #oldfiles (cat #oldfiles #oldarexx "\n"))
)

;if some oldfiles found
(if (<> #oldfiles "")
(
    (if (askbool (prompt (#move-old #stash_old #oldfiles))
		 (help (#move-old-help #stash_old))
		 (choices #move-old-1 #move-old-2)
		 (default 1)
	)
	;then do it
    (
	; create new directory w icon
	(makedir #stash_old (infos))
	; create s and devs subdirectory
	(makedir (tackon #stash_old "S"))
	(makedir (tackon #stash_old "Devs"))

	; copy startup-sequence to old-drawer
	(if (exists #startup-sequence)
		;then
		(
		(delete (tackon #stash_old "S/Startup-Sequence"))
		(copyfiles
			(source #startup-sequence)
			(dest (tackon #stash_old "S/Startup-sequence"))
		)		       
	))

	;copy mountlist to old-drawer
	(if (exists #mountlist)
		;then
		(
		(delete (tackon #stash_old "DEVS/Mountlist"))
		(copyfiles
			(source #mountlist)
			(dest   (tackon #stash_old "DEVS/Mountlist"))
		)
	))

	(if (exists #oldsettings)
		;then
		(
		(delete (tackon #stash_old "Prefs/ENVARC/Sys/VNC-Configuration"))
		(copyfiles
			(source #oldsettings)
			(dest   (tackon #stash_old "Prefs/ENVARC/Sys/VNC-Configuration"))
		)
	))

	(if (exists #devssettings)
		;then
		(
		(delete (tackon #stash_old "DEVS/VNC-Configuration"))
		(copyfiles
			(source #devssettings)
			(dest   (tackon #stash_old "DEVS/VNC-Configuration"))
		)
	))

	(if (exists #oldarexx)
		;then
		(
		(copyfiles
			(source #oldarexx)
			(dest #stash_old)
		)
	))
	
    ))
))

(complete 5)
;==========================================================================
;###install library###
; now copy ViNCEd to target

; ask user to insert VNC

(set #vncsource "/")

(if (> @user-level 1)
	;then
	(set #vncsource (askdir (prompt #ask-vnc)
				(help   #ask-vnc-help)
				(default "/")
			))
)

(makeassign "..VNC.." #vncsource (safe))

(set #guide-path (askfile       (prompt #browser-where)
				(help #browser-help)
				(default (tackon #target "Utilities/MultiView"))
			)
)

(if (<> #guide-path "")
	(run    ("\"%s\" ..VNC..:ReadMe.First!" #guide-path))
)

;(execute "..VNC..:Install/Secret" (safe))

;copy library
(if (> @user-level 1)
	;then
	(
		(set #pi-copy-lib
			(askbool	(prompt #copy-lib)
					(help #copy-lib-help)
					(default 1)
					(choices #yes #no)
			)
		)
	)
	(set #pi-copy-lib 1)
)

(set #libs (tackon #target "LIBS"))
(set #cdir (tackon #target "C"))

(if #pi-copy-lib
	(
		(if (> @user-level 1)
			;then
			(
				(set #libs
					(askdir	 (prompt #where-lib)
							(help #where-lib-help)
							(default #libs)
					)
				)
			)
		)

		(if (<> #libs "")
			(
				(if (not (exists #libs))
					(makedir #libs)
				)

				(copyfiles      (source "..VNC..:LIBS/vnc.library")
						(dest #libs)
				)
			)
		)
	)
)
;=========================================================================
;###install setvnc###
(complete 10)

;copy preference-program
(if (> @user-level 1)
	;then
	(
		(set #pi-copy-setvnc
			(askbool	(prompt #copy-setvnc)
					(help #copy-setvnc-help)
					(default 1)
					(choices #yes #no)
			)
		)
	)
	(set #pi-copy-setvnc 1)
)

(if #pi-copy-setvnc
	(

		(if (> @user-level 1)
			;then
			(
				(set #cdir
					(askdir	 (prompt #where-setvnc)
							(help #where-setvnc-help)
							(default #cdir)
					)
				)
			)
		)

		(if (<> #cdir "")
			(

				(if (not (exists #cdir))
					(makedir #cdir)
				)

				(if (exists "..VNC..:C/SetVNC")
					;then
					(
						(copyfiles      (source "..VNC..:C/SetVNC")
								(dest #cdir)
						)
					)
					;else
					(
						(copyfiles      (source "..VNC..:C/SetVNC.coded")
								(dest "T:")
						)
		
						(if (<> 0 (run "..VNC..:Extras/Decode T:SetVNC.coded"))
							(abort #exit-not-decoded)
						)
		
						(run "Wait 2")
		
						(rename	 "T:SetVNC.coded" "T:SetVNC")

						(copyfiles      (source "T:SetVNC")
								(dest #cdir)
						)
		
						(delete	 "T:SetVNC")
					)
				)
			)
		)
	)
)

;remove the obsolete DEVS:VNC-Configuration file if present
(if (>= #version 36)
	;then
	(
		(if (exists (tackon #target "Devs/VNC-Configuration"))
			(delete (tackon #target "Devs/VNC-Configuration"))
		)
		(if (exists (tackon #target "Devs/VNC-Configuration.info"))
			(delete (tackon #target "Devs/VNC-Configuration.info"))
		)

	)
)
;============================================================================
;###install languages###
(complete 15)
;
;add language-specific if 2.1 or higher
;
(if (>= #version 38)
	;then
	(
		(if (> @user-level 1)
			(set #lang_mask (askoptions     (prompt #do-locale)
							(help #locale-help)
							(default -1)
							(choices "English"
								 "Deutsch"
							)
					)
			)
			(set #lang_mask -1)
		)

		(if (in #lang_mask 1)
			(
				(set #lang_arg "Deutsch")
				(INSTALL_LANGUAGE)
			)
		)
	)
)
;=========================================================================
;###install mountlist###
;
(complete 20)
;
;add mountlist entry if release 2.0 or less

(if ( > @user-level 1)
	(set #mount-pi (askbool (prompt #do-mount)
				(help #mount-help)
				(default 1)
				(choices #yes #no)
			)
	)
	(set #mount-pi 1)
)

(if #mount-pi

	(if (< #version 38)
		;then
		(
			(set #joinsoure  "..VNC..:DEVS/Mount_VNC")
			(set #name       (tackon #target "devs/MountList"))
			(JOIN)
			(set #joinsoure  "..VNC..:DEVS/Mount_NEWCON")
			(JOIN)
		)
		;else copy the icons
		(
			(set #devsdir (tackon #target "DEVS/DosDrivers"))

			(if (> @user-level 1)
				;then
				(
					(set #devsdir
						(askdir	 (prompt #where-devs)
								(help #where-devs-help)
								(default #devsdir)
						)
					)
				)
			)
	
			(if (<> #devsdir "")
				(

					(if (not (exists #devsdir))
						(makedir #devsdir)
					)
			
					(copyfiles
						(source "..VNC..:DEVS/DosDrivers")
						(dest #devsdir)
						(infos)
						(all)
					)
				)
			)
		)
	)
)

;=========================================================================
;###install prefs-icon###
;
;get drawer to copy preference-icon
;	
(complete 30)
;

(if (= #cdir "")
	(set #pi-copy-prefs 0)
	(if (> @user-level 1)
		(set #pi-copy-prefs
			(askbool	(prompt #do-prefs)
					(help #prefs-help)
					(default 1)
					(choices #yes #no)
			)
		)
		(set #pi-copy-prefs 1)
	)
)

(set #pi-replace-prefs 1)

(if #pi-copy-prefs
	(
		(set #prefsdrawer #target)

		(if (exists (tackon #prefsdrawer "Prefs"))
			;then
			(set #prefsdrawer (tackon #prefsdrawer "Prefs"))
		)

		(if (> @user-level 1)
			;then
		       	(
       				(set #prefsdrawer
		       			(askdir	(prompt #where-prefs)
	      					(help #where-prefs-help)
					       	(default #prefsdrawer)
					)
		       		)
		       	)
		)
	)
)

(if (= #prefsdrawer "")
	(set #pi-copy-prefs 0)
)

;copy preference-icon
(if #pi-copy-prefs
	(

		(if (not (exists #prefsdrawer))
				(makedir #prefsdrawer)
		)

		(copyfiles      (source "..VNC..:Prefs/SetVNC.info")
				(dest   #prefsdrawer)
		)

		(tooltype       (dest   (tackon #prefsdrawer "SetVNC"))
				(setdefaulttool (tackon #cdir "SetVNC"))
				(noposition)
		)
	)
)

(if (= #prefsdrawer "")
	(
		(set #prefsdrawer #target)

		(if (exists (tackon #prefsdrawer "Prefs"))
			;then
			(set #prefsdrawer (tackon #prefsdrawer "Prefs"))
		)
	)
)
	

(if (> #version 35)
	(
		(set #archive (tackon #prefsdrawer "Env-Archive"))

		(if (> @user-level 1)
		;then
			(
	       			(set #archive
	       				(askdir	(prompt #where-archive)
						(help #where-archive-help)
					       	(default #archive)
					)
	       			)
		       	)
		)

		(if (and (<> #archive "") (exists #archive))
		;then
			(
				(if (exists (tackon #archive "sys/VNC-Configuration"))
					(if (> @user-level 1)
						(
							(set #pi-replace-prefs (askbool	(prompt #replace-old)
											(help #replace-old-help)
											(default 1)
											(choices #yes #no)
							    			)
							)
						)
						(set #pi-replace-prefs 0)
					)
					(set #pi-replace-prefs 1)			
				)

				(if #pi-replace-prefs
					(
						(set #prefs-mask (askchoice	(prompt #which-prefs)
										(help #which-prefs-help)
										(choices 	#prefs-standard
												#prefs-mine
												#prefs-xterm
												#prefs-none
										)
										(default 2)
								)
						)		

						(if (= #prefs-mask 0)
							(copyfiles	(source "..VNC..:Prefs/Env-Archive/Default.Prefs")
										(dest #archive)
										(newname "ViNCEd.Prefs")
							)
						)
		
						(if (= #prefs-mask 1)
							(copyfiles	(source "..VNC..:Prefs/Env-Archive/My.Prefs")
									(dest #archive)
									(newname "ViNCEd.Prefs")
							)
						)

						(if (= #prefs-mask 2)
							(copyfiles	(source "..VNC..:Prefs/Env-Archive/XTerm.Prefs")
									(dest #archive)
									(newname "ViNCEd.Prefs")
							)
						)
					)
				)	
			)
		)
	)
	(
		(set #archive (tackon #target "Devs"))

		(if (exists #archive)
			(copyfiles      (source "..VNC..:Prefs/Env-Archive/sys/Default.Prefs")
					(dest (tackon #archive "VNC-Configuration"))
			)
		)
	)	
)

;==========================================================================
;###install-guide###
;
(complete 35)
;
;ask user to install the vnc-guide
;
(if (> @user-level 1)
	(set #do-help   (askbool	(prompt #copy-help)
					(help #copy-help-help)
					(default 1)
					(choices #yes #no)
			)
	)
	(set #do-help 1)
)

(if #do-help
	(
		(set #where-guide       (askdir	 (prompt #help-dir)
							(help   #help-help)
							(default (tackon #target "Guides"))
							(newpath)
					)
		)

		(if (<> #where-guide "")
			(
				(copyfiles
					(source "..VNC..:Guides/ViNCEd.Guide")
					(dest #where-guide)
					(infos)
					(noposition)
				)
		
				(if #pi-copy-prefs 
					(tooltype
						(dest (tackon #prefsdrawer "SetVNC"))
						(settooltype "HELPPATH" (tackon #where-guide "ViNCEd.guide"))
					)
				)

				(if (and (<> #archive "") (> #version 35) (exists #archive))
					(
						(set #envguide (tackon #archive "VNCGuide.path"))
						(if (exists #envguide)
							(delete	#envguide)
						)
						(textfile 	(dest #envguide)
								(append	(tackon #where-guide "ViNCEd.guide"))
						)
					)
				)

				(if (= #guide-path "")
					(set #guide-path (askfile (prompt #browser-where)
								  (help #browser-help)
								  (default (tackon #target "Utilities/MultiView"))
							)
					)
				)

				(if (<> #guide-path "")
					(tooltype
						(dest (tackon #where-guide "ViNCEd.Guide"))
						(setdefaulttool #guide-path)
					)
				)
			)
		)
	)
)

;==========================================================================
;###install scripts###
;
(complete 40)
;
;now install the scripts
(if (> @user-level 1)
	(
		(set #pi-copy-scripts (askbool  (prompt #do-scripts)
						(help #scripts-help)
						(default 1)
						(choices #yes #no)
					)
		)

		(if #pi-copy-scripts
			(
				(set #script-location
					(askdir (prompt #where-scripts)
						(help #where-scripts-help)
						(default (tackon #target "S"))
					)
				)

				(if (<> #script-location "")
					(if (not (exists #script-location))
						(makedir (#script-location))
					)
					(set #pi-copy-scripts 0)
				)
			)
		)
	)
	(
		(set #pi-copy-scripts 1)
		(set #script-location (tackon #target "S"))
	)
)

;==========================================================================
(complete 45)
(if #pi-copy-scripts
	(

		(protect "..VNC..:S/fg" "+es")
		(protect "..VNC..:S/bg" "+es")
		(protect "..VNC..:S/fork" "+es")
		(protect "..VNC..:S/SetFont" "+es")
		(protect "..VNC..:S/SetKeyBoard" "+es")
		(protect "..VNC..:S/More" "+es")

		(copyfiles      (source "..VNC..:S/fg")
				(dest   #script-location)
				(optional force)
		)

		(copyfiles      (source "..VNC..:S/bg")
				(dest   #script-location)
				(optional force)
		)

		(copyfiles      (source "..VNC..:S/fork")
				(dest   #script-location)
				(optional force)
		)

		(copyfiles      (source "..VNC..:S/SetFont")
				(dest   #script-location)
				(optional force)
		)

		(copyfiles      (source "..VNC..:S/SetKeyboard")
				(dest   #script-location)
				(optional force)
		)

		(copyfiles      (source "..VNC..:S/More")
				(dest   #script-location)
				(optional force)
		)
	)
)
;
;==========================================================================
;###install startup###
;
(complete 50)
;
; now modify the startup-sequence
; first get the name 
(if (>= #version 36)
	(set #nametype 1)
	(set #nametype 2)
)

;now ask the expert user if it's O.K.
(if (> @user-level 1)
	 (set #nametype  (+	(askchoice
				(prompt #which-name)
				(help   #which-name-help)
				(choices "VNC" "NEWCON")
			 ) 1)	
	 )
)

(if (= #nametype 1)
	(set #installcmd "Mount VNC:")
	(set #installcmd "Mount NEWCON:")
)

(if (>= #version 36)
	(set #installcmd (cat ";" #installcmd))
)

(if (> @user-level 1)
	(set #pi-copy-icon (askbool     (prompt #copy-icon)
					(help #copy-icon-help)
					(default 1)
					(choices #yes #no)
				)
	)
	(set #pi-copy-icon 1)
)

(set #icon-pos #target)

(if (not (exists (tackon #icon-pos "Shell.info")))
	(set #icon-pos (tackon #target "System"))
)

(if (> @user-level 1)
	(if #pi-copy-icon
		(
			(set #icon-pos  (askdir (prompt #where-shell)
						(help #where-shell-help)
						(default #icon-pos)
					)
			)
		)
	)
)

(if (<> #icon-pos "")
	(if #pi-copy-icon
		(

			(if (exists (tackon #icon-pos "Shell.Info"))
				(delete (tackon #icon-pos "Shell.info"))
			)

			(if (= #nametype 1)
				(
					(copyfiles
						(source "..VNC..:Shell_VNC.info")
						(dest   #icon-pos)
					)
					(rename (tackon #icon-pos "Shell_VNC.info")
						(tackon #icon-pos "Shell.info"))
				)
				(
					(copyfiles
						(source "..VNC..:Shell.info")
						(dest   #icon-pos)
					)
				)
			)

			(tooltype       (dest   (tackon #icon-pos "Shell"))
					(noposition)
			)
		)
	)
)

(if #pi-copy-setvnc
	(
		(if (> @user-level 0)
			(set #do-override
				(askbool	(prompt #override-con)
						(help #override-help)
						(default 1)
						(choices #yes #no)
				)
			)
			(set #do-override 1)
		)

		(if #do-override
			(set #installcmd (cat #installcmd ("\n%s Quiet Mount Override as CON:" (tackon #cdir "SetVNC"))))
		)
	)
)

(startup "VNC"
	(command #installcmd)
	(prompt #modify-startup)
	(help (#modify-startup-help #installcmd))
)

;==========================================================================
;###install includes###
;
(complete 55)
;
;now install documentation-files for expert user

(if (> @user-level 1)
	(
		(if (askbool    (prompt #do-docs)
				(help #docs-help)
				(default 0)
				(choices #yes #no)
			)
			(
				(set #where-docs	(askdir (prompt #docs-where)
								(help   #docs-help)
								(default (tackon #target "Include"))
								(newpath)
							)
				)

				(if (<> #where-docs "")
					(copyfiles
						(source "..VNC..:Include")
						(all)
						(dest #where-docs)
					)
				)
			)
		)
	)
)

;==========================================================================
;###patch arexx bug###
;
(complete 60)
;
;

(if (> @user-level 1)
	(set #rlibs	(askdir	(prompt	#where-rexx)
				(help #where-rexx-help)
				(default #libs)
			)
	)
	(set #rlibs #libs)
)

(set #rxname (tackon #rlibs "rexxsyslib.library"))
(set #patch-arexx 0)

(if (exists #rxname)
	(

		(set #rxversion	(getversion (tackon #rlibs "rexxsyslib.library")))

		(if (< #rxversion (+ (* 36 65536) 24))
			(
					(if (> @user-level 1)
					(set #patch-arexx (askbool      (prompt #do-patch)
									(help #patch-help)
									(default 1)
									(choices #yes #no)
								)
					)
					(set #patch-arexx 1)
				)
			)
		)
	)
)
	
(if #patch-arexx
	(
			
		(if (= 0 (run ("..VNC..:Extras/SPatch -ot:rexxsyslib.library -p..VNC..:ARexx/rexxsyslib.pch \"%s\"" #rxname)))
			(
				(copyfiles      (source "t:rexxsyslib.library")
						(dest #rlibs)
				)
				(delete	"t:rexxsyslib.library")
			)
		)
	)
)
;==========================================================================
;###install the tbiclass###
;
(complete 70)
;
(if (>= #version 39)
	(
		(if (> @user-level 0)
			(set #pi-copy-tbiclass		(askbool	(prompt #copy-tbiclass)
									(help #copy-tbiclass-help)
									(default 0)
									(choices #yes #no)
							)
			)
			(set #pi-copy-tbiclass 0)
		)

		(if #pi-copy-tbiclass
			(
				(set #tbidest (tackon #target "Classes/Images"))

				(if (> @user-level 1)
					(set #tbidest		(askdir	(prompt #where-tbiclass)
									(help #where-tbiclass-help)
									(default #tbidest)
								)
					)
				)

				(if (<> #tbidest "")
					(
						(if (not (exists #tbidest))
							(makedir (#tbidest))
						)
					
						(copyfiles      (source "..VNC..:Extras/titlebar.image")
								(dest #tbidest)
						)
					)
				)
			)
		)
	)
)		

;==========================================================================
;###install stringsnip###
;
(complete 75)
;
(if (>= #version 37)
	(
		(if (> @user-level 0)
			(set #pi-copy-stringsnip	(askbool	(prompt #copy-stringsnip)
									(help #stringsnip-help)
									(default 1)
									(choices #yes #no)
							)
			)
			(set #pi-copy-stringsnip 1)
		)

		(if #pi-copy-stringsnip
			(
				(set #stringdest (tackon #target "C"))

				(if (> @user-level 1)
					(set #stringdest	(askdir	(prompt #where-stringsnip)
									(help #where-stringsnip-help)
									(default #stringdest)
								)
					)
				)

				(if (<> #stringdest "")
					(
						(if (not (exists #stringdest))
							(makedir (#stringdest))
						)
					
						(copyfiles      (source "..VNC..:Extras/StringSnip")
								(dest #stringdest)
						)

						(startup "StringSnip"
							(command ("%s >NIL: install" (tackon #stringdest "StringSnip")))
							(prompt #install-stringsnip)
							(help #stringsnip-help)
						)
					)
				)
			)
		)
	)
)
;==========================================================================
;###install unixdirs###
;
(complete 80)
;
(if (>= #version 37)
	(
		(if (> @user-level 0)
		    	(set #pi-copy-uxd		(askbool	(prompt #copy-unixdirs)
									(help #unixdirs-help)
									(default 0)
									(choices #yes #no)
							)
			)
			(set #pi-copy-uxd 0)
		)

		(if #pi-copy-uxd
			(

				(set #uxdest (tackon #target "C"))

				(if (> @user-level 1)
					(set #uxdest		(askdir	(prompt #where-unixdirs)
									(help #where-unixdirs-help)
									(default #uxdest)
								)
					)
				)

				(if (<> #uxdest "")
					(
						(if (not (exists #uxdest))
							(makedir (#uxdest))
						)
					
						(copyfiles      (source "..VNC..:Extras/UnixDirs3/UnixDirs3")
								(dest #uxdest)
						)

						(startup "UnixDirs3"
							(command ("%s WILDSTAR UNIXROOT QUIET" (tackon #uxdest "UnixDirs3")))
							(prompt #install-unixdirs)
							(help #unixdirs-help)
						)
					)
				)


				(set #pi-uxd-guide	(askbool	(prompt #copy-uxhelp)
									(help #copy-uxhelphelp)
									(default 1)
									(choices #yes #no)
							)
				)
				(if #pi-uxd-guide
					(
						(if (<> #where-guide "")
							(set #uxguidedest #where-guide)
							(set #uxguidedest (tackon #target "Guides"))
						)
	
						(if (not (exists #uxguidedest))
							(set #uxguidedest #target)
						)

						(if (> @user-level 1)
							(set #uxguidedest	(askdir	(prompt #where-uxhelp)
											(help #where-uxhelp-help)
											(default #uxguidedest)
										)
							)
						)

						(if (<> #uxguidedest "")
							(
			
								(if (not (exists (#uxguidedest)))
									(makedir (#uxguidedest))
								)


								(copyfiles      (source "..VNC..:Extras/UnixDirs3/UnixDirs3.guide")
										(dest #uxguidedest)
										(infos)
										(noposition)
								)
							
								(if (<> #guide-path "")
									(tooltype
										(dest (tackon #uxguidedest "UnixDirs3.Guide"))
										(setdefaulttool #guide-path)
									)
								)
							)
						)
					)
				)
			)
		)
	)
)
;==========================================================================
;###install truemultiassigns###
;
(complete 90)
;
(if (>= #version 37)
	(
		(if (> @user-level 0)
		    (set #pi-copy-multi	(askbool	(prompt #copy-multiassigns)
							(help #multiassigns-help)
							(default 1)
							(choices #yes #no)
					)
			)
			(set #pi-copy-multi 1)
		)

		(if #pi-copy-multi
			(
				(set #multidest (tackon #target "C"))

				(if (> @user-level 1)
					(set #multidest	(askdir	(prompt	#where-multiassigns)
								(help	#where-multiassigns-help)
								(default #multidest)
							)
					)
				)

				(if (<> #multidest "")
					(
						(if (not (exists #multidest))
							(makedir #multidest)
						)

						(copyfiles      (source "..VNC..:Extras/TrueMultiAssigns")
								(dest #multidest)
						)

						(startup "TrueMultiAssigns"
							(command (tackon #multidest "TrueMultiAssigns"))
							(prompt #install-multiassigns)
							(help #multiassigns-help)
						)
					)
				)
			)
		)
	)
)
;==========================================================================
;###install topaz6.8###
;
(complete 95)
;
(
	(if (> @user-level 0)
		(set #pi-copy-topaz		(askbool	(prompt #copy-topaz6)
								(help #copy-topaz6-help)
								(default 1)
								(choices #yes #no)
						)
		)
		(set #pi-copy-topaz 0)
	)

	(if #pi-copy-topaz
		(
			(set #topazdest (tackon #target "FONTS"))

			(if (> @user-level 1)
				(set #topazdest		(askdir	(prompt #where-topaz6)
								(help #where-topaz6-help)
								(default #topazdest)
							)
				)
			)

			(if (<> #topazdest "")
				(
					(if (not (exists #topazdest))
						(makedir (#topazdest))
					)
				
					(copyfiles      (source "..VNC..:Extras/Fonts")
							(dest #topazdest)
							(all)
					)
				)
			)
		)
	)
)

;==========================================================================
(complete 100)

(TERMINATE)

(exit #exit-text)
