;***************************************************************************
; * $VER: Install Opus MPEGA 3.9 (30.Mai 1998)
; * Script written by Eckhard Ludwig
;***************************************************************************

(set #defaultdest "DOpus5:")
(set #current_version "3.9")
(set #lng @language)
(complete 0)

;****************************************************************************

(set #intro1 (cat 
		"Opus MPEGA PPC " 
		#current_version 
		"\nThe Definitive MPEG Audio Player for Directory Opus5\n"
		  "****************************************************\n"
		"Written ©1998 by Eckhard Ludwig"
		))

;***************************************************************************
; deutsche Texte
;***************************************************************************

(if (= #lng "deutsch")
(
(set #Opt 1)
(set #INFO  (cat	"Sie installieren OpusMPEGA, den besten MPEG Audioplayer für Directory Opus5.\n\n"
			"Unterstützt werden 68k-Amigas und PowerUp-Boards by phase5.\n"
			"V3.9 spielt die Soundformate: mp2 mp3 AIFF 8SVX MAUD CDDA WAVE AU VOC."
))
(set GuidePrompt  (cat  "Installiere Guide\n=================\nFür Opus MPEGA existiert eine umfangreiche deutschsprachige Anleitung im AmigaGuide®-Format."
			" Diese läßt sich jederzeit über das Applicationsicon Menü aufrufen.\n\n"
		 	"Wählen sie das Zielverzeichnis. Normalerweise ist dies DOpus5:Help, wie in der Voreinstellung."
))
(set FILEPrompt		"Auswahl Formate:\n================\nWelche Samples sollen von OpusMPEGA und per Doppelklick unterstützt werden? Siehe Hilfe.\n")
(set FILEHelp		(cat
			"Für die gewählten Formate werden Opus5-Filetypes nach DOpus5:Filetypes installiert.\n\n"
			"Nicht gewählte Formate werden nach DOpus5:Storage installiert.\n\n"
			"CDDA spielt RAW Sounddateien im Formar Intel 16bit entsprechend CDDA Rohdaten."
			" Erkannt wird das Format am Suffix .cdda, oder am Namen track#? entsprechend dem Filesystem AsimCDFS."
	))
(set APPICONPrompt	"Auswahl Iconformat:\n===================\nWählen sie das Format für das AppIcon.\nSiehe ausführliche Hilfe!\n")
(set APPICONHelp	(cat
			"Bei der Darstellung von Applicationsicons im NewIcons Format kann es zu Problemen kommen.\n"
			"Auf den Testsystemen funktionierte die Darstellung des Appicon im Newiconsformat nur bei Deaktivierung der Newicons?\n\n"
			"Hierzu wurde im Menü [Einstellungen/Umgebung/Pikt.farben] der Harken für den Punkt [NewIcons aktivieren] gelöscht."
			" Leider ist dann die Farbwiedergabe von Newicons nicht mehr sehr gut.\n\n"
			"In der Anleitung zu Opus ist dieses Problem mit AppIcons bekannt, und es wird auf die Installation des Patches [C:NewIcons} hingewiesen.\n"
			"Leider ist damit auf den Testsystemen kein Erfolg erzielt wurden.\n\n"
			"Falls sie gleiche Probleme haben, installieren sie das Standardicon [4 colors] oder [MagicWB 8 colors] bzw. [NewIcons + MagicWB] !\n"
	))
(set GuidedirPrompt	"Bitte Schublade für Guide wählen.")
(set PrefsdirPrompt	"Bitte Schublade für Prefs (OpusMPEGA) wählen.")
(set PrefsPrompt  (cat	"Installiere Preferences\n========================\n"
			"Um OpusMPEGA auf verschiedene Soundkarten bzw. Amigaaudio konfigurieren zu können,"
			" und zum Setzen der Pfade, existiert ein Konfigurations Programm.\n\n"
			"Dieses Programm können sie in ein beliebiges Verzeichnis kopieren, normalerweise ist dies das"
			" Prefs Verzeichnis der Workbench.\n"
			"Das Konfigurationsprogramm kann direkt von OpusMPEGA über das Applicationsicon Menü aufgerufen werden."
))
(set Installprompt      "Lokalisierung:\n==============\nBitte wählen sie die bevorzugte(n) Sprachversion(en).")
(set Opus5DirPrompt     "Bitte wählen Sie die Schublade, wo DirectoryOpus installiert wurde!")
(set Opus5Message       "Die zu installierenden Programme sind nur von DirectoryOpus5 aus nutzbar !\n\nIst DirectoryOpus5 korrekt installiert wurden ?\n\nBitte wählen Sie die Schublade, wo DirectoryOpus installiert wurde oder installieren sie DirectoryOpus5 zuerst!")
(set Opus5Help          "Die zu installierenden Programme sind nur von DirectoryOpus5 aus nutzbar !\nIst DirectoryOpus5 korrekt installiert wurden ?\nBitte installieren sie DirectoryOpus5 zuerst!")
(set Deinstallprompt    "Es ist bereits eine neuere Version von OpusMPEGA installiert!\nSoll diese wirklich ersetzt werden!?")
(set ArexxDirPrompt     "Das Arexx-Verzeichnis von DirOpus5 existiert nicht?!\nBitte wählen Sie eine Schublade für die ARexx-Skripte!")
(set ModulesDirPrompt   "Das Modules-Verzeichnis von DirOpus5 existiert nicht?!\nBitte installieren sie Directory Opus5 neu!")
(set RexxPrompt		"\nDie Skript-Sprache ARexx ist im Lieferumfang von AmigaDOS enthalten, jedoch nicht verfügbar, bevor Sie nicht das Programm 'RexxMast' aufgerufen haben.\nEs wird empfohlen, ARexx immer zu starten.\nWenn Sie ARexx automatisch starten lassen möchten, klicken Sie auf 'Weiter', um ARexx von Ihrer 'User-Startup' aus starten zu lassen.")
(set #Oldplayprompt	(cat
			"Auswahl für Doppelklick:\n========================\n"
			"Möchten sie zum Spielen per Doppelklick die Standard Version (Fortgangsindikator GUI mit Timer) benutzen,"
			" oder doppelgeklickte Song's über OpusMPEGA (eigenes Abspielfenster/Playliste mit Fortgangsindikator) spielen."
			" Siehe umfangreiche Hilfe.\n"
))
(set #Oldplayhelp	(cat
			"Doppelklick:\n============\n"
			"Die Standardversion ist besonders geeignet, um zahlreiche Samples per Doppelklick durchzuhören."
			" Das Anklicken eines neuen Samples beendet automatisch das alte, oder auch OpusMPEGA.\n"
			"Mit gedrückt gehaltener rechter Alt-Taste werden doppelgeklickte Samples in die OpusMPEGA Playliste übertragen."
			" Die Playliste wird geöffnet, bzw. bei bereits laufenden OpusMPEGA wird das Sample angehängt.\n\n"
			"Bei Auswahl von OpusMPEGA wird das doppelgeklickte Sample nach OpusMPEGA übertragen (eine Playliste wird geöffnet)."
			" Ist bereits eine Playliste geöffnet, wird diese gelöscht und eine laufende Wiedergabe abgebrochen."
			" Die Taste Rechts-Alt fügt Samples zur Playliste hinzu.\n\n" 
			"Für die Varianten werden unterschiedliche Filetypes installiert.\n"
			"Für Standard ist Opus Magellan (V5.6) erforderlich, sonst erhalten sie eine Fehlermeldung.\n\n"
			"OpusMPEGA\n=========\n"
			"OpusMPEGA verwaltet in einem Opus5 Lister die Playliste. Gespielt werden die Songs in normaler oder zufälliger Reihenfolge."
			" Weitere Songs können jederzeit per Drag'n Drop, über Auswahlbutton u.a. (Siehe Guide) hinzugefügt werden.\n"
			"Verschiedene Sampletypen (z.B. mp2 mp3 IFF 8SVX und WAVE) können beliebig gemischt werden."
			" Für Samples und Layer-2 sowie Layer-3 wird jeweils eine eigene Konfiguration benutzt, wobei sämtliche bekannten Player,"
			" Soundkarten, 68k, PowerPC, WarpOS usw. unterstützt werden.\n"
			"Zur Steuerung von OpusMPEGA sind Buttonleisten, auch mit aufwendigen Design, verfügbar."
			" Als Funktionen stehen PLAY STOP NEXT PREVIOUS PAUSE MP3INFO HELP PREFS SHUFFLE REPEAT und mehr zur Verfügung."
))
(set #PLAYSEL		"Indikator GUI")
(set PlayerCopy1Prompt  "\nKopiere Modules ...\n")
(set PlayerCopy2Prompt  "\nKopiere Skripte ...\n")
(set ButtonPrompt  	"\nKopiere Buttons ...\n")
(set LocaleCopyPrompt   "\nKopiere Cataloge ...\n")
(set ButtonCopyPrompt   "\nKopiere Knopfbank ...\n")
(set FiletypesPrompt    "\nKopiere Opus5-Filetypes ...\n")
(set StoragesPrompt    	"\nKopiere Opus5-Filetypes (Storage) ...\n")
(set IconsPrompt    	"\nKopiere Opus5-ApplicationsIcons ...\n")
(set GuideCopyPrompt	"\nKopiere Anleitung...\n")
(set PrefsCopyPrompt	"\nKopiere Preferences ...\n")
(set ToolsCopyPrompt	"\nKopiere Tools ...\n")
(set #t_oldinstaller
		(cat
			"Die benutzte Version des Programmes Installer ist leider zu alt!"
			" Benötigt wird Version 43.3 oder neuer. Die Konfiguration kann"
			" fortgesetzt werden, es können allerdings Fehler auftreten!\n\n"
			"Möchten sie fortfahren?"
		))
(set #t_oldinstallerhelp 
		(cat
			" Die aktuelle Version des Installers findest du im AMINET im util/misc Directory."
			" Der aktuelle File Name ist \"Installer-43_3.lha\":\n"
			" <URL:ftp://ftp.germany.aminet.org/pub/aminet/util/misc/Installer-43_3.lha"
		))

(set #Removeold
		(cat
			"\nEine ältere Version von Opus MPEGA (PlayMP2.dopus5) wurde gefunden. Bevor die neue Version "
			"installiert wird, muß Directory Opus5 aufgeräumt werden."
		)
)
(set #exitMsg   (cat
			"Beende Installation\n===================\n"
			"Zum Spielen von MPEG Audio Song's und Samples:\n\n"
			"Setzen sie zuerst über Prefs/OpusMPEGA ihre Soundhardware und die Pfade zu den Programmen!\n"
			"Spielen sie selektierte Samples über den Knopf 'Play' oder spielen sie Samples direkt per Doppelklick.\n\n"
			"Viel Spaß mit OpusMPEGA 3.9 PPC\nfür Directory Opus5.5+ wünscht\nEckhard Ludwig")
		)
)

;******************************************************************************************************
; english

(
(set #Opt 2)

(set #info 	(cat 	"You install OpusMPEGA, the best MPEG Audioplayer for DirectoryOpus5.\n" 
			"68k-Amigas and PowerUP board by phase5 are supported.\n"
			"V3.9 plays the sound formats: mp2 mp3 AIFF 8SVX MAUD CDDA WAVE AU VOC.\n\n"
			"English translation by http://www.systransoft.com"
))
(set GuidePrompt (cat 	"Install Guide\n=================\n"
			"\nFor Opus MPEGA exists an extensive guidance in the AmigaGuide® format."
			" This can be called at any time over the Appicon menu.\n\n" 
			"Select they the target directory.  Normally this DOpus5:Help is, like in the default."
))
(set FILEPrompt		"Selection of formats:\n================\nWhich Samples is of OpusMPEGA and by doubleclicks to be supported? See Help.\n")
(set FILEHelp		(cat
			"For the selected formats Opus5-Filetypes are installed after DOpus5:Filetypes.\n"
			"Not selected formats are installed after DOpus5:Storage.\n"
			"CDDA plays RAW sound files in the Formar Intel 16bit according like CDDA raw data."
			" The format is detected at the suffix .cdda, or at the name TRACK#? according to the file system AsimCDFS."
	))
(set PrefsPrompt      	"Install Preferences\n====================\n\nFor Preferences Soundcards and Paths exists Program (OpusMPEGA).\nThey can copy this program into any directory, normally are this the Prefs directory of the Workbench.")
(set GuidedirPrompt	"Please select guide drawer.")

(set PrefsPrompt (cat 	"\n\nOpusMPEGA on different sound cards or Amiga audio to configure to be able," 
			"and for setting the paths of MPEGA or PPCMpegPlayer, exists to configurations a Programm.\n\n"
			"This program they can copy into any directory, normally are this"
			" the Prefs directory of the Workbench.\n"
			"The configuration program can directly over the Applicationsicon menu will call."
))
(set APPICONPrompt	"Selection Iconformat:\n===================\nSelecting it the format for the AppIcon. See detailed assistance!")
(set APPICONHelp	(cat
			"During the representation of Appicons in the NewIcons format can come it to problems."
			" On the test systems the representation of the Appicon in the Newiconsformat functioned only with deactivation"
			" of the Newicons? For this in the opusmenu the rakes for the point [NewIcons to activate]. Unfortunately then" 
			" the color reproduction of Newicons is very no longer good. In the guidance for Opus this problem with AppIcons"
			" is well-known, and one refers to the installation of the Patches [C:NewIcons].\n"
			"Unfortunately is thereby on the test systems no success were obtained.\n\n"
			"If they have same problems, they install the Standardicon [4 colors] or [MagiWB 8 colors] or [NewIcons + MagiWB]!" 
	))

(set PrefsdirPrompt	"Please select Prefs drawer (OpusMPEGA).")

(set InstallPrompt      "Localization:\n==============\nWhich of the following locale should be installed ?\nItems marked as (n/a) are not available in the current installation archive!")

(set Opus5DirPrompt 	"Please select the drawer, where DirectoryOpus was installed!")  
(set Opus5Message 	"The programs which can be installed are usable only from DirectoryOpus5!\n\nIs DirectoryOpus5 were correctly installed?\n\nPlease to select you the drawer, where DirectoryOpus was installed or to installit for DirectoryOpus5 first!")
(set Opus5Help 		"The programs which can be installed are usable only from DirectoryOpus5!\nIs DirectoryOpus5 were correctly installed?\nPlease to install it DirectoryOpus5 first!")
(set Deinstallprompt    "There is already an newer version of OpusMPEGA installed in the directory!\nIs this to be really replaced!?")
(set ArexxDirPrompt     "The Arexx directory of DirOpus5 does not exist?! Please you select a drawer for the ARexx scriptes!")
(set ModulesDirPrompt   "The module it directory of DirOpus5 does not exist?! Please they install Opus5 again for directory!")
(set RexxPrompt 	"\nThe script language ARexx is in the scope of supply of Amiga DOS contained, however not available, before it the program RexxMast called.\nRecommended, ARexx always too start.\nIt ARexx start to let automatic would like, click on proceed to let start around ARexx of your user-Startup out.")
(set #Oldplayprompt	(cat
			"Selection for doubleclick:\n==========================\n"
			"They would like for playing by doubleclick the standard version (continuation indicator GUI with timer) to use,"
			" or doubleclicked songs over OpusMPEGA (own Playliste with continuation indicator) to play.\n"
			"See extensive assistance.\n"
))
(set #Oldplayhelp	(cat
			"Doubleclick:\n============\nThe standard design is particularly "
			"suitably, in order numerous Samples by doubleclicks to through-listen.\n"
			"Clicking a new Samples terminates automatically the old, or also OpusMPEGA.\n"
			"With pressed right Alt key held doubleclicked Samples will transfer into the OpusMPEGA Playlist.\n"  
			"With selection of OpusMPEGA the doubleclicked sample after OpusMPEGA transferred (a playlist opened).\n"
			"If a playlist is already opened, this is deleted and a current playback is aborted.\n"
			"The key right alt adds Samples to the playlist.\n" 
			"For the versions different of filetypes are installed.\n\n"
			"For standard Opus Magellan (V5.6) is necessary, otherwise they receive an error message.\n\n"
			"OpusMPEGA\n=========\n"
			"OpusMPEGA administers the playlist in a Opus5 Lister. The Songs in normal or coincidental order is played." 
			" Further Songs can at any time by Drag'n drop, over button among other things (see Guide) to be added." 
			" Different samples types (e.g. mp2 mp3 IFF 8SVX and WAVE) can be mixed at will."
			" For samples and Layer-2 as well as Layer-3 its own configuration is used in each case, whereby all well-known Player,"
			" Soundcards, 68k, powerPC, WarpOS etc. to be supported.\n" 
			"For the control of OpusMPEGA Buttonbank, also available with complex Design, are.\n"
			"As functions: PLAY STOP NEXT PREVIOUS PAUSE MP3INFO HELP PREFS SHUFFLE REPEAT and more at the disposal."
	))

(set #PLAYSEL		"Progressbar GUI")
(set PlayerCopy1Prompt  "Copy modules ...")
(set PlayerCopy2Prompt  "Copy script ...")
(set ButtonPrompt  	"Copy buttons ...")
(set LocaleCopyPrompt   "Copy cataloges ...")
(set ButtonCopyPrompt   "Copy buttons ...")
(set FiletypesPrompt    "Copy filetypes ...")
(set StoragesPrompt    	"Copy filetypes (Storage) ...")
(set IconsPrompt    	"Copy Appicons ...")
(set GuideCopyPrompt	"Copy guide ...")
(set PrefsCopyPrompt	"Copy preferences ...")
(set ToolsCopyPrompt	"Copy tools ...")
(set #t_oldinstaller	(cat
			" You have an old version of the Installer. I'll probably"
			" need version 43.3 or greater. You can continue anyway"
			" but there is no guarantee it will work as it's supposed"
			" to do.\n\n"
			" Do you wish to continue anyway?"
	))
(set #exitMsg   (cat	"Terminate installation\n=======================\n"
			"To playing MPEG audio Song's and Samples:\n"

			"Set they first over Prefs/OpusMPEGA their sound hardware and the paths to the programs.\n"
			"Play they selected Samples over the button 'Play', or play them samples directly by doubleclick.\n\n"
			"Much fun with Opus MPEGA for DirectoryOpus5.5+ wish you\nEckhard Ludwig")
		)
))

;*********************************************

(onerror (CLEANUP))

; Cleanup any temporary mess we created
(procedure CLEANUP
    (delete "t:Background")
    (delete "t:Background.prefs")
    (delete "t:Logopic")
    (delete "t:Logopic.prefs")
)

(run "copy OpusMPEGA.ilbm TO T:Background")
(run "copy Background.prefs TO T:Background.prefs")
(run "copy PowerUp.ilbm TO T:Logopic")
(run "copy LogoPic.prefs TO T:Logopic.prefs")

(run "run InstallerFX t:background")
(run "wait 1")

;***************************************************************************

(if (< @installer-version (+ (* 43 65536) 3))
(
	(if (not (askbool
		(prompt #t_oldinstaller)
		(help #t_oldinstallerhelp)
	))
	(
		(abort (cat "\n\n" #t_oldinstallerhelp))
	))
))

;***************************************************************************

(message #intro1 "\n\n" #INFO)
(welcome)

;***************************************************************************
; check if Directory Opus 5 is already installed
;***************************************************************************

(if (not (exists (tackon #defaultdest "DirectoryOpus") (noreq)))
    ((message Opus5Message)
    (set Opus5path 
	(askdir
    	(prompt Opus5DirPrompt)
    	(help @askdir-help)
    	(default "Work:")
	))
    (if (not (exists (tackon Opus5path "DirectoryOpus") (noreq)))
       (abort Opus5Help)
	)    
    (makeassign "Dopus5" Opus5path (safe))
))

;***************************************************************************
; test Dopus5:Arexx & Modules exists & versionstest newer version
;***************************************************************************

(set #arexxdest (tackon #defaultdest "ARexx"))
(if (= @user-level 2)
  (if (not (exists #arexxdest (noreq)))
    (set #arexxdest (askdir
	(prompt ArexxDirPrompt)
	(help	@askdir-help)
	(default "Rexx:")
))))

(set #modulesdest (tackon #defaultdest "Modules"))
  (if (not (exists #modulesdest (noreq)))
    (exit (ModulesDirPrompt))
  )


(if (exists (tackon #modulesdest "OpusMPEGA.dopus5") (noreq))
   ((set version (getversion (tackon #modulesdest "OpusMPEGA.dopus5")))
   (if (> version (getversion "Modules/OpusMPEGA.dopus5"))
       (if (not (askbool 
       (prompt Deinstallprompt)
       (help @askbool-help)
       (default 0)))
          (exit (quiet)))
)))

(if (exists (tackon #arexxdest "Play-MPAudio.dopus5") (noreq))
   ((set version (getversion (tackon #arexxdest "Play-MPAudio.dopus5")))
   (if (> version (getversion "ARexx/Play-MPAudio.dopus5"))
       (if (not (askbool 
       (prompt Deinstallprompt)
       (help @askbool-help)
       (default 0)))
          (exit (quiet)))
)))

(if (> 	(getversion (tackon #defaultdest "DirectoryOpus")) 328279)
	(set #MAGELLAN 1)
	(set #MAGELLAN 0)
)

;***************************************************************************
; select formates
;***************************************************************************

(set #FILETYPE
   	(askoptions
   	(prompt FILEPrompt)
   	(help FILEHelp)
   	(choices "mp2 audio (layer-2)" "mp3 audio (layer-3)" "mp3 audio (wave)" "8SVX" "AIFF" "WAVE" "CDDA" "MAUD" "AU" "VOC")
   	(default 1023)
))

(set #Dir1 "Filetypes")
(if (>= @user-level 1)
	(
	(set #OldPlay (askchoice
		(prompt #Oldplayprompt)
		(help	#Oldplayhelp)
		(choices #PLAYSEL "Opus MPEGA")
		(default (not #MAGELLAN))
	))

	(if (= #OldPlay 1)
		(set #Dir1 "Storage")
	)
))

(set #APPICON
   	(askchoice
   	(prompt APPICONPrompt)
   	(help APPICONHelp)
   	(choices "Standard 4 colors" "MagicWB 8 colors" "NewIcons (see help)" "NewIcons + MagicWB")
   	(default 0)
))

;***************************************************************************
; delete older version
;***************************************************************************

(if (exists (tackon #arexxdest "PlayerMP2.dopus5") (noreq))
	(delete (tackon #arexxdest "PlayerMP2.dopus5")
		(prompt #Removeold)
		(help " ")
		(confirm "EXPERT")
		(optional "nofail" "askuser")
	)
)
(if (exists (tackon #arexxdest "PlayMP2.dopus5") (noreq))
	(delete (tackon #arexxdest "PlayMP2.dopus5")
   	(optional "force")
	)
)
(if (exists (tackon #arexxdest "PlayHifi.dopus5") (noreq))
	(delete (tackon #arexxdest "PlayHifi.dopus5")
   	(optional "force")
	)
)
(if (exists (tackon #arexxdest "PlayHifi_DT.dopus5") (noreq))
	(delete (tackon #arexxdest "PlayHifi_DT.dopus5")
   	(optional "force")
	)
)
(if (exists (tackon #defaultdest "Buttons/mpegplayer_default") (noreq))
	(delete (tackon #defaultdest "Buttons/mpegplayer_default")
   	(optional "force")
	)
)
(if (exists (tackon #defaultdest "docs/MPEGA-Player.guide") (noreq))
	(delete (tackon #defaultdest "docs/MPEGA-Player.guide")
   	(optional "force")
	)
)
(if (exists (tackon #defaultdest "docs/MPEGA-Player.guide.info") (noreq))
	(delete (tackon #defaultdest "docs/MPEGA-Player.guide.info")
   	(optional "force")
	)
)
(if (exists "SYS:Prefs/Player-setup" (noreq))
	(delete "SYS:Prefs/Player-setup"
   	(optional "force")
	)
)
(if (exists "SYS:Prefs/Player-setup.info" (noreq))
	(delete "SYS:Prefs/Player-setup.info"
   	(optional "force")
	)
)
(if (exists (tackon #defaultdest "Filetypes/Compressed sound, MPEG Layer2") (noreq))
	(delete (tackon #defaultdest "Filetypes/Compressed sound, MPEG Layer2")
   	(optional "force")
	)
)
(if (exists (tackon #defaultdest "Filetypes/Compressed sound, MPEG Layer3") (noreq))
	(delete (tackon #defaultdest "Filetypes/Compressed sound, MPEG Layer3")
   	(optional "force")
	)
)
(if (exists (tackon #defaultdest "Filetypes/Compressed sound, MPEG") (noreq))
	(delete (tackon #defaultdest "Filetypes/Compressed sound, MPEG")
   	(optional "force")
	)
)
(if (exists (tackon #defaultdest "Filetypes/Digitized sound, AIFF") (noreq))
	(delete (tackon #defaultdest "Filetypes/Digitized sound, AIFF")
   	(optional "force")
	)
)
(if (exists (tackon #defaultdest "Filetypes/Digitized sound, AU") (noreq))
	(delete (tackon #defaultdest "Filetypes/Digitized sound, AU")
   	(optional "force")
	)
)
(if (exists (tackon #defaultdest "Filetypes/Digitized sound, CDR") (noreq))
	(delete (tackon #defaultdest "Filetypes/Digitized sound, CDR")
   	(optional "force")
	)
)
(if (exists (tackon #defaultdest "Filetypes/Digitized sound, IFF 8SVX") (noreq))
	(delete (tackon #defaultdest "Filetypes/Digitized sound, IFF 8SVX")
   	(optional "force")
	)
)
(if (exists (tackon #defaultdest "Filetypes/Digitized sound, MAUD") (noreq))
	(delete (tackon #defaultdest "Filetypes/Digitized sound, MAUD")
   	(optional "force")
	)
)
(if (exists (tackon #defaultdest "Filetypes/Digitized sound, VOC") (noreq))
	(delete (tackon #defaultdest "Filetypes/Digitized sound, VOC")
   	(optional "force")
	)
)
(if (exists (tackon #defaultdest "Filetypes/Digitized sound, WAVE") (noreq))
	(delete (tackon #defaultdest "Filetypes/Digitized sound, WAVE")
   	(optional "force")
	)
)

;***************************************************************************
;install cataloge
;***************************************************************************

(IF (= #lng "All")
    	(set #Opt 511))

(set installchoice
   	(askoptions
   	(prompt InstallPrompt)
   	(help @askoptions-help)
   	(choices "Deutsch" "English" "dansk" "français" "italiano" "nederlands" "norsk" "suomi" "svenska")
   	(default #Opt)
))

(set n 0)

(while (<> n 1)

  ((set filepat
      	(select n "OpusMPEGA.catalog"))

   (set n (+ n 1))

(IF (BITAND installchoice 1)
  (copyfiles
   	(prompt LocaleCopyPrompt)
   	(help @copyfiles-help)
   	(source "Locale/Catalogs/deutsch")
   	(dest "SYS:Locale/Catalogs/deutsch")
   	(pattern filepat)
   	(confirm "EXPERT")
   	(optional "force" "askuser" "nofail")
  ))

(IF (OR (<> @language "deutsch") (BITAND installchoice 2))
  (copyfiles
   	(prompt LocaleCopyPrompt)
   	(help @copyfiles-help)
   	(source "Locale/Catalogs/english")
   	(dest "SYS:Locale/Catalogs/english")
   	(pattern filepat)
   	(confirm "EXPERT")
   	(optional "force" "askuser" "nofail")
  ))

(IF (BITAND installchoice 4)
  (copyfiles
   	(prompt LocaleCopyPrompt)
   	(help @copyfiles-help)
   	(source "Locale/Catalogs/dansk")
   	(dest "SYS:Locale/Catalogs/dansk")
   	(pattern filepat)
   	(confirm "EXPERT")
   	(optional "force" "askuser" "nofail")
  ))

(IF (BITAND installchoice 8)
  (copyfiles
   	(prompt LocaleCopyPrompt)
   	(help @copyfiles-help)
   	(source "Locale/Catalogs/français")
   	(dest "SYS:Locale/Catalogs/français")
   	(pattern filepat)
   	(confirm "EXPERT")
   	(optional "force" "askuser" "nofail")
  ))

(IF (BITAND installchoice 16)
  (copyfiles
   	(prompt LocaleCopyPrompt)
   	(help @copyfiles-help)
   	(source "Locale/Catalogs/italiano")
   	(dest "SYS:Locale/Catalogs/italiano")
   	(pattern filepat)
   	(confirm "EXPERT")
   	(optional "force" "askuser" "nofail")
  ))

(IF (BITAND installchoice 32)
  (copyfiles
   	(prompt LocaleCopyPrompt)
   	(help @copyfiles-help)
   	(source "Locale/Catalogs/nederlands")
   	(dest "SYS:Locale/Catalogs/nederlands")
   	(pattern filepat)
   	(confirm "EXPERT")
   	(optional "force" "askuser" "nofail")
  ))

(IF (BITAND installchoice 64)
  (copyfiles
   	(prompt LocaleCopyPrompt)
   	(help @copyfiles-help)
   	(source "Locale/Catalogs/norsk")
   	(dest "SYS:Locale/Catalogs/norsk")
   	(pattern filepat)
   	(confirm "EXPERT")
   	(optional "force" "askuser" "nofail")
  ))

(IF (BITAND installchoice 128)
  (copyfiles
   	(prompt LocaleCopyPrompt)
   	(help @copyfiles-help)
   	(source "Locale/Catalogs/suomi")
   	(dest "SYS:Locale/Catalogs/suomi")
   	(pattern filepat)
   	(confirm "EXPERT")
   	(optional "force" "askuser" "nofail")
  ))

(IF (BITAND installchoice 256)
  (copyfiles
   	(prompt LocaleCopyPrompt)
   	(help @copyfiles-help)
   	(source "Locale/Catalogs/svenska")
   	(dest "SYS:Locale/Catalogs/svenska")
   	(pattern filepat)
  	(confirm "EXPERT")
   	(optional "force" "askuser" "nofail")
  ))

))

(complete 15)

(IF (<> #lng "deutsch")
	(message
	(cat	"\n\nIf you want to create own versions of\n"
		"the catalogs please have a look at the\n"
		"distributions Locale directory. You will\n"
		"find the .cd files there. If you\n"
		"have created you own translations, please\n"
		"don`t keep it a secret"
	))
)

;***************************************************************************
; copy appicons
;***************************************************************************

(set APPICON 
	(select #APPICON 
		"Icons/OpusMPEGAAppIcon.info" 
		"Icons/OpusMPEGAAppIcon8.info" 
		"Icons/OpusMPEGAAppIconNI.info"
		"Icons/OpusMPEGAAppIcon8+NI.info"
	))
(copyfiles
   	(prompt IconsPrompt)
   	(help @copyfiles-help)
   	(source APPICON)
   	(dest (tackon #defaultdest "Icons"))
   	(optional "force" "askuser")
	(newname "OpusMPEGAAppIcon.info")
   	(confirm "EXPERT")
   	(files)
   	(infos)
)

(complete 20)

(copyfiles
   	(prompt IconsPrompt)
   	(help @copyfiles-help)
   	(source "Icons/FileTypes")
   	(dest (tackon #defaultdest "Icons/FileTypes"))
   	(optional "force" "askuser")
   	(confirm "EXPERT")
   	(pattern "#?")
   	(files)
   	(infos)
)

(complete 25)

;***************************************************************************
; copy the files
;***************************************************************************

(copyfiles
   	(prompt PlayerCopy1Prompt)
   	(help @copyfiles-help)
   	(source "Modules")
   	(dest #modulesdest)
   	(pattern "#?")
   	(confirm "EXPERT")
   	(optional "force" "askuser")
)

(complete 30)

(copyfiles
   	(prompt PlayerCopy2Prompt)
   	(help @copyfiles-help)
   	(source "ARexx")
   	(dest #arexxdest)
   	(pattern "#?")
   	(confirm "EXPERT")
   	(optional "force" "askuser")
)

(complete 35)

;***************************************************************************
; copy buttons
;***************************************************************************

(copyfiles
   	(prompt ButtonPrompt)
   	(help @copyfiles-help)
     	(source "buttons/OpusMPEGA_default")
     	(dest (tackon #defaultdest "Buttons"))
     	(optional "force" "askuser")
   	(confirm "EXPERT")
     	(files)
)
(copyfiles
   	(prompt ButtonPrompt)
   	(help @copyfiles-help)
     	(source "buttons/OpusMPEGA_text")
     	(dest (tackon #defaultdest "Buttons"))
     	(optional "force" "askuser")
   	(confirm "EXPERT")
     	(files)
)

(set #BUTTON (select #MAGELLAN "buttons/OpusMPEGA_image.V5_5" "buttons/OpusMPEGA_image"))
(copyfiles
   	(prompt ButtonPrompt)
   	(help @copyfiles-help)
     	(source #BUTTON)
     	(dest (tackon #defaultdest "Buttons"))
	(newname "OpusMPEGA_image")
     	(optional "force" "askuser")
   	(confirm "EXPERT")
     	(files)
)

(set #IMAGES (select #MAGELLAN "Images/OpusMPEGA.V5_5" "Images/OpusMPEGA.standard"))
(makedir (tackon #defaultdest "Images/OpusMPEGA.standard"))
(copyfiles
   	(prompt ButtonPrompt)
   	(help @copyfiles-help)
     	(source #IMAGES)
     	(dest (tackon #defaultdest "Images/OpusMPEGA.standard"))
     	(optional "force" "askuser")
   	(confirm "EXPERT")
     	(pattern "#?")
     	(files)
)

(complete 40)

;***************************************************************************
; copy filetypes
;***************************************************************************

(run "run InstallerFX t:Logopic")

(if (bitand #FILETYPE 1)
    (copyfiles
   	(prompt FiletypesPrompt)
   	(help @copyfiles-help)
   	(source (tackon #Dir1 "sample, mpeg layer-2"))
   	(dest (tackon #defaultdest "Filetypes"))
   	(optional "force" "askuser")
   	(confirm "EXPERT")
   	(files)
   	(infos)
    )
    (copyfiles
   	(prompt StoragesPrompt)
   	(help @copyfiles-help)
   	(source (tackon #Dir1 "sample, mpeg layer-2"))
   	(dest (tackon #defaultdest "Storage"))
   	(optional "force" "askuser")
   	(confirm "EXPERT")
   	(files)
   	(infos)
    )
)
(complete 41)

(if (bitand #FILETYPE 2)
    (copyfiles
   	(prompt FiletypesPrompt)
   	(help @copyfiles-help)
   	(source (tackon #Dir1 "sample, mpeg layer-3"))
   	(dest (tackon #defaultdest "Filetypes"))
   	(optional "force" "askuser")
   	(confirm "EXPERT")
   	(files)
   	(infos)
    )
    (copyfiles
   	(prompt StoragesPrompt)
   	(help @copyfiles-help)
   	(source (tackon #Dir1 "sample, mpeg layer-3"))
   	(dest (tackon #defaultdest "Storage"))
   	(optional "force" "askuser")
   	(confirm "EXPERT")
   	(files)
   	(infos)
    )
)
(complete 42)

(if (bitand #FILETYPE 4)
    (copyfiles
   	(prompt FiletypesPrompt)
   	(help @copyfiles-help)
   	(source (tackon #Dir1 "sample, wave mpeg layer-3"))
   	(dest (tackon #defaultdest "Filetypes"))
   	(optional "force" "askuser")
   	(confirm "EXPERT")
   	(files)
   	(infos)
    )
    (copyfiles
   	(prompt StoragesPrompt)
   	(help @copyfiles-help)
   	(source (tackon #Dir1 "sample, wave mpeg layer-3"))
   	(dest (tackon #defaultdest "Storage"))
   	(optional "force" "askuser")
   	(confirm "EXPERT")
   	(files)
   	(infos)
    )
)
(complete 43)
(if (bitand #FILETYPE 8)
    (copyfiles
   	(prompt FiletypesPrompt)
   	(help @copyfiles-help)
   	(source (tackon #Dir1 "sample, 8svx"))
   	(dest (tackon #defaultdest "Filetypes"))
   	(optional "force" "askuser")
   	(confirm "EXPERT")
   	(files)
   	(infos)
    )
    (copyfiles
   	(prompt StoragesPrompt)
   	(help @copyfiles-help)
   	(source (tackon #Dir1 "sample, 8svx"))
   	(dest (tackon #defaultdest "Storage"))
   	(optional "force" "askuser")
   	(confirm "EXPERT")
   	(files)
   	(infos)
    )
)
(complete 44)
(if (bitand #FILETYPE 16)
    (copyfiles
   	(prompt FiletypesPrompt)
   	(help @copyfiles-help)
   	(source (tackon #Dir1 "sample, aiff"))
   	(dest (tackon #defaultdest "Filetypes"))
   	(optional "force" "askuser")
   	(confirm "EXPERT")
   	(files)
   	(infos)
    )
    (copyfiles
   	(prompt StoragesPrompt)
   	(help @copyfiles-help)
   	(source (tackon #Dir1 "sample, aiff"))
   	(dest (tackon #defaultdest "Storage"))
   	(optional "force" "askuser")
   	(confirm "EXPERT")
   	(files)
   	(infos)
    )
)
(complete 45)
(if (bitand #FILETYPE 32)
    (copyfiles
   	(prompt FiletypesPrompt)
   	(help @copyfiles-help)
   	(source (tackon #Dir1 "sample, wave"))
   	(dest (tackon #defaultdest "Filetypes"))
   	(optional "force" "askuser")
   	(confirm "EXPERT")
   	(files)
   	(infos)
    )
    (copyfiles
   	(prompt StoragesPrompt)
   	(help @copyfiles-help)
   	(source (tackon #Dir1 "sample, wave"))
   	(dest (tackon #defaultdest "Storage"))
   	(optional "force" "askuser")
   	(confirm "EXPERT")
   	(files)
   	(infos)
    )
)
(complete 46)
(if (bitand #FILETYPE 64)
    (copyfiles
   	(prompt FiletypesPrompt)
   	(help @copyfiles-help)
   	(source (tackon #Dir1 "sample, cdda"))
   	(dest (tackon #defaultdest "Filetypes"))
   	(optional "force" "askuser")
   	(confirm "EXPERT")
   	(files)
   	(infos)
    )
    (copyfiles
   	(prompt StoragesPrompt)
   	(help @copyfiles-help)
   	(source (tackon #Dir1 "sample, cdda"))
   	(dest (tackon #defaultdest "Storage"))
   	(optional "force" "askuser")
   	(confirm "EXPERT")
   	(files)
   	(infos)
    )
)
(complete 47)
(if (bitand #FILETYPE 128)
    (copyfiles
   	(prompt FiletypesPrompt)
   	(help @copyfiles-help)
   	(source (tackon #Dir1 "sample, maud"))
   	(dest (tackon #defaultdest "Filetypes"))
   	(optional "force" "askuser")
   	(confirm "EXPERT")
   	(files)
   	(infos)
    )
    (copyfiles
   	(prompt StoragesPrompt)
   	(help @copyfiles-help)
   	(source (tackon #Dir1 "sample, maud"))
   	(dest (tackon #defaultdest "Storage"))
   	(optional "force" "askuser")
   	(confirm "EXPERT")
   	(files)
   	(infos)
    )
)
(complete 48)
(if (bitand #FILETYPE 256)
    (copyfiles
   	(prompt FiletypesPrompt)
   	(help @copyfiles-help)
   	(source (tackon #Dir1 "sample, au"))
   	(dest (tackon #defaultdest "Filetypes"))
   	(optional "force" "askuser")
   	(confirm "EXPERT")
   	(files)
   	(infos)
    )
    (copyfiles
   	(prompt StoragesPrompt)
   	(help @copyfiles-help)
   	(source (tackon #Dir1 "sample, au"))
   	(dest (tackon #defaultdest "Storage"))
   	(optional "force" "askuser")
   	(confirm "EXPERT")
   	(files)
   	(infos)
    )
)
(complete 49)
(if (bitand #FILETYPE 512)
    (copyfiles
   	(prompt FiletypesPrompt)
   	(help @copyfiles-help)
   	(source (tackon #Dir1 "sample, voc"))
   	(dest (tackon #defaultdest "Filetypes"))
   	(optional "force" "askuser")
   	(confirm "EXPERT")
   	(files)
   	(infos)
    )
    (copyfiles
   	(prompt StoragesPrompt)
   	(help @copyfiles-help)
   	(source (tackon #Dir1 "sample, voc"))
   	(dest (tackon #defaultdest "Storage"))
   	(optional "force" "askuser")
   	(confirm "EXPERT")
   	(files)
   	(infos)
    )
)
(complete 50)


;***************************************************************************
; copy cli-tools
;***************************************************************************

(copyfiles
   	(prompt ToolsCopyPrompt)
   	(help @copyfiles-help)
   	(source "c")
   	(dest "SYS:C")
   	(pattern "#?")
   	(optional "force" "askuser")
   	(confirm "EXPERT")
   	(files)
)

(complete 60)

;***************************************************************************
; ADD REXX TO USER-STARTUP
;***************************************************************************

(if
	(startup "ARexx"
		(prompt RexxPrompt)
		(help @startup-help)
		(command "SYS:System/RexxMast >NIL:")
	)
	(run "SYS:System/RexxMast >NIL:")
)

(complete 65)

;***************************************************************************
; set #guidedir
;***************************************************************************

(set #GuideDir (tackon #defaultdest "Help"))
(if (= @user-level 2)
	(
	(message GuidePrompt)
	(set #GuideDir (askdir
		(prompt GuidedirPrompt)
		(help	@askdir-help)
		(default (tackon #defaultdest "Help"))
	)
)))

(complete 70)

;***************************************************************************
; install guide
;***************************************************************************

(if (exists (tackon #GuideDir "OpusMPEGA.guide") (noreq))
	(delete (tackon #GuideDir "OpusMPEGA.guide")
		(prompt "\n\nDeleting old Guide")
		(help " ")
		(confirm "EXPERT")
		(optional "nofail" "askuser")
	)
)

(if (= #Opt 1)
    (set #SELGUIDE "Help/OpusMPEGA.Guide")
    (set #SELGUIDE "Help/OpusMPEGA.Guide.english")
    )
(copyfiles
	(prompt	GuideCopyPrompt)
	(help	@copyfiles-help)
        (source #SELGUIDE)
        (dest #GuideDir)
        (confirm "EXPERT")
	(newname "OpusMPEGA.guide")
        (optional "force" "askuser")
    	(files)
	(infos)
)

(complete 80)

;***************************************************************************
; set Prefsdir
;***************************************************************************

(set #PrefsDir "SYS:PREFS")
(if (= @user-level 2)
	(
	(message PrefsPrompt)
	(set #PrefsDir (askdir
		(prompt PrefsdirPrompt)
		(help	@askdir-help)
		(default "SYS:PREFS")
	)))
)

(complete 85)

(copyfiles
	(prompt	PrefsCopyPrompt)
	(help	@copyfiles-help)
        (source "Prefs")
        (dest 	#PrefsDir)
        (confirm "EXPERT")
 	(pattern "#?")
        (optional "force" "askuser")
    	(files)
	(infos)
)

(complete 95)

(if (<> 1 (exists "SYS:C/Installer" (noreq)))
 	(copyfiles
		(source "Installer")
        	(dest "SYS:C")
        	(optional "force" "askuser")
  	)
)

(complete 100)
(CLEANUP)
(exit #exitMsg (quiet))
