
(if (= @language "deutsch") (
  (set #destdir     "In welchem Verzeichnis soll Assampler installiert werden?\nEin Unterverzeichnis namens Assampler wird dort automatisch angelegt.")
  (set #wrongInst   "Achtung! Es ist eine alte Version des Programmes 'Installer' auf Ihrem Amiga!\nDie Installation benötigt mindestens Installer 42.9.\nBitte überprüfen Sie Ihre Konfiguration!")
  (set #wrongOS     "Sie scheinen eine Kickstart unter 3.0 benutzen. Unter diesen Bedingungen verweigert Assampler jegliche Zusammenarbeit. Sollten Sie sowieso aufrüsten wollen, legen Sie sich am besten Kickstart/Workbench 3.1 zu.\n")
  (set #wrongSubSys "Sie haben ein %s unter %s.\nAssampler braucht mindestens diese %s-Version.\n")
  (set #noSubSys    "Sie haben wohl noch nie was von %s gehört?\nAssampler braucht mindestens %s %s.\n")
  (set #skipSubSys  "Wenn Sie Assampler jetzt weiter installieren, wird es nicht funktionieren bis %s %s vorhanden ist.\n")
  (set #makeMainDir "Programm-Verzeichnis wird erstellt")
  (set #copyProg    "Kopiere Hauptprogramm, Dokumentation und Beispiele")
  (set #copyCat     "Kopiere Sprachanpassung %s")
  (set #askCat      "Welche Sprachanpassungen sollen installiert werden?")
  (set #copySynLib  "Kopiere synthesizer.library")
  (set #askSynLib   "Auf welchem Prozessortyp soll das Programm laufen?")
) (
  (set #destdir     "In which directory you want Assampler to be installed?\nA sub-directory called Assampler will be created there automagically.")
  (set #wrongInst   "You have an old version of the program 'Installer' on your Amiga!\nThe installation procedure needs at least Installer 42.9.\nPlease check your configuration!")
  (set #wrongOS     "It seems you use a Kickstart below 3.0. Under this circumstances Assampler is not willing to work with you. If you wanted to upgrade anyway, then upgrade immediately to Kickstart/Workbench 3.1 or OS3.5 (as soon as it is available).\n")
  (set #wrongSubSys "You use a %s version below %s.\nAssampler needs at least this version of %s.\n")
  (set #noSubSys    "I'm afraid you have never heard about %s, have you?\nAssampler needs at least %s %s.\n")
  (set #skipSubSys  "If you continue installation Assampler will not work until %s %s is installed, too.\n")
  (set #makeMainDir "Program directory will be created")
  (set #copyProg    "Copy main program, documentation and examples")
  (set #copyCat     "Copy string catalog %s")
  (set #askCat      "Which string catalogs shall be installed?")
  (set #copySynLib  "Copy synthesizer.library")
  (set #askSynLib   "On which processor configuration do you want to run the program?")
))

; We can't handle this script without Installer 42.9 or better!
(if (< @installer-version (+ (* 42 65536) 9))
  (
    ; Big problem!
    (message #wrongInst)
    (exit (quiet))
  )
)

(if (< (getversion) (* 39 65536))
   (message #wrongOS)
)

(procedure P_CheckSubSystem #sysInternalName #sysInternalVersion #sysName #sysVersion
   (if (exists (#sysInternalName))
      (
         (set muiver (getversion #sysInternalName))
         (if (< muiver #sysInternalVersion)
            (message (cat
               (#wrongSubSys   #sysName #sysVersion #sysName)
               (#skipSubSys    #sysName #sysVersion)
            ))
         )
      )
      (
         (message (cat
            (#noSubSys    #sysName #sysName #sysVersion)
            (#skipSubSys  #sysName #sysVersion)
         ))
      )
   )
)

(P_CheckSubSystem "Libs:muimaster.library" (+ (* 19 65536)  35) "MUI" "3.8")
(P_CheckSubSystem "Devs:ahi.device"        (+ (*  4 65536) 180) "AHI" "4.6")

(set @default-dest
   (tackon (expandpath 
      (askdir
         (prompt #destdir)
         (help @askdir-help)
         (default @default-dest)
      )
   ) "Assampler")
)

(makedir @default-dest
   (prompt #makeMainDir)
   (help @makedir-help)
   (infos)
)

(complete 25)
(copyfiles
   (prompt #copyProg)
   (help @copyfiles-help)
   (source "")
   (pattern "(Assampler#?|examples|help|mui|#?.ilbm)")
   (dest @default-dest)
   (infos)
   (confirm)
)

(complete 50)
(set #catalogs
   (askoptions
      (prompt #askCat)
      (help @askoptions-help)
      (choices "english" "deutsch")
      (default (+ 1 (= @language "deutsch")))
   )
)
(procedure P_CopyCatalog #catName
   (set #catDir (tackon "catalogs" #catName))
   (makedir (tackon @default-dest #catDir))
   (if (>= @user-level 2)
      (set #catPat "#?")
      (set #catPat "#?.catalog")
   )
   (copyfiles
      (prompt (#copyCat #catName))
      (help @copyfiles-help)
      (source #catDir)
      (pattern #catPat)
      (dest (tackon @default-dest #catDir))
      (infos)
      (confirm)
   )
)
(makedir (tackon @default-dest "catalogs"))
(if (in #catalogs 0)
   (P_CopyCatalog "english")
)
(if (in #catalogs 1)
   (P_CopyCatalog "deutsch")
)

(complete 75)
(select
   (askchoice
      (prompt #askSynLib)
      (help @askchoice-help)
      (choices "MC 68000" "MC 68020 + MC 68882")
      (default (not (patmatch "NOFPU" (database "fpu"))))
   )
   (set #synLibName "68000")
   (set #synLibName "68882")
)
(copylib
   (prompt #copySynLib)
   (help @copylib-help)
   (source ("libs/synthesizer%s.library" #synLibName))
   (dest "LIBS:")
   (newname "synthesizer.library")
   (confirm)
)

(complete 100)

