; Install-SFX Start -----------------------------------------------------------------------------------------
;
; $VER: Install-SFX (02.11.1997)
;
; SoundFX Installscript
; (C) Copyright 1993-1998 Stefan Kost. All Rights Reserved.
;
; -----------------------------------------------------------------------------------------------------------

; setze sprachenabhngige Texte -----------------------------------------------------------------------------

(IF (= @LANGUAGE "deutsch")
(
	(SET #bad-kick				"SoundFX bentigt mindestens Kickstart 3.0 !")
	(SET #bad-installer			"SoundFX bentigt die Installerversion >= 43.0 !\nDieser ist im Aminet unter util/misc/Installer43.3.lha zu finden.")
	(SET #welcome-messy		 	"\n\nWillkommen zur Installation von SoundFX !\nDieses Script wird alle Dateien, die Sie zum Benutzen von SoundFX brauchen, auf Ihre Festplatte kopieren.")
	(SET #choose-dest			"Bitte Zielverzeichnis aussuchen !\nEin Verzeichnis mit dem Namen SFX wird angelegt !")
	(SET #choose-dest-help		"Hier knnen Sie auswhlen, wohin Sie das Programm installeren mchten")
	(SET #dest-require			"\n\nBitte stellen Sie sicher, da auf der Zielpartition\n3.0 MB-Speicher frei ist !")
	(SET #copy-loader			"kopiere Loader-Module ...")
	(SET #copy-operators		"kopiere Operator-Module ...")
	(SET #copy-player			"kopiere Player-Module ...")
	(SET #copy-rexx				"kopiere ARexx-Scripts ...")
	(SET #copy-saver			"kopiere Saver-Module ...")
	(SET #copy-executable		"kopiere Executable ...")
	(SET #copy-fonts			"kopiere Fonts ...")
	(SET #copy-libs				"kopiere Librarys ...")
	(SET #copy-envelopes		"kopiere Envelopes ...")
	(SET #copy-presets			"kopiere Presets ...")
	(SET #copy-workshop			"kopiere Workshopdateien ...")
	(SET #copy-gfx				"kopiere Gfx ...")
	(SET #copy-text				"kopiere Texte ...")
	(SET #copy-guides			"kopiere Guides ...")
	(SET #copy-keyfile			"kopiere Keyfile ...")
	(SET #copy-help				"Die entsprechenden Dateien werden gerade auf ihre Festplatte kopiert.")
	(SET #choose-icon			"Bitte whlen Sie den Icontyp aus, das Sie installieren mchten !")
	(SET #choose-icon-help		"Die Standart Variante ist fr eine 4-farbige WB.\nDie MagicWB und Iconographics-Varianten bentigen mindestens 8 Farben.\nDie NewIcon Varianten bentigen die NewIcon Software.")
	(SET #choose-keypath		"Bitte suchen Sie ein Zielverzeichnis aus, wo das Keyfile installiert werden soll !")
	(SET #choose-fontpath		"Bitte suchen Sie ein Zielverzeichnis aus, wo die Zeichenstze installiert werden sollen !")
	(SET #choose-path-help		"Sie knnen irgendeins der angegebenen Verzeichnisse whlen ! SFX wird in allen Verzeichnissen suchen.")
	(SET #choose-instmode		"SFX ist bereits installiert ! Wie soll ich fortfahren ?")
	(SET #choose-instmode-help	"Im Modus Backup wird das alte SFX-Verzeichnis nach SFX_old umbenannt.\nIm Modus Update werde bereits installierte Dateien berschrieben.")
	(SET #copykey-fail			"Das Kopieren des Keyfiles hat nicht geklappt !")
	(SET #exit-messy			"\n\nSFX konnte erfolgreich installiert werden.\nBitte lesen Sie das Guide, um zu erfahren wie das Programm bedient wird.\n")
	(SET #orderform				"Bestellformular.txt")
	(SET #readme				"LiesMich#?")
))
(IF (= @LANGUAGE "english")
(
	(SET #bad-kick				"SoundFX requires at least Kickstart 3.0 !")
	(SET #bad-installer			"SoundFX requires installer version >= 43.0 !\nThis could be found on Aminet in util/misc/Installer43.3.lha.")
	(SET #welcome-messy			"\n\nWelcome to the installation of SoundFX !\nThis scripts will copy all the files you need to run SoundFX to your harddisk.")
	(SET #choose-dest			"Please choose a destination directory !\nA drawer called SFX will be automatically generated !")
	(SET #choose-dest-help		"Here you can choose the place on your HD, were SFX should be installed")
	(SET #dest-require			"\n\nPlease make sure, that you have at least 3.0 MB free free space on your HD !")
	(SET #copy-loader			"copying loadermoduls ...")
	(SET #copy-operators		"copying operatormoduls ...")
	(SET #copy-player			"copying playermoduls ...")
	(SET #copy-rexx				"copying arexxscripts ...")
	(SET #copy-saver			"copying savermoduls ...")
	(SET #copy-executable		"copying executable ...")
	(SET #copy-fonts			"copying fonts ...")
	(SET #copy-libs				"copying libraries ...")
	(SET #copy-envelopes		"copying envelopes ...")
	(SET #copy-presets			"copying presets ...")
	(SET #copy-workshop			"copying workshopfiles ...")
	(SET #copy-icons			"copying icons ...")
	(SET #copy-gfx				"copying gfx ...")
	(SET #copy-text				"copying texts ...")
	(SET #copy-guides			"copying guides ...")
	(SET #copy-keyfile			"copying Keyfile ...")
	(SET #copy-help				"The respective files will copied to your HD.")
	(SET #choose-icon			"Please choose the the icon-set you want to install !")
	(SET #choose-icon-help		"The standart version is for a 4 coulour wb.\nThe MagicWB and Iconographics versions require at least 8 colours.\nThe NewIcon versions require the newicon software.")
	(SET #choose-keypath		"Please choose a directory where the keyfile should be installed to !")
	(SET #choose-fontpath		"Please choose a directory where the fonts should be installed to !")
	(SET #choose-path-help		"You can choose any of these places ! SFX will search all loactions.")
	(SET #choose-instmode		"SFX is already installed ! What should i do ?")
	(SET #choose-instmode-help	"In mode backup the old drawer will be renamed to SFX_old.\nIn mode update already installed files will be overwritten.")
	(SET #copykey-fail			"Copying of the keyfile failed !")
	(SET #exit-messy			"\n\nSFX is successfuly installed.\nPlease read the guide, to learn how to work with the program.")
	(SET #orderform				"Orderform.txt")
	(SET #readme				"ReadMe#?")
))
(IF (= @LANGUAGE "franais")
(
	(SET #bad-kick				"SoundFX demande au moins le Kickstart 3.0 !")
	(SET #bad-installer			"SoundFX demande l'installer version >= 43.0 !\nCe Script peut tre trouver sur Aminet dans util/misc/Installer43.3.lha.")
	(SET #welcome-messy			"\n\nBienvenue dans l'installation de SoundFX !\nCes  scripts vont copier tous les fichiers dont vous avez besoin pour dmarrer SoundFX de votre disque dur.")
	(SET #choose-dest			"Choisissez SVP le rpertoire de destination !\nUn rpertoire appel SFX va tre automatiquement cr !")
	(SET #choose-dest-help		"Ici vous pouvez choisir la place dans votre DD, o SFX doit tre install")
	(SET #dest-require			"\n\nVrifier SVP que vous avez au moins 3 Mo d'espace libre dans votre DD !")
	(SET #copy-loader			"Copie des modules de lecture (loadermoduls) ...")
	(SET #copy-operators		"Copie des modules oprateurs (operatormoduls) ...")
	(SET #copy-player			"Copie des modules d'coute (playermoduls) ...")
	(SET #copy-rexx				"Copie des scripts AREXX (arexxscripts) ...")
	(SET #copy-saver			"Copie des modules de sauvegarde (savermoduls) ...")
	(SET #copy-executable		"Copie de l'executable ...")
	(SET #copy-fonts			"Copie des fontes ...")
	(SET #copy-libs				"Copie des librairies ...")
	(SET #copy-envelopes		"Copie des envellopes ...")
	(SET #copy-presets			"Copie des "presets" ...")
	(SET #copy-workshop			"Copie des fichiers workshop ...")
	(SET #copy-icons			"Copie des icnes ...")
	(SET #copy-gfx				"Copie des gfx ...")
	(SET #copy-text				"Copie des textes ...")
	(SET #copy-guides			"Copie des guides ...")
	(SET #copy-keyfile			"Copie du Keyfile ...")
	(SET #copy-help				"Les fichiers respectifs vont tre copis dans votre DD.")
; CHANGE
;	(SET #choose-icon			"Choisissez SVP le type d'icne que vous voulez installer\nLa version 4 couleur est faite pour les couleurs du WorkBench standart et la version 8 couleurs est faite  pour magic-wb !")
;	(SET #choose-icon-help		"Si votre cran wb possde plus de 4 couleurs alors choisissez la version 8 couleurs.\nCelle-ci est plus belle.")
	(SET #choose-icon			"Choisissez SVP le type d'icne que vous voulez installer !")
	(SET #choose-icon-help		"La version standart est faite pour le WB de 4 couleur.\nLes versions MagicWB et Iconographics demandent au moins 8 coleurs.\nLes versions NewIcon demandent le NewIcon logiciel.")
; CHANGE
	(SET #choose-keypath		"Choisissez SVP le rpertoire o le keyfile doit tre install !")
	(SET #choose-fontpath		"Choisissez SVP le rpertoire o les fontes doivent tre installs !")
	(SET #choose-path-help		"Vous pouvez choisir n'importe lequel de ces endroits ! SFX cherchera touts ces endroits.")
	(SET #choose-instmode		"SFX est dj install ! Que dois je faire ?")
	(SET #choose-instmode-help	"En mode "backup" le vieux rpertoire sera renomm en SFX_old.\nEn mode "update", les fichiers xistants seront remplacs.")
; NEW
	(SET #copykey-fail			"Copying of the keyfile failed !")
; NEW
	(SET #exit-messy			"\n\nSFX a t install avec succs.\nLisez SVP le guide, pour apprendre comment travailler avec le programme.")
	(SET #orderform				"Orderform.franais.txt")
	(SET #readme				"ReadMe#?")
))
(IF (= @LANGUAGE "italiano")
(
	(SET #bad-kick				"SoundFX richiede il Kickstart 3.0 o superiore !")
	(SET #bad-installer			"SoundFX richiede una versione di Installer 43.0 o superiore !\nTale versione pu essere reperita in Aminet in util/misc/Installer43.3.lha.")
	(SET #welcome-messy			"\n\nBenvenuto nell'installazione di SoundFX !\nQuesto script copier tutti i file necessari sul tuo hard-disk.")
	(SET #choose-dest			"Seleziona una directory di destinazione !\nUna directory chiamata SFX sar automaticamente creata.")
	(SET #choose-dest-help		"Con questo requester puoi scegliere dove installare SFX sul tuo HD.")
	(SET #dest-require			"\n\nAssicurati di avere almeno 3.0 Mb liberi sul tuo HD !")
	(SET #copy-loader			"sto copiando i loadermodules ...")
	(SET #copy-operators		"sto copiando gli operatormodules ...")
	(SET #copy-player			"sto copiando i playermodules ...")
	(SET #copy-rexx				"sto copiando gli script arexx ...")
	(SET #copy-saver			"sto copiando i savermodules ...")
	(SET #copy-executable		"sto copiando l'eseguibile ...")
	(SET #copy-fonts			"sto copiando i fonts ...")
	(SET #copy-libs				"sto copiando le librerie ...")
	(SET #copy-envelopes		"sto copiando le envelopes ...")
	(SET #copy-presets			"sto copiando i presets ...")
	(SET #copy-workshop			"sto copiando i workshopfiles ...")
	(SET #copy-icons			"sto copiando le icone ...")
	(SET #copy-gfx				"sto copiando la grafica ...")
	(SET #copy-text				"sto copiando i testi ...")
	(SET #copy-guides			"sto copiando le guide ...")
	(SET #copy-keyfile			"sto copiando il Keyfile ...")
	(SET #copy-help				"I file selezionati verranno copiati sul tuo HD.")
; CHANGE
;	(SET #choose-icon			"Seleziona l'icona che vuoi installare\nL'icona a 4 colori  stata creata per il WB standard, mentre quella a 8 colori segue la palette MagicWB.")
;	(SET #choose-icon-help		"Se il tuo WB ha pi di 4 colori, seleziona l'icona ad 8 colori.\nQuesta icona  pi bella.")

	(SET #choose-icon			"Please choose the the icon-set you want to install !")
	(SET #choose-icon-help		"The standart version is for a 4 coulour wb.\nThe MagicWB and Iconographics versions require at least 8 colours.\nThe NewIcon versions require the newicon software.")
; CHANGE
	(SET #choose-keypath		"Please choose a directory where the keyfile should be installed to !")
	(SET #choose-keypath		"Seleziona la directory dove installare il keyfile !")
	(SET #choose-fontpath		"Seleziona la directory dove installare i fonts !")
	(SET #choose-path-help		"Puoi selezionare qualsiasi destinazione: SFX controller tutte le directory")
	(SET #choose-instmode		"SFX  gi installato ! Cosa devo fare ?")
	(SET #choose-instmode-help	"In modalit backup il vecchio cassetto verr rinominato SFX_old.\nIn modalit update i file gi installati verranno sovrascritti.")
; NEW
	(SET #copykey-fail			"Copying of the keyfile failed !")
; NEW
	(SET #exit-messy			"\n\nSFX  stato installato con successo.\nLeggi attentamente la guida per imparare ad utilizzare al meglio il programma.")
	(SET #orderform				"Orderform.italiano.txt")
	(SET #readme				"ReadMe#?")
))
(IF (= @LANGUAGE "polski")
(
	(SET #bad-kick				"SoundFX wymaga systemu w wesji co najmniej 3.0!")
	(SET #bad-installer			"SoundFX wymaga Installera w wesji co najmniej 43.0!\nNajnowsz wersj Installera znajdziesz na Aminecie: \"util/misc/Installer43.3.lha\".")
	(SET #welcome-messy         "\n\nWitaj w programie instalacyjnym SoundFXa!\nTen program skopiuje wszystkie pliki niezbdne do uruchomienia SoundFXa na Twj dysk twardy.")
	(SET #choose-dest			"Gdzie chcesz zainstalowa SoundFXa?\nKatalog \"SFX\" zostanie automatycznie utworzony!")
	(SET #choose-dest-help		"wybierz katalog na dysku twardym, w ktrym SoundFX powinien zosta zainstalowany")
	(SET #dest-require			"\n\nUpewnij si, e masz co najmniej 3.0 MB wolnego miejsca na dysku!")
	(SET #copy-loader			"kopiuj moduy wczytujce...")
	(SET #copy-operators		"kopiuj operatory...")
	(SET #copy-player			"kopiuj moduy odtwarzajce...")
	(SET #copy-rexx				"kopiuj skrypty ARexx'a...")
	(SET #copy-saver			"kopiuj moduy zapisujce...")
	(SET #copy-executable		"kopiuj program...")
	(SET #copy-fonts			"kopiuj czcionki...")
	(SET #copy-libs				"kopiuj biblioteki...")
	(SET #copy-envelopes		"kopiuj obwiednie...")
	(SET #copy-presets			"kopiuj ustawienia ...")
	(SET #copy-workshop			"kopiuj przykady ...")
	(SET #copy-icons			"kopiuj ikonki...")
	(SET #copy-gfx				"kopiuj grafik...")
	(SET #copy-text				"kopiuj teksty...")
	(SET #copy-guides			"kopiuj dokumentacj...")
	(SET #copy-keyfile			"kopiuj plik-klucz...")
	(SET #copy-help				"Odpowiednie pliki zostan skopiowane na Twj dysk twardy.")
; CHANGE
;	(SET #choose-icon			"Wybierz rodzaj ikonek do zainstalowania\n4 kolorow dla standardowej palety Workbencha oraz 8 kolorow dla palety MagicWB!")
;	(SET #choose-icon-help		"Jeli masz wicej ni 4 kolory na swoim ekranie WB wybierz wersj 8 kolorow.\nWyglda znacznie lepiej.")

	(SET #choose-icon			"Please choose the the icon-set you want to install !")
	(SET #choose-icon-help		"The standart version is for a 4 coulour wb.\nThe MagicWB and Iconographics versions require at least 8 colours.\nThe NewIcon versions require the newicon software.")
; CHANGE
	(SET #choose-keypath		"Wybierz katalog w ktrym chcesz zainstalowa swj plik-klucz")
	(SET #choose-fontpath		"Wybierz katalog w ktrym chcesz zainstalowa czcionki")
	(SET #choose-path-help		"Moesz wybra dowolny katalog z wymienionych! SFX sprawdzi je wszystkie.")
	(SET #choose-instmode		"SFX jest ju zainstalowany! Co mam zrobi?")
	(SET #choose-instmode-help	"W trybie \"Backup\" nazwa istniejcgo katalogu zostanie zmieniona na \"SFX_old\".\nW trybie aktualizacji, istniejce pliki zostan zastpione nowymi.")
; NEW
	(SET #copykey-fail			"Copying of the keyfile failed !")
; NEW
	(SET #exit-messy			"\n\nSFX zosta poprawnie zainstalowany.\nProsz, przeczytaj dokumentacj, aby dowiedzie si jak pracowa z programem.")
	(SET #orderform				"Orderform.polski.txt")
	(SET #readme				"ReadMe#?")
))
(IF (= @LANGUAGE "svenska")
(
	(SET #bad-kick				"SoundFX krver tminstone Kickstart 3.0 !")
	(SET #bad-installer			"SoundFX krver tminstone version 43.0 av installeraren !\nDenna finns p Aminet i util/misc/Installer43.3.lha.")
	(SET #welcome-messy			"\n\nVlkommen till installationen av SoundFX !\nDetta skript kommer att kopiera alla filer du behver fr att kra SoundFX till din hrddisk.")
	(SET #choose-dest			"Vlj var SoundFX skall installeras !\nEn lda med namnet SFX kommer automatiskt att skapas !")
	(SET #choose-dest-help		"Hr kan du vlja var p din hrddisk som SoundFX skall installeras.")
	(SET #dest-require			"\n\nSe till att du har minst 3.0 MB ledigt utrymme p hrddisken !")
	(SET #copy-loader			"kopierar laddningsmoduler ...")
	(SET #copy-operators		"kopierar operatormoduler ...")
	(SET #copy-player			"kopierar ljudmoduler ...")
	(SET #copy-rexx				"kopierar arexxskript ...")
	(SET #copy-saver			"kopierar sparningsmoduler ...")
	(SET #copy-executable		"kopierar krbara filen ...")
	(SET #copy-fonts			"kopierar typsnitt ...")
	(SET #copy-libs				"kopierar bibliotek (libraries)...")
	(SET #copy-envelopes		"kopierar enveloper ...")
	(SET #copy-presets			"kopierar frinstllningar (presets) ...")
	(SET #copy-workshop			"kopierar workshopfiler ...")
	(SET #copy-icons			"kopierar ikoner ...")
	(SET #copy-gfx				"kopierar grafik ...")
	(SET #copy-text				"kopierar texter ...")
	(SET #copy-guides			"kopierar guider ...")
	(SET #copy-keyfile			"kopierar nyckelfil (Keyfile) ...")
	(SET #copy-help				"Respektive filer kommer att kopieras till din hrddisk.")
; CHANGE
;	(SET #choose-icon			"Var vnlig vlj vilken ikon du vill installera\nfyrfrgsikonen r gjord fr standard Workbenchfrger och ttafrgsversionen r gjord fr Magic-WB !")
;	(SET #choose-icon-help		"Om du inte har installerat Magic-WB tidigare, vlj fyrfrgsikonen.\nOm du har installerat Magic-WB, vlj ttafrgersikonen, den ser bttre ut.")

	(SET #choose-icon			"Please choose the the icon-set you want to install !")
	(SET #choose-icon-help		"The standart version is for a 4 coulour wb.\nThe MagicWB and Iconographics versions require at least 8 colours.\nThe NewIcon versions require the newicon software.")
; CHANGE
	(SET #choose-keypath		"Var vnlig vlj var nyckelfilen skall sparas !")
	(SET #choose-fontpath		"Var vnlig vlj var typsnitten (fonts) skall installeras !")
	(SET #choose-path-help		"Du kan vlja vilken som helst av dessa stllen ! SoundFX kommer att ska p alla.")
	(SET #choose-instmode		"SoundFX r redan installerat ! Vad vill du gra ?")
	(SET #choose-instmode-help	"I backup-mod kommer den gamla ldan att dpas om till SFX_old.\nI update-mod kommer de redan installerade filerna skrivas ver.")
; NEW
	(SET #copykey-fail			"Copying of the keyfile failed !")
; NEW
	(SET #exit-messy			"\n\nSoundFX har installerats klart.\nVar god ls dokumentationen fr att lra dig hur man arbetar med programmet.")
	(SET #orderform				"Orderform.svenska.txt")
	(SET #readme				"ReadMe#?")
))

; check kick version ----------------------------------------------------------------------------------------

(SET #vernum (GETVERSION))
(SET #ver (/ #vernum 65536))
(IF (< #ver 39)
	(ABORT #bad-kick)
)

; check installer version -----------------------------------------------------------------------------------

(SET #vernum @INSTALLER-VERSION)
(SET #ver (/ #vernum 65536))
(IF (< #ver 43)
	(ABORT #bad-installer)
)

; los geht`s ------------------------------------------------------------------------------------------------

(COMPLETE 0)
(MESSAGE #welcome-messy)

; mal sehn was fr Drives da sind ---------------------------------------------------------------------------

(IF (= (EXISTS "music:" (NOREQ)) 2)
	(SET @DEFAULT-DEST "music:")
)
(IF (= (EXISTS "sound:" (NOREQ)) 2)
	(SET @DEFAULT-DEST "sound:")
)
(IF (= (EXISTS "audio:" (NOREQ)) 2)
	(SET @DEFAULT-DEST "audio:")
)

; vielleicht hat er es ja auch schon mal installiert --------------------------------------------------------

(SET lastdest (GETENV "SFXPATH"))			; cleanup old envvar
(IF (> (STRLEN lastdest) 0)
(
	(RUN "MAKEDIR ENV:Installer")
	(RUN "MAKEDIR ENV:Installer/Programs")
	(RUN "COPY ENV:SFXPath ENV:Installer/Programs/SFXPath")
	(RUN "MAKEDIR ENVARC:Installer")
	(RUN "MAKEDIR ENVARC:Installer/Programs")
	(RUN "COPY ENV:Installer/Programs/SFXPath ENVARC:Installer/Programs/SFXPath")
	(RUN "DELETE ENV:SFXPath ENVARC:SFXPath")
)
)

(SET lastdest (GETENV "Installer/Programs/SFXPath"))		; check if env-var exists
(IF (= (STRLEN lastdest) 0)
(
	(SET @DEFAULT-DEST											; no, use default
		(ASKDIR
			(PROMPT #choose-dest)
			(HELP #choose-dest-help)
			(DEFAULT @DEFAULT-DEST)
		)
	)
	(MESSAGE #dest-require)
)
(
	(SET @DEFAULT-DEST											; yes
		(ASKDIR
			(PROMPT #choose-dest)
			(HELP #choose-dest-help)
			(DEFAULT lastdest)
		)
	)
))

(RUN (CAT "SETENV Installer/Programs/SFXPath " @DEFAULT-DEST))
(RUN "MAKEDIR ENVARC:Installer")
(RUN "MAKEDIR ENVARC:Installer/Programs")
(RUN "COPY ENV:Installer/Programs/SFXPath ENVARC:Installer/Programs/SFXPath")

; falls nicht vorhanden, Verzeichnis anlegen ----------------------------------------------------------------
(COMPLETE 2)
(SET drawer-dest @DEFAULT-DEST)
(SET @DEFAULT-DEST (TACKON @DEFAULT-DEST "SFX"))
(SET sfx-dest @DEFAULT-DEST)
(IF (= (EXISTS sfx-dest) 0)									; check if drawer exists
	(MAKEDIR sfx-dest (INFOS))									; no, create one
	(
		(IF (= (EXISTS (TACKON sfx-dest "_loaders" )) 2)			; sfx-bin already installed
			(SET bin-ex 1)
			(SET bin-ex 0)
		)
		(IF (= (EXISTS (TACKON sfx-dest "Guides")) 2)				; sfx-doc already installed
			(SET doc-ex 1)
			(SET doc-ex 0)
		)
		(IF (= (EXISTS (TACKON sfx-dest "Workshop")) 2)			; sfx-data already installed
			(SET data-ex 1)
			(SET data-ex 0)
		)
		(IF (= (+ (+ bin-ex doc-ex) data-ex) 3)					; all three already installed
		(
			(SET instmode											; yes, backup or update ?
				(ASKCHOICE
					(PROMPT #choose-instmode)
					(HELP #choose-instmode-help)
					(CHOICES
						"Backup old installation"
						"Udate old installation"
					)
					(DEFAULT 0)
				)
			)
			(IF (= instmode 0)										; backup
			(
				(SET sfxsub-dest (CAT sfx-dest "_old"))
				(IF (= (EXISTS sfxsub-dest) 2)							; delete old backup
					(RUN (CAT "DELETE " sfxsub-dest " ALL QUIET FORCE"))
				)
				(COPYFILES
					(SOURCE sfx-dest)
					(DEST sfxsub-dest)
					(ALL)
					(INFOS)
				)
				(RUN (CAT "DELETE " sfx-dest "/#?.db QUIET FORCE"))		; delete old database files
			))
		))
	)
)

; SFX-bin begin ---------------------------------------------------------------------------------------------

(IF (= (EXISTS "sfx-bin") 2)
(

; Loader ----------------------------------------------------------------------------------------------------
(COMPLETE 5)
(SET sfxsub-dest (TACKON sfx-dest "_loaders"))
(IF (= (EXISTS sfxsub-dest) 0)
	(MAKEDIR sfxsub-dest)
	(RUN (CAT "DELETE " sfxsub-dest "/#?.(sfxmod|guide|modinfo) ALL QUIET FORCE"))
)
(COPYFILES
	(PROMPT #copy-loader)
	(HELP #copy-help)
	(SOURCE "sfx-bin/_loaders/")
	(DEST sfxsub-dest)
	(ALL)
)

; Operators -------------------------------------------------------------------------------------------------
(COMPLETE 8)
(SET sfxsub-dest (TACKON sfx-dest "_operators"))
(IF (= (EXISTS sfxsub-dest) 0)
	(MAKEDIR sfxsub-dest)
	(RUN (CAT "DELETE " sfxsub-dest "/#?.(sfxmod|guide|modinfo) ALL QUIET FORCE"))
)
(COPYFILES
	(PROMPT #copy-operators)
	(HELP #copy-help)
	(SOURCE "sfx-bin/_operators/")
	(DEST sfxsub-dest)
	(ALL)
)

; Player ----------------------------------------------------------------------------------------------------
(COMPLETE 15)
(SET sfxsub-dest (TACKON sfx-dest "_players"))
(IF (= (EXISTS sfxsub-dest) 0)
	(MAKEDIR sfxsub-dest)
	(RUN (CAT "DELETE " sfxsub-dest "/#?.(sfxmod|guide|modinfo) ALL QUIET FORCE"))
)
(COPYFILES
	(PROMPT #copy-player)
	(HELP #copy-help)
	(SOURCE "sfx-bin/_players/")
	(DEST sfxsub-dest)
	(ALL)
)

; Saver -----------------------------------------------------------------------------------------------------
(COMPLETE 17)
(SET sfxsub-dest (TACKON sfx-dest "_savers"))
(IF (= (EXISTS sfxsub-dest) 0)
	(MAKEDIR sfxsub-dest)
	(RUN (CAT "DELETE " sfxsub-dest "/#?.(sfxmod|guide|modinfo) ALL QUIET FORCE"))
)
(COPYFILES
	(PROMPT #copy-saver)
	(HELP #copy-help)
	(SOURCE "sfx-bin/_savers/")
	(DEST sfxsub-dest)
	(ALL)
)

; SFX -------------------------------------------------------------------------------------------------------
(COMPLETE 19)
(COPYFILES
	(PROMPT #copy-executable)
	(HELP #copy-help)
	(SOURCE "sfx-bin/sfx")
	(DEST sfx-dest)
	(NEWNAME "SoundFX")
)
(COMPLETE 23)
(SET sfxsub-dest (TACKON sfx-dest "libs"))
(IF (= (EXISTS sfxsub-dest) 0)
	(MAKEDIR sfxsub-dest)
)
(COPYFILES
	(PROMPT #copy-executable)
	(HELP #copy-help)
	(SOURCE "sfx-bin/sfxsupport.library")
	(DEST sfxsub-dest)
)

))

; SFX-bin ende ----------------------------------------------------------------------------------------------

; SFX-data begin --------------------------------------------------------------------------------------------

(IF (= (EXISTS "sfx-data") 2)
(

; Fonts kopieren --------------------------------------------------------------------------------------------
(COMPLETE 25)
(SET fontpath
	(ASKCHOICE
		(PROMPT #choose-fontpath)
		(HELP #choose-path-help)
		(CHOICES
			"FONTS:"
			"Progdir:fonts/"
		)
		(DEFAULT 0)
	)
)
(IF (= fontpath 0)
(
	(SET sfxsub-dest "FONTS:")
))
(IF (= fontpath 1)
(
	(SET sfxsub-dest (TACKON sfx-dest "fonts"))
	(IF (= (EXISTS sfxsub-dest) 0)
		(MAKEDIR sfxsub-dest)
	)
))
(COPYFILES
	(PROMPT #copy-fonts)
	(HELP #copy-help)
	(SOURCE "sfx-data/fonts/")
	(DEST sfxsub-dest)
	(ALL)
)

; Libs kopieren ---------------------------------------------------------------------------------------------
(COMPLETE 26)
(COPYLIB
	(PROMPT #copy-libs)
	(HELP #copy-help)
	(SOURCE "sfx-data/Libs/amigaguide.library")
	(DEST "LIBS:")
)
(COPYLIB
	(PROMPT #copy-libs)
	(HELP #copy-help)
	(SOURCE "sfx-data/Libs/asyncio.library")
	(DEST "LIBS:")
)

; Envelopes -------------------------------------------------------------------------------------------------
(COMPLETE 29)
(SET sfxsub-dest (TACKON sfx-dest "Envelopes"))
(IF (= (EXISTS sfxsub-dest) 0)
	(MAKEDIR sfxsub-dest)
)
(COPYFILES
	(PROMPT #copy-envelopes)
	(HELP #copy-help)
	(SOURCE "sfx-data/Envelopes/")
	(DEST sfxsub-dest)
	(ALL)
)

; Module Data (.modinfo, .presets ) -------------------------------------------------------------------------
(COMPLETE 31)
(COPYFILES
	(PROMPT #copy-presets)
	(HELP #copy-help)
	(SOURCE "sfx-data/")
	(PATTERN "_#?")
	(DEST sfx-dest)
)

; Workshop-Scripte ------------------------------------------------------------------------------------------
(COMPLETE 38)
(SET sfxsub-dest (TACKON sfx-dest "Workshop"))
(IF (= (EXISTS sfxsub-dest) 0)
	(MAKEDIR sfxsub-dest)
)
(COPYFILES
	(PROMPT #copy-workshop)
	(HELP #copy-help)
	(SOURCE "sfx-data/Workshop/")
	(DEST sfxsub-dest)
	(ALL)
)

; Delete Old Files ------------------------------------------------------------------------------------------

(COMPLETE 40)
(SET sfxsub-dest (TACKON sfx-dest "Synths"))
(IF (= (EXISTS sfxsub-dest) 1)
	(RUN (CAT "DELETE " sfxsub-dest " ALL QUIET FORCE"))
)
(COMPLETE 41)
(SET sfxsub-dest (TACKON sfx-dest "EqShps"))
(IF (= (EXISTS sfxsub-dest) 1)
	(RUN (CAT "DELETE " sfxsub-dest " ALL QUIET FORCE"))
)

; Icon ------------------------------------------------------------------------------------------------------
(COMPLETE 42)
(SET icon
	(ASKCHOICE
		(PROMPT #choose-icon)
		(HELP #choose-icon-help)
		(CHOICES
			"Standart"
			"Magic WB"
			"NewIcons"
			"AristIcons (NewIcons)"
			"Iconographics"
		)
		(DEFAULT 0)
	)
)
(SET sfxsub-dest (TACKON sfx-dest "Guides"))
(IF (= icon 0)
	(SET icon-dest "sfx-data/icons_std")
)
(IF (= icon 1)
	(SET icon-dest "sfx-data/icons_mwb")
)
(IF (= icon 2)
	(SET icon-dest "sfx-data/icons_ni")
)
(IF (= icon 3)
	(SET icon-dest "sfx-data/icons_arist")
)
(IF (= icon 4)
	(SET icon-dest "sfx-data/icons_icgfx")
)

(COPYFILES
	(PROMPT #copy-icons)
	(HELP #copy-help)
	(SOURCE (TACKON icon-dest "SoundFX.info"))
	(DEST sfx-dest)
)
(COPYFILES
	(PROMPT #copy-icons)
	(HELP #copy-help)
	(SOURCE (TACKON icon-dest "Guides.info"))
	(DEST sfx-dest)
)
(COPYFILES
	(PROMPT #copy-icons)
	(HELP #copy-help)
	(SOURCE (TACKON icon-dest "SFX.guide.info"))
	(DEST sfxsub-dest)
)
(COPYFILES
	(PROMPT #copy-icons)
	(HELP #copy-help)
	(SOURCE (TACKON icon-dest "Form.info"))
	(DEST sfx-dest)
	(NEWNAME (CAT #orderform ".info"))
)
(COPYFILES
	(PROMPT #copy-icons)
	(HELP #copy-help)
	(SOURCE (TACKON icon-dest "SoundDir.info"))
	(DEST drawer-dest)
	(NEWNAME "sfx.info")
)

; GFX -------------------------------------------------------------------------------------------------------
(COMPLETE 47)
(COPYFILES
	(PROMPT #copy-gfx)
	(HELP #copy-help)
	(SOURCE "sfx-data/SFX-Titel.rawbrush")
	(DEST sfx-dest)
	(ALL)
)

; Keyfile kopieren ------------------------------------------------------------------------------------------

(SET key-ex 0)

(IF (= (EXISTS "devs:keyfiles/sfx.key") 1)			; testen ob key bereits existiert
	(SET key-ex 1)
	(IF (= instmode 0)
	(
		(IF (= (EXISTS (CAT sfx-dest "_old/sfx.key")) 1)
			(SET key-ex 1)
		)
		(IF (= (EXISTS (CAT sfx-dest "_old/Keyfiles/sfx.key")) 1)
			(SET key-ex 1)
		)
	)
	)
)
(IF (= key-ex 0)									; nein ->checken, ob Disk im Laufwerk ist
(
	(IF (= (EXISTS "SoundFX:" (NOREQ)) 1)
	(
		(COMPLETE 51)
		(SET keypath
			(ASKCHOICE
				(PROMPT #choose-keypath)
				(HELP #choose-path-help)
				(CHOICES
					"DEVS:keyfiles/"
					"Progdir:keyfiles/"
					"Progdir:"
				)
				(DEFAULT 0)
			)
		)
		(IF (= keypath 0)
		(
			(SET sfxsub-dest "DEVS:keyfiles")
			(IF (= (EXISTS sfxsub-dest) 0)
				(MAKEDIR sfxsub-dest (INFOS))
			)
		))
		(IF (= keypath 1)
		(
			(SET sfxsub-dest (TACKON sfx-dest "keyfiles"))
			(IF (= (EXISTS sfxsub-dest) 0)
				(MAKEDIR sfxsub-dest)
			)
		))
		(IF (= keypath 2)
		(
			(SET sfxsub-dest sfx-dest)
		))
		(COMPLETE 53)
		(SET copykey 1)
		(COPYFILES							; versuche Key von der Disk zu kopieren
			(PROMPT #copy-keyfile)
			(HELP #copy-help)
			(SOURCE "SoundFX:SFX.key")
			(DEST sfxsub-dest)
			(OPTIONAL "nofail")
		)
		(TRAP 4 (SET copykey 0))			; testen ob's geklappt hat

		(IF (= copykey 0)
		(
		  (SET copykey 1)
		  (COPYFILES						; mit 1. Kopie nochmal versuchen
			(PROMPT #copy-keyfile)
			(HELP #copy-help)
		    (SOURCE "SoundFX:SFX.key_1")
			(DEST sfxsub-dest)
		    (NEWNAME "sfx.key")
		    (OPTIONAL "nofail")
		  )
		  (TRAP 4 (SET copykey 0))			; testen ob's geklappt hat
		))
		(IF (= copykey 0)
		(
		  (SET copykey 1)
		  (COPYFILES						; mit 2. Kopie nochmal versuchen
			(PROMPT #copy-keyfile)
			(HELP #copy-help)
		    (SOURCE "SoundFX:SFX.key_2")
			(DEST sfxsub-dest)
		    (NEWNAME "sfx.key")
		    (OPTIONAL "nofail")
		  )
		  (TRAP 4 (SET copykey 0))			; testen ob's geklappt hat
		))
		(IF (= copykey 0)
		(
		  (SET copykey 1)
		  (COPYFILES						; mit 3. Kopie nochmal versuchen
			(PROMPT #copy-keyfile)
			(HELP #copy-help)
		    (SOURCE "SoundFX:SFX.key_3")
			(DEST sfxsub-dest)
		    (NEWNAME "sfx.key")
		    (OPTIONAL "nofail")
		  )
		  (TRAP 4 (SET copykey 0))			; testen ob's geklappt hat
		))
		(IF (= copykey 0)
			(MESSAGE #copykey-fail)
		)
	))
))

))

; SFX-data ende ---------------------------------------------------------------------------------------------

; SFX-doc begin ---------------------------------------------------------------------------------------------

(IF (= (EXISTS "sfx-doc") 2)
(

; Guide -----------------------------------------------------------------------------------------------------

(COMPLETE 55)
(COPYFILES
	(PROMPT #copy-text)
	(HELP #copy-help)
	(SOURCE "sfx-doc/")
	(FILES)
	(PATTERN #readme)
	(DEST sfx-dest)
)
(COPYFILES
	(PROMPT #copy-text)
	(HELP #copy-help)
	(SOURCE "sfx-doc/")
	(FILES)
	(PATTERN #orderform)
	(DEST sfx-dest)
)
(COMPLETE 58)
(SET sfxsub-dest (TACKON sfx-dest "Guides"))
(IF (= (EXISTS sfxsub-dest) 0)
	(MAKEDIR sfxsub-dest)
)
(COPYFILES
	(PROMPT #copy-guides)
	(HELP #copy-help)
	(SOURCE "sfx-doc/Guides/")
	(FILES)
	(PATTERN "#?.guide")
	(DEST sfxsub-dest)
)

(COMPLETE 62)
(SET sfxsub-dest (TACKON sfx-dest "Guides/Workshop"))
(IF (= (EXISTS sfxsub-dest) 0)
	(MAKEDIR sfxsub-dest)
)
(COPYFILES
	(PROMPT #copy-guides)
	(HELP #copy-help)
	(SOURCE "sfx-doc/Guides/Workshop/")
	(FILES)
	(PATTERN "#?.rexx")
	(DEST sfxsub-dest)
)

(COMPLETE 66)
(SET sfxsub-dest (TACKON sfx-dest "_loaders"))
(IF (= (EXISTS sfxsub-dest) 0)
	(MAKEDIR sfxsub-dest)
)
(COPYFILES
	(PROMPT #copy-guides)
	(HELP #copy-help)
	(SOURCE "sfx-doc/Guides/Loaders/")
	(DEST sfxsub-dest)
	(ALL)
)

(COMPLETE 72)
(SET sfxsub-dest (TACKON sfx-dest "_operators"))
(IF (= (EXISTS sfxsub-dest) 0)
	(MAKEDIR sfxsub-dest)
)
(COPYFILES
	(PROMPT #copy-guides)
	(HELP #copy-help)
	(SOURCE "sfx-doc/Guides/Operators/")
	(DEST sfxsub-dest)
	(ALL)
)

(COMPLETE 82)
(SET sfxsub-dest (TACKON sfx-dest "_players"))
(IF (= (EXISTS sfxsub-dest) 0)
	(MAKEDIR sfxsub-dest)
)
(COPYFILES
	(PROMPT #copy-guides)
	(HELP #copy-help)
	(SOURCE "sfx-doc/Guides/Players/")
	(DEST sfxsub-dest)
	(ALL)
)

(COMPLETE 86)
(SET sfxsub-dest (TACKON sfx-dest "_rexx"))
(IF (= (EXISTS sfxsub-dest) 0)
	(MAKEDIR sfxsub-dest)
)
(COPYFILES
	(PROMPT #copy-guides)
	(HELP #copy-help)
	(SOURCE "sfx-doc/Guides/Rexx/")
	(DEST sfxsub-dest)
	(ALL)
)

(COMPLETE 92)
(SET sfxsub-dest (TACKON sfx-dest "_savers"))
(IF (= (EXISTS sfxsub-dest) 0)
	(MAKEDIR sfxsub-dest)
)
(COPYFILES
	(PROMPT #copy-guides)
	(HELP #copy-help)
	(SOURCE "sfx-doc/Guides/Savers/")
	(DEST sfxsub-dest)
	(ALL)
)

))

; SFX-doc ende ----------------------------------------------------------------------------------------------

; Fertig ----------------------------------------------------------------------------------------------------
(COMPLETE 100)
(EXIT #exit-messy)
; Install-SFX Ende ------------------------------------------------------------------------------------------
