; $VER: Install-MUI 5.14 (01.01.2021)
; $Id$

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

(complete 0)

; distinguish between normal release builds and nightly builds
(if (= @app-name "MUI 5.0 nightly")
	(set #mui_nightly 1)
	(set #mui_nightly 0)
)

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

(if (= #mui_nightly 1)
(set #intro_0 (cat "\n"
				   "Magic User Interface " current_version "\n"
				   "(nightly build)\n"
				   "========================\n"
				   "(C) 1992-2006, Stefan Stuntz\n"
				   "(C) 2006-2021, Thore Boeckelmann, Jens Maus"))
(set #intro_0 (cat "\n"
				   "Magic User Interface " current_version "\n"
				   "========================\n"
				   "(C) 1992-2006, Stefan Stuntz\n"
				   "(C) 2006-2021, Thore Boeckelmann, Jens Maus"))
)

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

(if (= lng "deutsch")
(
	(set #mui_running       "Es sind noch MUI Programme aktiv!\n\nAktive MUI Programme können den Installationsprozess behindern.\n\nEs wird empfohlen diese Programme zu beenden, bevor Sie das MUI Installationsprogramm erneut starten.\n\nWollen Sie dennoch fortfahren?")

	(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 #imgask            "\nWählen Sie die zusätzlichen Image-Pakete aus, die Sie installieren möchten.")
	(set #frameask          "\nWählen Sie die zusätzlichen Rahmen-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 #creating          "\nErstelle ")

	(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 #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:")

	(set #userstartupask	"Es werden einige Kommandos zu Ihrer \"S:User-Startup\" Datei hinzugefügt.")

	(set #muiasl_prompt     "\nSoll der MUI-basierte ASL-Requester-Patch durch \"S:User-Startup\" gestartet werden?")
	(set #muiasl_help       "\nMit diesem Patch werden alle ASL-Requester (Datei/Verzeichnis, Schriftart, Bildschirmmodus) durch entsprechende Requester auf Basis von MUI ersetzt.")
	(set #muiaslask         "\nSoll der MUI-basierte ASL-Requester-Patch durch \"S:User-Startup\" gestartet werden?")

	(set #drawer	        "Verzeichnis")
)
;=============================================================================
; italian
(if (= lng "italiano")
(
	(set #mui_running       "Attenzione, Sono state rilevate delle applicazioni MUI in esecuzione!\n\nApplicazioni MUI attive potrebbero interferire con il processo di installazione causando problemi imprevisti.\n\nSi raccomanda di terminare queste applicazioni prima di procedere all'installazione di MUI.\n\nSi desidera continuare lo stesso ?")

	(set #intro_1           "Benvenuto nel programma di installazione di MUI. Usa questo strumento per installare MUI sul tuo sistema oppure per aggiornare una versione già precedentemente installata.")
	(set #intro_2           "Tutte le nuove versioni di MUI sono retrocompatibili perciò tutti i programmi basati su MUI continueranno a funzionare beneficiando automaticamente delle nuove funzionalità.")

	(set #obso_1            "\nATTENZIONE\n=======\n\nIl file\n\n")
	(set #obso_2            "\n\npresente nel tuo hard disk non è più necessario e potrebbe causare malfunzionamenti su MUI. Si desidera cancellare questo file (scelta raccomandata) ?")
	(set #obso_yes          "Si, cancella")
	(set #obso_no           "No, non cancellare")
	(set #obso_nodel1       "\nLa presenza del file\n\n")
	(set #obso_nodel2       "\n\npotrebbe causare malfunzionamenti alla conclusione del processo di installazione MUI. In caso di problemi per favore cancella questo file.")
	(set #obso_help         "\nTutti i file dell'archivio dovranno essere compresi all'interno di un unico cassetto di nome 'MUI'. Nel caso siano presenti altri file all'esterno di questa directory (ad esempio file tralasciati da una precedente installazione), MUI potrebbe non funzionare correttamente.\n\nE' fortemente raccomandato cancellare questi file come suggerito dal programma di installazione.")

	(set #oldmui_1          "è già installato nel cassetto\n\n")
	(set #oldmui_2_1        "\n\nPuoi aggiornare questa installazione (scelta raccomandata) oppure selezionare un nuovo cassetto.")
	(set #oldmui_2_2        "\n\nQuesto pacchetto è più recente rispetto ai file che si sta cercando di installare. E' possibile fermare l'installazione (scelta raccomandata) oppure installarlo altrove selezionando un altro cassetto.")
	(set #oldmui_yes_1      "Aggiorna")
	(set #oldmui_yes_2      "Abbandona")
	(set #oldmui_no         "Modifica cassetto")

	(set #destdir           "Per favore seleziona un percorso di installazione per il pacchetto MUI. Verrà creato un cassetto di nome 'MUI' in questo percorso. Lo spazio minimo richiesto è di circa 500 kB mentre l'installazione completa richiede circa 2.5 MB di spazio libero.")
	(set #destexists_1      "\nLa directory\n\n")
	(set #destexists_2      "\n\ncontiene già un cassetto con i file di MUI, continuando l'installer procederà ad un aggiornamento dei file presenti su questo cassetto.")

	(set #guideask          "Seleziona una lingua per la documentazione AmigaGuide. E' necessario installare almeno una delle lingue se si desidera usufuire della documentazione accessibile dal programma di preferenze MUI.")
	(set #imgask            "Seleziona il set di immagini che si desidera installare.")
	(set #frameask          "Seleziona il set di frame che si desidera installare.")

	(set #nainfo1           "Oggetti marcati come")
	(set #nainfo2           "(n/d)")
	(set #nainfo3           "non sono disponibili nel corrente archivio di distribuzione a causa della mancanza di spazio.")

	(set #copying           "\nCopia di ")
	(set #copydoc2          "documentazione")
	(set #copydoc3          "non sono presenti nel corrente archivio di installazione, probabilmente a causa della mancanza di spazio. Ricorda che MUI funzionerà lo stesso anche senza questi file.")

	(set #creating          "\nCreazione di ")

	(set #finished_0        "MUI è stato correttamente installato nel cassetto")
	(set #finished_1        "Per favore riavvia il sistema prima di utilizzare una qualunque applicazione MUI.")

	(set #demosdrawer       "\nQuesti programmi di esempio servono a dimostrare alcune delle possibilità offerte da MUI nella creazione di interfacce utente e tanto altro. Queste demo non sono strettamente necessarie per una corretta installazione di MUI. Si desidera installare questi programmi di esempio adesso (circa 250 kB) ?")

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

	(set #reg_prompt        "Grazie per aver acquistato MUI. Per trasformare questa versione demo in una versione registrata comprensiva di tutte le funzionalità è necessario dotarsi di una chiave software personalizzata da installare nella directory S: del tuo hard disk. Si desidera procedere adesso (scelta raccomandata) ?")
	(set #reg_yes           "Si, installa la chiave")
	(set #reg_no            "No, non installare la chiave")
	(set #reg_help          "\nLa chiave software trasforma questa versione demo di MUI in una versione registrata tramite l'installazione della chiave nella directory S: del tuo hard disk, in questo modo tutte le funzionalità di MUI verranno abilitate. Ricorda che la chiave software è personalizzata con il tuo nome, cognome e indirizzo e non potrà essere ceduta a terzi per nessun motivo.")
	(set #reg_noway         "\nHai scelto di non installare la chiave software. Le opzioni ulteriori dedicate agli utenti registrati non saranno attivate fino a che non ti sarai registrato.\n\nRicorda che sarà sempre possibile sbloccare MUI avviando lo script di installazione in seguito oppure copiando manualmente la chiave software tramite un comando di questo tipo\n\ncopy df0:mui.key S:")

	(set #userstartupask	"Alcuni comandi verranno aggiunti nel file \"S:User-Startup\".")

	(set #muiasl_prompt     "\nSi desidera avviare la patch per i requester ASL basati su MUI in \"S:User-Startup\"?")
	(set #muiasl_help       "\nQuesta patch rimpiazza tutti i requester ASL (file/cassetti, font, modalità video) con analoghi requester basati su MUI.")
	(set #muiaslask         "\nSi desidera avviare la patch per i requester ASL basati su MUI in \"S:User-Startup\"?")

	(set #drawer	        "cassetto")
)
;=============================================================================
; french
(if (= lng "français")
(
	(set #mui_running       "Des applications MUI tournent encore !\n\nLes applications MUI en cours d'exécution peuvent perturber l'installation.\n\nIl est recommandé de les arrêter avant de relancer l'installation de MUI.\n\nVoulez-vous continuer malgré tout ?")

	(set #intro_1           "Bienvenue dans l'installation de MUI. Utilisez cet outil pour installer MUI sur votre système ou pour mettre à jour une version déjà installée.")
	(set #intro_2           "Toutes les nouvelles fonctionnalités de MUI sont rétrocompatibles, tous les programmes MUI continueront de fonctionner et bénéficieront des nouvelles fonctionnalités.")

	(set #obso_1            "\nAVERTISSEMENT\n=======\n\nLe fichier\n\n")
	(set #obso_2            "\n\nsur votre disque dur n'est pas nécessaire et perturber le bon fonctionnement de MUI. Ce fichier doit-il être supprimé (recommandé) ?")
	(set #obso_yes          "Oui, supprimer")
	(set #obso_no           "Non, ne pas supprimer")
	(set #obso_nodel1       "\nLa présence du fichier \n\n")
	(set #obso_nodel2       "\n\npeut perturber le  fonctionnement de MUI après l'installation. Si vous rencontrez des problèmes, veuillez supprimer ce fichier.")
	(set #obso_help         "\nTous les fichiers MUI résident dans un seul tiroir nommé « MUI ». S'il y a des fichiers MUI en dehors de ce tiroir (ex. parce qu'ils ont été laissés d'une installation précédente), MUI pourrait ne pas fonctionner correctement.\n\nIl est vivement recommandé de supprimer ces fichiers, comme suggéré par le programme d'installation.")

	(set #oldmui_1          "est déjà installé dans le tiroir\n\n")
	(set #oldmui_2_1        "\n\nVous pouvez mettre à jour cette installation (recommandé) ou sélectionner un nouveau tiroir.")
	(set #oldmui_2_2        "\n\nCe paquet est plus récent que les fichiers que vous vous apprêtez à installer. Vous pouvez abandonner l'installation (recommandé) ou sélectionner un nouveau tiroir.")
	(set #oldmui_yes_1      "Mettre à jour")
	(set #oldmui_yes_2      "Abandonner")
	(set #oldmui_no         "Changer de tiroir")

	(set #destdir           "Veuillez sélectionner un emplacement pour le paquet MUI. Un tiroir nommé « MUI » y sera créé. L'esapce minimal requis est d'environ 500 kiO, une installation complète occupe 2,5 MiO.")
	(set #destexists_1      "\nL'emplacement\n\n")
	(set #destexists_2      "\n\ncontient déjà un dossier MUI. Si vous continuez, la version de MUI de ce tiroir sera mise à jour.")

	(set #guideask          "Sélectionnez la(les) langue(s) de la documentation AmigaGuide que vous souhaitez installer. Vous devez au moins en choisir une si vous souhaitez bénéficier de l'aide en ligne avec les programmes de préférences MUI.")
	(set #imgask            "Sélectionez le(s) jeu(x) d'images que vous souhaitez installer.")
	(set #frameask          "Sélectionnez le(s) jeu(x) de cadres que vous souhaitez installer.")

	(set #nainfo1           "Les éléments marqués avec ")
	(set #nainfo2           "(n/d)")
	(set #nainfo3           "ne sont pas disponible dans l'archive de distribution actuelle pour des considérations de taille.")

	(set #copying           "\nCopie de ")
	(set #copydoc2          "documentation")
	(set #copydoc3          "ne fait pas partie de l'archive d'installation actuelle. Cela est probablement dû à des considérations de taille. Cependant MUI fonctionnera très bien sans ces fichiers.")

	(set #creating          "\nCréation de ")

	(set #finished_0        "MUI à été installé avec succès dans le tiroir")
	(set #finished_1        "Veuillez redémarrer votre machine avant de lancer toute application MUI.")

	(set #demosdrawer       "\nLes programmes d'example MUI démontrent certaines des possibilités offertent pour la création d'interface utilisateur. Ils ne sont pas nécessaire à une installation fonctionnelle de MUI. Voulez-vous installer les programmes d'exemple maintenant (environ 250 kiO) ?")

	(set #yes               "Oui")
	(set #no                "Non" )

	(set #reg_prompt        "Merci beaucoup d'avoir acheté MUI. Pour convertir votre version de démonstration en une version enregistrée, votre clef personnelle doit être installée sur votre disque dur dans le tiroir « S: ». Voulez-vous faire cela maintenant (recommandé) ?")
	(set #reg_yes           "Oui, installer le fichier de clef")
	(set #reg_no            "Non, ne pas installer le fichier de clef")
	(set #reg_help          "\nLe fichier de clef converti toute version MUI de démonstration en une version enregistrée. Après son installation dans le tiroir « S: » de votre disque dur, toutes les fonctionnalités seront activées. Le fichier de clef est personnalisé avec votre nom et votre adresse et ne doit être distribué sous aucun prétexte.")
	(set #reg_noway         "\nVous avez choisi de ne pas installer votre clef. Les options réservées aux utilisateurs enregistrés ne seront pas activées tant que vous ne l'aurez pas fait.\n\nVous pouvez relancer l'installation plus tard ou copier le fichier de clef manuellement avec une commande telle que \n\ncopy df0:mui.key S:")

	(set #userstartupask	"Quelques commandes vont être ajoutées à votre fichier « S:User-Startup ».")

	(set #muiasl_prompt     "\nVoulez-vous lancer le patch MUI des requêtes ASL depuis « S:User-Startup » ?")
	(set #muiasl_help       "\nCe patch remplace toutes les requêtes ASL (fichier/tiroir, police, mode d'écran) par des requêtes MUI.")
	(set #muiaslask         "\nVoulez-vous lancer le patch MUI des requêtes ASL depuis « S:User-Startup » ?")

	(set #drawer	        "tiroir")
)
;=============================================================================
; english
(
	(set #mui_running       "There are still MUI applications running!\n\nActive MUI applications can interfere with the installation process.\n\nIt is recommended to terminate these before starting the MUI installation program again.\n\nDo you want to continue nevertheless?")

	(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 #imgask            "Select the image set(s) you wish to install.")
	(set #frameask          "Select the frame 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          "documentation")
	(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 #creating          "\nCreating ")

	(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 #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:")

	(set #userstartupask	"Some commands will be added to your \"S:User-Startup\" file.")

	(set #muiasl_prompt     "\nDo you want to start the MUI based ASL requester patch by \"S:User-Startup\"?")
	(set #muiasl_help       "\nThis patch replaces all ASL requesters (file/drawer, font, screenmode) by MUI based requesters.")
	(set #muiaslask         "\nDo you want to start the MUI based ASL requester patch by \"S:User-Startup\"?")

	(set #drawer	        "drawer")
))))



;=============================================================================
; 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)
	(
		(if (<> seldir 0)
		(
			(P_COPYFILE 0 (cat (tackon cd_srcdir cd_language) ".info") (cat cddst ".info"))
			;(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")
			)
		)
		(copyfiles
			(prompt #copying cd_language " " cd_name " " #copydoc2 "...")
			(source cdsrc)
			(dest cddst)
			(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 COPYFRAMESDIR
;
; cf_dir - frame dir name

(procedure COPYFRAMESDIR
(
	(set cdsrc cf_dir)
	(set cddst (tackon (tackon destination "Images/frames") (fileonly cf_dir)))

	(if (exists cdsrc (noreq))
	(
		(copyfiles
			(prompt #copying cf_dir "...")
			(source cdsrc)
			(dest cddst)
			(all)
			(help @copyfiles-help)
			(confirm "expert")
		)
	)
	(
		(message cf_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 CHECKOBSOMUI
;
; co_name - name of obsolete file/dir

(procedure CHECKOBSOMUI
(
	; strip the .info extension, because iconinfo only works if both file and icon exist
	(if (= ".info" (substr co_name (- (strlen co_name) 5)))
		(set co_name (substr co_name 0 (- (strlen co_name) 5)))
	)

	(if (exists co_name (noreq))
	(
		(iconinfo (dest co_name) (getdefaulttool "#deftool"))
		(if (<> "MUI:MUI" #deftool)
		(
			(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)
		(
			(if (<> seldir 0)
			(
				(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)
				)
			)
			(copyfiles
				(prompt #copying cd_name " " #drawer "...")
				(source (tackon #sdir cd_name))
				(dest (tackon destination cd_name))
				(pattern "~(#?.info)")
				(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 (exists (#srcname))
	(
		; enforce simple files copies instead of version based copies even for libraries for the nightly builds
		(if (= #mui_nightly 1)
		(
			(set #lib 0)
		)
		)

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

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


(procedure P_PREPARE #drw
(
	(if (exists (#drw))
	(
		(cat "")
	)
	(
		(if (= #drw "MUI")
		(
			; prepare root dir
			(P_EXTRACT "MUI MUI.info PSI PSI.info FlushMUI FlushImagespace \" \" \" .info\"")
			(cat #tmpdir)
		)
		(
			(P_EXTRACT (cat #drw "/* " #drw ".info"))
			(cat #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)
	)
	)
)
)


;=============================================================================
; Detect still running MUI applications

(if (<> 0 (run "flushmui" (safe)))
	(if (not (askbool (prompt #mui_running) (choices #yes #no) (default 1) (help @askbool-help)))
		(exit (quiet))
	)
)


;=============================================================================
; Detect operating system

(set NEWLIB_ver (getversion "newlib.library" (resident)))

; we use newlib.library to check whether we are running on AmigaOS 4.x
(if (>= NEWLIB_ver (* 4 65536))
    (set #detectedSystem "os4")
    (set #detectedSystem "os3")
)


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

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



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

(complete 5)

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

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

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

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

(set co_name "MUI:Demos/NewStuff"              ) (CHECKOBSO)
(set co_name "MUI:Demos/NewStuff.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:libs/muimaster.library" (noreq)) 0) (set vernum (getversion "mui:libs/muimaster.library"))
	(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))
	(set rev (- vernum (* ver 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) (if (> rev 5500) (set verstr "4.0") (set verstr "3.9"))
	(if (= ver 21) (set verstr "5.0")
	(if (> ver 21) (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.info")
		(run (cat "copy /MUI.info \"" destination ".info\""))
	)
	(tooltype (dest destination) (noposition))
)
)

(complete 20)

(if (<> seldir 0)
	(copyfiles
		(prompt (cat #copying "readme files..."))
		(source "")
		(pattern "ReadMe.#?")
		(dest destination)
		(infos)
		(help @copyfiles-help)
		(confirm "expert")
	)
	(copyfiles
		(prompt (cat #copying "readme files..."))
		(source "")
		(pattern "ReadMe.~(#?.info)")
		(dest destination)
		(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 "FlushMUI")        destination)
(P_COPYFILE 1 (tackon #sdir "FlushImagespace") destination)
(P_COPYFILE 1 (tackon #sdir "PathASL")         destination)

(P_CLEANTMP)

(complete 22)



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

(set #sdir (P_PREPARE "Libs"))

(if (not (exists (tackon destination "Libs.info")))
	(P_COPYFILE 0 (tackon #sdir "Libs.info") destination)
)
(P_COPYFILE 1 (tackon #sdir "Libs/muimaster.library") (tackon destination "Libs"    ))
(P_COPYFILE 1 (tackon #sdir "Libs/muiasl.library"   ) (tackon destination "Libs"    ))
(P_COPYDIR  1 (tackon #sdir "Libs/mui"              ) (tackon destination "Libs/mui"))
(P_COPYFILE 1 (tackon #sdir "Libs/btree.library"    ) ("LIBS:"))
(P_COPYFILE 1 (tackon #sdir "Libs/bzip2.library"    ) ("LIBS:"))
(P_COPYFILE 1 (tackon #sdir "Libs/codesets.library" ) ("LIBS:"))
(P_COPYFILE 1 (tackon #sdir "Libs/guigfx.library"   ) ("LIBS:"))
(P_COPYFILE 1 (tackon #sdir "Libs/lzma.library"     ) ("LIBS:"))
(P_COPYFILE 1 (tackon #sdir "Libs/render.library"   ) ("LIBS:"))
(P_COPYFILE 1 (tackon #sdir "Libs/z.library"        ) ("LIBS:"))

(P_CLEANTMP)

(complete 30)


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

(set #sdir (P_PREPARE "Locale"))

(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)) ))
(if (= #detectedSystem "os4")
    ; AmigaOS 4.x uses english locale names only
    (
        (set #cat_name_catalan               "catalan")
        (set #cat_name_czech                 "czech")
        (set #cat_name_danish                "danish")
        (set #cat_name_dutch                 "dutch")
        (set #cat_name_english               "english")
        (set #cat_name_english_british       "english-british")
        (set #cat_name_finnish               "finnish")
        (set #cat_name_french                "french")
        (set #cat_name_german                "german")
        (set #cat_name_greek                 "greek")
        (set #cat_name_italian               "italian")
        (set #cat_name_polish                "polish")
        (set #cat_name_portuguese            "portuguese")
        (set #cat_name_russian               "russian")
        (set #cat_name_serbian               "serbian")
        (set #cat_name_slovak                "slovak")
        (set #cat_name_spanish               "spanish")
        (set #cat_name_swedish               "swedish")
        (set #cat_name_turkish               "turkish")
    )
    ; all other systems use localized locale names
    (
        (set #cat_name_catalan               "català")
        (set #cat_name_czech                 "czech")
        (set #cat_name_danish                "dansk")
        (set #cat_name_dutch                 "nederlands")
        (set #cat_name_english               "english")
        (set #cat_name_english_british       "english-british")
        (set #cat_name_finnish               "suomi")
        (set #cat_name_french                "français")
        (set #cat_name_german                "deutsch")
        (set #cat_name_greek                 "greek")
        (set #cat_name_italian               "italiano")
        (set #cat_name_polish                "polski")
        (set #cat_name_portuguese            "português")
        (set #cat_name_russian               "russian")
        (set #cat_name_serbian               "srpski")
        (set #cat_name_slovak                "slovak")
        (set #cat_name_spanish               "español")
        (set #cat_name_swedish               "svenska")
        (set #cat_name_turkish               "türkçe")
    )
)
(P_COPYDIR 1 (tackon #sdir "Locale/Catalogs/catalan"        ) (tackon (tackon destination "Locale/Catalogs") #cat_name_catalan        ))
(P_COPYDIR 1 (tackon #sdir "Locale/Catalogs/czech"          ) (tackon (tackon destination "Locale/Catalogs") #cat_name_czech          ))
(P_COPYDIR 1 (tackon #sdir "Locale/Catalogs/danish"         ) (tackon (tackon destination "Locale/Catalogs") #cat_name_danish         ))
(P_COPYDIR 1 (tackon #sdir "Locale/Catalogs/dutch"          ) (tackon (tackon destination "Locale/Catalogs") #cat_name_dutch          ))
(P_COPYDIR 1 (tackon #sdir "Locale/Catalogs/english"        ) (tackon (tackon destination "Locale/Catalogs") #cat_name_english        ))
(P_COPYDIR 1 (tackon #sdir "Locale/Catalogs/english_british") (tackon (tackon destination "Locale/Catalogs") #cat_name_english_british))
(P_COPYDIR 1 (tackon #sdir "Locale/Catalogs/finnish"        ) (tackon (tackon destination "Locale/Catalogs") #cat_name_finnish        ))
(P_COPYDIR 1 (tackon #sdir "Locale/Catalogs/french"         ) (tackon (tackon destination "Locale/Catalogs") #cat_name_french         ))
(P_COPYDIR 1 (tackon #sdir "Locale/Catalogs/german"         ) (tackon (tackon destination "Locale/Catalogs") #cat_name_german         ))
(P_COPYDIR 1 (tackon #sdir "Locale/Catalogs/greek"          ) (tackon (tackon destination "Locale/Catalogs") #cat_name_greek          ))
(P_COPYDIR 1 (tackon #sdir "Locale/Catalogs/italian"        ) (tackon (tackon destination "Locale/Catalogs") #cat_name_italian        ))
(P_COPYDIR 1 (tackon #sdir "Locale/Catalogs/polish"         ) (tackon (tackon destination "Locale/Catalogs") #cat_name_polish         ))
(P_COPYDIR 1 (tackon #sdir "Locale/Catalogs/portuguese"     ) (tackon (tackon destination "Locale/Catalogs") #cat_name_portuguese     ))
(P_COPYDIR 1 (tackon #sdir "Locale/Catalogs/russian"        ) (tackon (tackon destination "Locale/Catalogs") #cat_name_russian        ))
(P_COPYDIR 1 (tackon #sdir "Locale/Catalogs/serbian"        ) (tackon (tackon destination "Locale/Catalogs") #cat_name_serbian        ))
(P_COPYDIR 1 (tackon #sdir "Locale/Catalogs/slovak"         ) (tackon (tackon destination "Locale/Catalogs") #cat_name_slovak         ))
(P_COPYDIR 1 (tackon #sdir "Locale/Catalogs/spanish"        ) (tackon (tackon destination "Locale/Catalogs") #cat_name_spanish        ))
(P_COPYDIR 1 (tackon #sdir "Locale/Catalogs/swedish"        ) (tackon (tackon destination "Locale/Catalogs") #cat_name_swedish        ))
(P_COPYDIR 1 (tackon #sdir "Locale/Catalogs/turkish"        ) (tackon (tackon destination "Locale/Catalogs") #cat_name_turkish        ))

(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 img_tokai      "Christian 'tokai' Rosentreter") (if (= (exists (tackon #idir "tokai" )) 0) (set img_tokai  (cat img_tokai  " " #nainfo2)))

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

	(complete 35)

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

	(complete 36) (if (BITAND choice  1) ( (set ci_dir (tackon #idir "XEN"        ))      (COPYIMAGEDIR) ))
	(complete 37) (if (BITAND choice  2) ( (set ci_dir (tackon #idir "Goonie"     ))      (COPYIMAGEDIR) ))
	(complete 38) (if (BITAND choice  4) ( (set ci_dir (tackon #idir "KT"         ))      (COPYIMAGEDIR) ))
	(complete 39) (if (BITAND choice  8) ( (set ci_dir (tackon #idir "WD"         ))      (COPYIMAGEDIR) ))
	(complete 40) (if (BITAND choice 16) ( (set ci_dir (tackon #idir "kmel"       ))      (COPYIMAGEDIR) ))
	(complete 41) (if (BITAND choice 32) ( (set ci_dir (tackon #idir "tokai"      ))      (COPYIMAGEDIR) ))
	(complete 42)                          (set ci_dir (tackon #idir "Misc"       ))      (COPYIMAGEDIR)
	; always copy the default images
	(complete 43)                          (set ci_dir (tackon #idir "default_OS4")) (COPYIMAGEDIR)
	(complete 44)                          (set ci_dir (tackon #idir "default_OS3")) (COPYIMAGEDIR)
	; always copy the global base image files
	(complete 45)
	(copyfiles
		(prompt (cat #copying "global base image files..."))
		(source #idir)
		(pattern "#?.(mi1|mim)")
		(dest (tackon destination "Images"))
		(infos)
		(help @copyfiles-help)
		(confirm "expert")
	)
)
)

(P_CLEANTMP)



;=============================================================================
; Frames

(complete 45)

(set #sdir (P_PREPARE "Images/frames"))

(set #fdir (tackon #sdir "Images/frames"))
(if (<> (exists #fdir (noreq)) 0)
(
	(set frame_walkero    "George 'walkero' Sokianos" ) (if (= (exists (tackon #fdir "walkero")) 0) (set img_walkero (cat img_walkero " " #nainfo2)))

	(set choice
		(askoptions
			(prompt #frameask " " #nainfo1 " " #nainfo2 " " #nainfo3)
			(choices frame_walkero)
			(help @askoptions-help)
		)
	)

	(complete 46)

	(makedir (tackon destination "Images/frames"))
	(complete 47) (if (BITAND choice  1) ( (set cf_dir (tackon #fdir "walkero"))      (COPYFRAMESDIR) ))

	(P_COPYFILE 0 (tackon #fdir "Readme_frames.txt") (tackon destination "Images/frames"))

	(complete 48)
)
)

(P_CLEANTMP)



;=============================================================================
; Docs drawer

(complete 50)

(set #sdir (P_PREPARE "Docs"))

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

	(if (<> seldir 0)
	(
		(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/Italiano"     )) (delete (tackon destination "Docs/Italiano"     ) (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" )        ))
		(if (exists (tackon destination "Docs/Italiano.info")) (delete (tackon destination "Docs/Italiano.info")        ))
		(copyfiles
			(prompt (cat #creating "Docs " #drawer "..."))
			(source #ddir)
			(dest (tackon destination "Docs"))
			(pattern "~(English#?|Deutsch#?|Italiano#?)")
			(infos)
			(help @copyfiles-help)
			(confirm "expert")
		)
	)
	(copyfiles
		(prompt (cat #copying "Docs " #drawer "..."))
		(source #ddir)
		(dest (tackon destination "Docs"))
		(pattern "~(English#?|Deutsch#?|Italiano|#?.info)")
		(help @copyfiles-help)
		(confirm "expert")
	)
	)

	(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 "Italiano/MUI.guide"))
		((set guide_italian "Italiano") (if (= lng "italiano") ((set defchoice 4))) )
		((set guide_italian (cat "Italiano " #nainfo2)))
	)

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

	(set cd_name "MUI.guide")
	(complete 54) (if (BITAND choice 1) ( (set cd_language "English" ) (set cd_srcdir #ddir) (COPYDOC) ))
	(complete 55) (if (BITAND choice 2) ( (set cd_language "Deutsch" ) (set cd_srcdir #ddir) (COPYDOC) ))
	(complete 56) (if (BITAND choice 4) ( (set cd_language "Italiano") (set cd_srcdir #ddir) (COPYDOC) ))

	(complete 60)
)
)

(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 "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 #userstartupask)
	(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")
)


(if (askbool (prompt #muiaslask) (choices #yes #no) (default 1) (help #muiasl_help))
(
	(complete 94)

	(startup "MUI ASL"
		(prompt #muiaslask)
		(help @startup-help)
		(command "if exists \"" destination "\"\n")
		(command "   run <>nil: MUI:PatchASL\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))
