; $VER: Install-MUI 3.8 (02.02.97)

(set current_version "3.8")
(set current_libver  19)
(set lng @language)
(set #tmpdir "t:mui.inst")

(complete 0)



;=============================================================================
; Locale strings

(set #intro_0 (cat "\n\Magic User Interface " current_version "\n========================\n© 1992-97, Stefan Stuntz"))


;=============================================================================
; german

(if (= lng "deutsch")
(

(set #intro_1      "Willkommen zum MUI Installationsprogramm. Hiermit können Sie MUI neu auf Ihrem System installieren oder eine bereits vorhandene, ältere Version von MUI ersetzen.")
(set #intro_2      "Neue MUI Versionen sind immer abwärtskompatibel, alle MUI-Programme funktionieren weiter und profitieren automatisch von Verbesserungen im MUI-System.")

(set #obso_1       "\nWARNUNG\n=======\n\nDie auf Ihrer Festplatte installierte Datei\n\n")
(set #obso_2       "\n\nist überflüssig und kann die Funktionsfähigkeit von MUI beeinträchtigen. Soll diese Datei nun gelöscht werden (dringend empfohlen)?")
(set #obso_yes     "Ja, löschen!")
(set #obso_no      "Nein, nicht löschen!")
(set #obso_nodel1  "\nDie Funktionsfähigkeit von MUI kann durch das Vorhandensein der nicht gelöschten aber überflüssigen Datei\n\n")
(set #obso_nodel2  "\n\nbeeinträchtigt werden. Falls MUI nach der Installation nicht funktioniert, löschen Sie die Datei bitte von Hand.")
(set #obso_help    "\nAlle zu MUI gehörenden Dateien werden innerhalb eines einzigen Verzeichnises namens 'MUI' installiert. Wenn sich MUI-Dateien in Ihrem System außerhalb dieses Verzeichnises befinden (etwa weil diese von früheren Installationen übrig geblieben sind), kann das die Funktionsfähigkeit von MUI beeinträchtigen. \n\nEs wird deshalb dringend empfohlen, solche Dateien wie vom Installationsprogramm vorgeschlagen zu löschen.")

(set #oldmui_1     "ist auf Ihrem System bereits im Verzeichnis\n\n")
(set #oldmui_2_1   "\n\nvorhanden. Sie können diese Installation updaten (empfohlen) oder ein neues Verzeichnis auswählen.")
(set #oldmui_2_2   "\n\nvorhanden. Dieses Paket ist bereits aktueller als die Dateien die Sie gerade installieren möchen. Sie können die Installation nun abbrechen (empfohlen) oder das Verzeichnis wechseln.")
(set #oldmui_yes_1 "Update")
(set #oldmui_yes_2 "Abbrechen")
(set #oldmui_no    "Verzeichnis wechseln")

(set #destdir      "Bitte wählen Sie einen Platz für MUI. Ein Verzeichnis namens 'MUI' wird dort automatisch erzeugt. Der minimale Platzbedarf beträgt 500 kB, eine Komplett-Installation benötigt etwa 2.5 MB.")
(set #destexists_1 "\nIm gewählten Zielverzeichnis\n\n")
(set #destexists_2 "\n\nexistiert bereits eine MUI-Schublade. Wenn Sie fortfahren, wird die dort befindliche MUI-Installation aktualisiert.")

(set #guideask     "\nBitte wählen Sie die Sprache(n) für die AmigaGuide Dokumentation aus. Diese wird unter anderem für die Online-Hilfe im Voreinsteller und Screen Manager benötigt.")
(set #dviask       "\nBitte wählen Sie die Sprache(n) für die DVI Dokumentation aus. DVI Dokumentationen werden hauptsächlich zum Ausdrucken benötigt.")
(set #imgask       "\nWählen Sie die zusätzlichen Image-Pakete aus, die Sie installieren möchten.")

(set #nainfo1      "Mit")
(set #nainfo2      "(n/a)")
(set #nainfo3      "markierte Elemente sind aus Platzmangel im aktuellen Installations-Archiv nicht verfügbar.")

(set #copying      "\nKopiere ")
(set #copydoc2     "Dokumentation")
(set #copydoc3     "ist im aktuellen Installations-Archiv nicht verfügbar, sie wurden aus Platzmangel weggelassen. MUI benötigt diese Dateien nicht zur korrekten Funktion.")

(set #finished_0   "MUI wurde erfolgreich installiert im Verzeichnis")
(set #finished_1   "Bitte starten Sie nun Ihren Rechner neu, um MUI ins System einzubinden.")

(set #demosdrawer  "\nMUI-Beispielprogramme demonstrieren einige der Möglichkeiten, mit denen man Benutzeroberflächen gestalten kann. Eine Installation ist für die korrekte Funktion von MUI jedoch nicht erforderlich. Wollen Sie die MUI-Beispielprogramme (ca. 250 kB) jetzt installieren?")

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

(set #extracting   "Entpacke Dateien aus komprimierter Distribution...")

(set #reg_prompt "Vielen Dank, daß Sie sich für MUI registriert haben. Um MUI-Demoversionen in registrierte Vollversionen zu verwandeln, muß Ihr personalisiertes Keyfile auf Ihrer Festplatte im S: Verzeichnis installiert werden. Wollen Sie das jetzt tun (empfohlen)?")
(set #reg_yes    "Ja, Keyfile installieren")
(set #reg_no     "Nein, Keyfile nicht installieren")
(set #reg_help   "\nDas Keyfile verwandelt Demoversionen von MUI in registrierte Vollversionen. Nach seiner Installation im S: Verzeichnis Ihrer Festplatte werden alle Möglichkeiten von MUI verfügbar sein. Das Keyfile ist personalisiert und darf unter keinen Umständen weitergegeben werden.")
(set #reg_noway  "\nSie haben sich entschieden, daß Keyfile jetzt nicht zu installieren. Die nur für registrierte Benutzer zugänglichen Optionen werden gesperrt sein.\n\nSie können das Installationsprogramm jederzeit wieder starten oder das Keyfile von Hand kopieren. Benutzen Sie dazu einen Befehl wie\n\ncopy df0:mui.key S:")

)


;=============================================================================
; english

(

(set #intro_1      "Welcome to the MUI installation program. Use this tool to install MUI on your system or to update a previously installed MUI release.")
(set #intro_2      "All new versions of MUI are backwards compatible, all MUI programs will continue to work and automatically benefit from new features.")

(set #obso_1       "\nWARNING\n=======\n\nThe file\n\n")
(set #obso_2       "\n\non your harddisk is unneccessary and may cause MUI to malfunction. Shall this file be deleted (recommended)?")
(set #obso_yes     "Yes, delete")
(set #obso_no      "No, don't delete")
(set #obso_nodel1  "\nThe presence of the file\n\n")
(set #obso_nodel2  "\n\nmay cause MUI to malfunction after the installation. If you encounter problems, please delete the file.")
(set #obso_help    "\nAll MUI files belong to a single directory called 'MUI'. If there are any MUI files outside this directory (e.g. because they were left over from a previous installation), MUI might not work as expected.\n\nIt is strongly recommended to delete those files, like suggested by the installation program.")

(set #oldmui_1     "is already installed in the drawer\n\n")
(set #oldmui_2_1   "\n\nYou can update this installation (recommended) or select a new drawer.")
(set #oldmui_2_2   "\n\nThis package is more recent than the files you're about to install. You can abort this installation (recommended) or select a new drawer.")
(set #oldmui_yes_1 "Update")
(set #oldmui_yes_2 "Abort")
(set #oldmui_no    "Change drawer")

(set #destdir      "Please select a place for the MUI package. A drawer called 'MUI' will be created here. The minimum space required is about 500 kB, a complete installation takes 2.5 MB.")
(set #destexists_1 "\nThe directory\n\n")
(set #destexists_2 "\n\nalready contains a MUI drawer. If you continue, the MUI installation in this drawer is updated.")

(set #guideask     "Select the language(s) of AmigaGuide documentations you wish to install. You must choose at least one language if you want to use online help with the MUI preferences programs.")
(set #dviask       "Select the language(s) of DVI documentations you wish to install. DVI docs are mainly useful for printing.")
(set #imgask       "Select the image set(s) you wish to install.")

(set #nainfo1      "Items marked as")
(set #nainfo2      "(n/a)")
(set #nainfo3      "are not available in the current distribution archive due to space considerations.")

(set #copying      "\nCopying ")
(set #copydoc2     "documenation")
(set #copydoc3     "is not present in the current installation archive. It has probably been left out due to space considerations. However, MUI will run fine without those files.")

(set #finished_0   "MUI was successfully installed in the drawer")
(set #finished_1   "Please reboot your machine before starting any MUI applications.")

(set #demosdrawer  "\nMUI example programs demonstrate some of the posssibilities that MUI offers for creation of user interfaces. They are not required for a working MUI installation. Do you want to install the example programs (about 250 kB) now?")

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

(set #extracting   "Extracting files from compressed distribution...")

(set #reg_prompt "Thank you very much for purchasing MUI. To turn your demo version into a registered version, your personalized keyfile needs to be installed on your hard disk in the S: directory. Do you want to do that now (recommended)?")
(set #reg_yes    "Yes, install keyfile")
(set #reg_no     "No, don't install keyfile")
(set #reg_help   "\nThe keyfile turns any MUI demo version into a registered version. After installation in the S: directory of your harddisk, all features will be enabled. The keyfile is personalized with your name and address and may not be redistributed under any circumstances.")
(set #reg_noway  "\nYou choose not to install your keyfile. The options for registered users won't be enabled until you do that.\n\nYou can restart the installer script later or copy the keyfile manually with a command like\n\ncopy df0:mui.key S:")

))



;=============================================================================
; procedure COPYDOC
;
; cd_language - language
; cd_name     - "MUI.guide" or "MUI.dvi"
; cd_srcdir    - Docs dir

(procedure COPYDOC
(
	(set cdsrc (tackon (tackon cd_srcdir cd_language) cd_name))
	(set cddst (tackon (tackon destination "Docs") cd_language))

	(if (<> (exists cdsrc (noreq)) 0)
	(
		(run (cat "copy " (tackon cd_srcdir cd_language) ".info " "\"" cddst ".info" "\"" ))

		(copyfiles
			(prompt #copying cd_language " " cd_name " " #copydoc2 "...")
			(source cdsrc)
			(dest cddst)
			(infos)
			(help @copyfiles-help)
			(confirm "expert")
		)
	)
	(
		(message cd_name " (" cd_language ") " #copydoc3)
	))
))



;=============================================================================
; procedure COPYIMAGEDIR
;
; ci_dir - image dir name

(procedure COPYIMAGEDIR
(
	(set cdsrc ci_dir)
	(set cddst (tackon (tackon destination "Images") (fileonly ci_dir)))

	(if (exists cdsrc (noreq))
	(
		(copyfiles
			(prompt #copying ci_dir "...")
			(source cdsrc)
			(dest cddst)
			(all)
			(help @copyfiles-help)
			(confirm "expert")
		)
	)
	(
		(message ci_dir " " #copydoc3)
	)
	)
)
)



;=============================================================================
; procedure CHECKOBSO
;
; co_name - name of obsolete file/dir

(procedure CHECKOBSO
(
	(if (exists co_name (noreq))
	(
		(if (askbool (prompt #obso_1 co_name #obso_2) (choices #obso_yes #obso_no) (default 1) (help #obso_help))
		(
			(run (cat "delete all force quiet " co_name))
		)
		(
			(message (cat #obso_nodel1 co_name #obso_nodel2))
		)
		)
	)
	)
)
)



;=============================================================================
; procedure COPYDRAWER
;
; cd_name - name of drawer
; cd_ask - prompt
; cd_opts - additional options

(procedure COPYDRAWER
(
	(set #sdir (P_PREPARE cd_name))

	(if (exists (tackon #sdir cd_name) (noreq))
	(
		(set doit 1)

		(if (> (strlen cd_ask) 0)
		(
			(if (askbool (prompt cd_ask) (choices #yes #no) (default 1) (help @askbool-help))
			(
				(set doit 1)
			)
			(
				(set doit 0)
			)
			)
		)
		)

		(if (= doit 1)
		(
			(P_COPYFILE 0 (cat (tackon #sdir cd_name) ".info") destination)
			;(run (cat "copy " cd_name ".info \"" destination "\"" ))

			(copyfiles
				(prompt #copying cd_name " drawer...")
				(source (tackon #sdir cd_name))
				(dest (tackon destination cd_name))
				(all)
				(infos)
				(help @copyfiles-help)
				(confirm "expert")
				(optional cd_opts)
			)
		)
		)
	)
	)

	(P_CLEANTMP)
)
)



(procedure P_COPYDIR #lib #sourcedir #destdir
(
	(transcript #lib " " #sourcedir " " #destdir " " #wix)

	(if (exists #sourcedir)
	(
		(foreach #sourcedir "#?"
		(
			(if (< @each-type 0)
				(P_COPYFILE #lib (tackon #sourcedir @each-name) #destdir)
			)
		)
		)
	)
	)
)
)


(procedure P_COPYFILE #lib #srcname #dstdir
(
	(if #lib
	(
		(copylib
			(prompt #copying #srcname "...")
			(help @copylib-help)
			(source #srcname)
			(dest #dstdir)
			(optional "force" "askuser")
			(confirm "expert")
			(infos)
		)
	)
	(
		;(transcript "copy '" #srcname "'")

		(copyfiles
			(prompt #copying #srcname "...")
			(help @copyfiles-help)
			(source #srcname)
			(dest #dstdir)
			(optional "force" "askuser")
			(confirm "expert")
			(infos)
		)
	)
	)
)
)


(procedure P_PREPARE #drw
(
	(if (exists (#drw))
	(
		(cat "")
	)
	(
		(if (= #drw "MUI")
		(
			; prepare root dir
			(P_EXTRACT "MUI MUI.info PSI PSI.info \" \" \" .info\"")
			(cat #tmpdir)
		)
		(
			(P_EXTRACT (cat #drw "/* " #drw ".info"))
			(cat #tmpdir)
		)
		)
	)
	)
)
)


(procedure P_EXTRACT #pats
(
	(working #extracting)
	(run (cat "t:unlzx -m x muipack.lzx " #pats " " #tmpdir "/"))
)
)


(procedure P_CLEANTMP
(
	(if (exists #tmpdir)
	(
		(run (cat "delete \"" (tackon #tmpdir "#?") "\" all quiet"))
	)
	)
)
)



;=============================================================================
; Copy keyfile if registered version

(if (exists "/mui.key")
(
	(if (askbool (prompt (cat #intro_0 "\n\n" #reg_prompt)) (choices #reg_yes #reg_no) (default 1) (help #reg_help))
	(
		(copyfiles
			(prompt #reg_copying)
			(source "/mui.key")
			(dest "S:")
			(help @copyfiles-help)
			(confirm "expert")
		)
	)
	(
		(message #reg_noway)
	)
	)
)
)


;=============================================================================
; Say hello

;(set @default-dest "Work:")
(message #intro_0 "\n\n" #intro_1 "\n\n" #intro_2)

(if (exists "muipack.lzx")
(
	(run "copy unlzx t:")
	(if (= (exists #tmpdir) 0) ( (makedir #tmpdir (help @makedir-help)) ))
)
)



;=============================================================================
; Obsolete File Check

(complete 5)

(set co_name "sys:libs/muiwinborder.class"     ) (CHECKOBSO)
(set co_name "sys:libs/muiscreen.library"      ) (CHECKOBSO)
(set co_name "sys:libs/muirexx.library"        ) (CHECKOBSO)
(set co_name "sys:libs/muipropg.class"         ) (CHECKOBSO)
(set co_name "sys:libs/muimaster.library"      ) (CHECKOBSO)
(set co_name "sys:libs/muilowlevel.library"    ) (CHECKOBSO)
(set co_name "sys:libs/muilocale.library"      ) (CHECKOBSO)
(set co_name "sys:libs/muihelp.library"        ) (CHECKOBSO)
(set co_name "sys:libs/muigfx.library"         ) (CHECKOBSO)
(set co_name "sys:libs/muiconfig.library"      ) (CHECKOBSO)
(set co_name "sys:libs/muiwinscroller.class"   ) (CHECKOBSO)
(set co_name "sys:libs/muipop.library"         ) (CHECKOBSO)
(set co_name "sys:libs/muispecial.library"     ) (CHECKOBSO)
(set co_name "sys:libs/mui"                    ) (CHECKOBSO)

(set co_name "sys:classes/muiwinborder.class"  ) (CHECKOBSO)
(set co_name "sys:classes/muiscreen.library"   ) (CHECKOBSO)
(set co_name "sys:classes/muirexx.library"     ) (CHECKOBSO)
(set co_name "sys:classes/muipropg.class"      ) (CHECKOBSO)
(set co_name "sys:classes/muimaster.library"   ) (CHECKOBSO)
(set co_name "sys:classes/muilowlevel.library" ) (CHECKOBSO)
(set co_name "sys:classes/muilocale.library"   ) (CHECKOBSO)
(set co_name "sys:classes/muihelp.library"     ) (CHECKOBSO)
(set co_name "sys:classes/muigfx.library"      ) (CHECKOBSO)
(set co_name "sys:classes/muiconfig.library"   ) (CHECKOBSO)
(set co_name "sys:classes/muiwinscroller.class") (CHECKOBSO)
(set co_name "sys:classes/muipop.library"      ) (CHECKOBSO)
(set co_name "sys:classes/muispecial.library"  ) (CHECKOBSO)
;(set co_name "sys:classes/mui"                 ) (CHECKOBSO)

(set co_name "sys:prefs/MUI"                   ) (CHECKOBSO)
(set co_name "sys:prefs/MUI.info"              ) (CHECKOBSO)
(set co_name "sys:prefs/PSI"                   ) (CHECKOBSO)
(set co_name "sys:prefs/PSI.info"              ) (CHECKOBSO)



;=============================================================================
; Select destination directory

(complete 10)

(set seldir 1)

(if (<> (exists "mui:" (noreq)) 0)
(
	(set @default-dest (expandpath "mui:/"))

	(set vernum 0)
	(if (<> (exists "mui:MUI" (noreq)) 0) (set vernum (getversion "mui:MUI"))
	(if (<> (exists "mui:PSI" (noreq)) 0) (set vernum (getversion "mui:PSI"))
	))

	(set ver (/ vernum 65536))

	(if (= ver  0) (set verstr ""   )
	(if (< ver  6) (set verstr "1.x")
	(if (= ver  6) (set verstr "1.4")
	(if (= ver  7) (set verstr "2.0")
	(if (= ver  8) (set verstr "2.1")
	(if (= ver  9) (set verstr "2.2")
	(if (= ver 10) (set verstr "2.3")
	(if (= ver 11) (set verstr "3.0")
	(if (= ver 12) (set verstr "3.1")
	(if (= ver 13) (set verstr "3.2")
	(if (= ver 14) (set verstr "3.3")
	(if (= ver 15) (set verstr "3.4")
	(if (= ver 16) (set verstr "3.5")
	(if (= ver 17) (set verstr "3.6")
	(if (= ver 18) (set verstr "3.7")
	(if (= ver 19) (set verstr "3.8")
	(if (= ver 20) (set verstr "3.9")
	(if (> ver 20) (set verstr ""   )
	))))))))))))))))))

	(if (= (strlen verstr) 3)
		(set verstr (cat verstr " (library versions " ver ".x)"))
		(set verstr "(unknown version)")
	)

	(if (> ver current_libver)
	(
		(if (askbool (prompt "\nMUI " verstr " " #oldmui_1 @default-dest #oldmui_2_2) (choices #oldmui_yes_2 #oldmui_no) (help @askbool-help))
		(
			(exit (quiet))
		)
		)
	)
	(
		(if (askbool (prompt "\nMUI " verstr " " #oldmui_1 @default-dest #oldmui_2_1) (choices #oldmui_yes_1 #oldmui_no) (help @askbool-help))
		(
			(set seldir 0)
		)
		)
	)
	)
)
)

(if (<> seldir 0)
(
	(set @default-dest
		(askdir
			(prompt #destdir)
			(help @askdir-help)
			(default @default-dest)
		)
	)

	(set @default-dest (expandpath @default-dest))
)
)

(set destination (tackon @default-dest "MUI"))

(if (<> seldir 0)
(
	(if (<> (exists destination) 0)
	(
		(message (cat #destexists_1 @default-dest #destexists_2))
	)
	)
)
)



;=============================================================================
; Lets go, create destination directory, copy main files and libs

(complete 15)

; create destination directory
(if (= (exists destination) 0) ( (makedir destination (help @makedir-help)) ))

;mui drawer icon
;(if (not (exists (cat destination ".info")))
;(
	(if (exists "/MUI-IBrowse.info") (run (cat "copy /MUI-IBrowse.info \"" destination ".info\""))
	(if (exists "/MUI.info"        ) (run (cat "copy /MUI.info         \"" destination ".info\""))
	))

	(tooltype (dest destination) (noposition))
;)
;)

(complete 20)


(copyfiles
	(prompt (cat #copying "readme files ..."))
	(source "")
	(pattern "(ReadMe|LiesMich| )")
	(dest destination)
	(infos)
	(help @copyfiles-help)
	(confirm "expert")
)

(complete 21)

(set #sdir (P_PREPARE "MUI"))

(P_COPYFILE 1 (tackon #sdir "MUI") destination)
(P_COPYFILE 1 (tackon #sdir "PSI") destination)
(P_COPYFILE 1 (tackon #sdir " ") destination)

(P_CLEANTMP)

(complete 22)



;=============================================================================
; Libs

(set #sdir (P_PREPARE "Libs"))

(P_COPYFILE 0 (tackon #sdir "Libs.info") destination)
(P_COPYDIR  1 (tackon #sdir "Libs"    ) (tackon destination "Libs"    ))
(P_COPYDIR  1 (tackon #sdir "Libs/mui") (tackon destination "Libs/mui"))

(P_CLEANTMP)

(complete 30)


;=============================================================================
; Locale

(set #sdir (P_PREPARE "Locale"))

(P_COPYFILE 0 (tackon #sdir "Locale.info") destination)
(if (= (exists (tackon destination "Locale"         )) 0) ( (makedir (tackon destination "Locale"         ) (help @makedir-help)) ))
(if (= (exists (tackon destination "Locale/Catalogs")) 0) ( (makedir (tackon destination "Locale/Catalogs") (help @makedir-help)) ))
(P_COPYDIR 1 (tackon #sdir "Locale/Catalogs/deutsch"   ) (tackon destination "Locale/Catalogs/deutsch"   ))
(P_COPYDIR 1 (tackon #sdir "Locale/Catalogs/svenska"   ) (tackon destination "Locale/Catalogs/svenska"   ))
(P_COPYDIR 1 (tackon #sdir "Locale/Catalogs/greek"     ) (tackon destination "Locale/Catalogs/greek"     ))
(P_COPYDIR 1 (tackon #sdir "Locale/Catalogs/français"  ) (tackon destination "Locale/Catalogs/français"  ))
(P_COPYDIR 1 (tackon #sdir "Locale/Catalogs/català"    ) (tackon destination "Locale/Catalogs/català"    ))
(P_COPYDIR 1 (tackon #sdir "Locale/Catalogs/dansk"     ) (tackon destination "Locale/Catalogs/dansk"     ))
(P_COPYDIR 1 (tackon #sdir "Locale/Catalogs/suomi"     ) (tackon destination "Locale/Catalogs/suomi"     ))
(P_COPYDIR 1 (tackon #sdir "Locale/Catalogs/polski"    ) (tackon destination "Locale/Catalogs/polski"    ))
(P_COPYDIR 1 (tackon #sdir "Locale/Catalogs/czech"     ) (tackon destination "Locale/Catalogs/czech"     ))
(P_COPYDIR 1 (tackon #sdir "Locale/Catalogs/italiano"  ) (tackon destination "Locale/Catalogs/italiano"  ))
(P_COPYDIR 1 (tackon #sdir "Locale/Catalogs/nederlands") (tackon destination "Locale/Catalogs/nederlands"))

(P_CLEANTMP)

(complete 32)


;=============================================================================
; Images

(complete 34)

(set #sdir (P_PREPARE "Images"))

(set #idir (tackon #sdir "Images"))
(if (<> (exists #idir (noreq)) 0)
(
	(set img_xen    "Martin 'MagicWB' Huttenloher") (if (= (exists (tackon #idir "XEN"   )) 0) (set img_xen    (cat img_xen    " " #nainfo2)))
	(set img_goonie "Andreas 'Goonie' Schildbach" ) (if (= (exists (tackon #idir "Goonie")) 0) (set img_goonie (cat img_goonie " " #nainfo2)))
	(set img_kt     "Christian 'Kochtopf' Scholz" ) (if (= (exists (tackon #idir "KT"    )) 0) (set img_kt     (cat img_kt     " " #nainfo2)))
	(set img_kmel   "Klaus 'kmel' Melchior"       ) (if (= (exists (tackon #idir "kmel"  )) 0) (set img_kmel   (cat img_kmel   " " #nainfo2)))
	(set img_wd     "Walter Dörwald"              ) (if (= (exists (tackon #idir "WD"    )) 0) (set img_wd     (cat img_wd     " " #nainfo2)))

	(set choice
		(askoptions
			(prompt #imgask " " #nainfo1 " " #nainfo2 " " #nainfo3)
			(choices img_xen img_goonie img_kt img_wd img_kmel)
			(help @askoptions-help)
		)
	)

	(complete 35)

	(makedir (tackon destination "Images"))
	(P_COPYFILE 0 (tackon #sdir "Images.info") destination)

	(complete 39) (if (BITAND choice  1) ( (set ci_dir (tackon #idir "XEN"   )) (COPYIMAGEDIR) ))
	(complete 41) (if (BITAND choice  2) ( (set ci_dir (tackon #idir "Goonie")) (COPYIMAGEDIR) ))
	(complete 43) (if (BITAND choice  4) ( (set ci_dir (tackon #idir "KT"    )) (COPYIMAGEDIR) ))
	(complete 45) (if (BITAND choice  8) ( (set ci_dir (tackon #idir "WD"    )) (COPYIMAGEDIR) ))
	(complete 47) (if (BITAND choice 16) ( (set ci_dir (tackon #idir "kmel"  )) (COPYIMAGEDIR) ))
	(complete 49)                          (set ci_dir (tackon #idir "Misc"  )) (COPYIMAGEDIR)
)
)

(P_CLEANTMP)



;=============================================================================
; Docs Drawer

(complete 50)

(set #sdir (P_PREPARE "Docs"))

(set #ddir (tackon #sdir "Docs"))
(if (exists #ddir)
(
	(P_COPYFILE 0 (tackon #sdir "Docs.info") destination)

	(if (exists (tackon destination "Docs/Preview"     )) (delete (tackon destination "Docs/Preview"     ) (infos)))
	(if (exists (tackon destination "Docs/Deutsch"     )) (delete (tackon destination "Docs/Deutsch"     ) (all)  ))
	(if (exists (tackon destination "Docs/English"     )) (delete (tackon destination "Docs/English"     ) (all)  ))
	(if (exists (tackon destination "Docs/Deutsch.info")) (delete (tackon destination "Docs/Deutsch.info")        ))
	(if (exists (tackon destination "Docs/English.info")) (delete (tackon destination "Docs/English.info")        ))

	(copyfiles
		(prompt "Creating Docs Drawer...")
		(source #ddir)
		(dest (tackon destination "Docs"))
		(pattern "~(#?.lzx|English#?|Deutsch#?)")
		(infos)
		(help @copyfiles-help)
		(confirm "expert")
	)

	; !!!
	(if (exists "Docs/misc.lzx")
	(
		(run (cat "t:unlzx -m e Docs/misc.lzx \"" (tackon destination "Docs") "/\""))
	)
	)

	(if (exists (tackon #ddir "English/MUI.guide"))
	((set guide_english "English") (if (= lng "english") ((set defchoice 1))) )
	((set guide_english (cat "English " #nainfo2))))

	(if (exists (tackon #ddir "Deutsch/MUI.guide"))
	((set guide_german "Deutsch") (if (= lng "deutsch") ((set defchoice 2))) )
	((set guide_german (cat "Deutsch " #nainfo2))))

	(if (exists (tackon #ddir "Français/MUI.guide"))
	((set guide_french "Français") (if (= lng "français") ((set defchoice 4))) )
	((set guide_french (cat "Français " #nainfo2))))

	(set choice
		(askoptions
			(prompt #guideask " " #nainfo1 " " #nainfo2 " " #nainfo3)
			(choices guide_english guide_german guide_french)
			(default defchoice)
			(help @askoptions-help)
		)
	)

	(set cd_name "MUI.guide")
	(complete 53) (if (BITAND choice 1) ( (set cd_language "English" ) (set cd_srcdir #ddir) (COPYDOC) ))
	(complete 56) (if (BITAND choice 2) ( (set cd_language "Deutsch" ) (set cd_srcdir #ddir) (COPYDOC) ))
	(complete 59) (if (BITAND choice 4) ( (set cd_language "Français") (set cd_srcdir #ddir) (COPYDOC) ))

	(complete 60)

	(delete unarced)
)
)

(P_CLEANTMP)



;=============================================================================
; Other drawers

(complete 65) (set cd_name "Demos"   ) (set cd_ask #demosdrawer) (set cd_opts ""      ) (COPYDRAWER)
(complete 70) (set cd_name "Icons"   ) (set cd_ask ""          ) (set cd_opts ""      ) (COPYDRAWER)
(complete 75) (set cd_name "Presets" ) (set cd_ask ""          ) (set cd_opts ""      ) (COPYDRAWER)
(complete 80) (set cd_name "Rexx"    ) (set cd_ask ""          ) (set cd_opts ""      ) (COPYDRAWER)
(complete 85) (set cd_name "Goodies" ) (set cd_ask ""          ) (set cd_opts ""      ) (COPYDRAWER)
(complete 90) (set cd_name "Patterns") (set cd_ask ""          ) (set cd_opts "nofail") (COPYDRAWER)


(if (exists (tackon destination "Install")) (delete (tackon destination "Install") (all)))


;=============================================================================
; Startup Sequence

(complete 93)

(startup "MUI"
	(prompt "Some commands will be added to your \"s:user-startup\" file.")
	(help @startup-help)
	(command "if exists \"" destination "\"\n")
	(command "   assign MUI: \"" destination "\"\n")
	(command "   if exists MUI:Libs\n")
	(command "      assign add LIBS: MUI:Libs\n")
	(command "   endif\n")
	(command "   if exists MUI:Locale\n")
	(command "      assign add LOCALE: MUI:Locale\n")
	(command "   endif\n")
	(command "   version >nil: exec.library 39\n")
	(command "   if not warn\n")
	(command "      if exists MUI:Docs\n")
	(command "         if exists HELP:dummy ; do not remove\n")
	(command "         endif                ; this entry!\n")
	(command "         assign add HELP: MUI:Docs\n")
	(command "      endif\n")
	(command "   endif\n")
	(command "endif")
)



;=============================================================================
; Finish

(complete 95)

(run (cat "assign mui: " "\"" destination "\""))

(complete 100)

(exit #intro_0 "\n\n" #finished_0 "\n\n" destination "\n\n" #finished_1 (quiet))
