; This is the ScanQuix5 install script
; $VER: install_script 3.3 (03.02.01) © by Andreas Günther

(transcript "ScanQuix installation:")
(complete 0)

(set ver1 "LIBS:gtlayout.library      version 44 revision 1")
(set ver2 "LIBS:AGlibs/AGgfx.library  version  3 revision 1")
(set ver3 "LIBS:AGlibs/AGgui.library  version  4 revision 0")
(set ver4 "LIBS:AGlibs/AGsys.library  version  3 revision 0")
(set ver5 "LIBS:AGlibs/AGio.library   version  2 revision 1")
(set ver6 "LIBS:AGlibs/AGfile.library version  2 revision 0")
(set ver7 "DEVS:scanner.device        version  3 revision 1")


(if (patmatch @language "deutsch")
  (set deutsch 1)
  (set deutsch 0)
)

(if deutsch   (set t_welche_op "\n\n\n\nBitte wählen Sie, welche Aktion durchgeführt werden soll:")
              (set t_welche_op "\n\n\n\nWhat Operation do you want to perform ?")
)
(if deutsch   (set t_welcheop_help "\"ScanQuix5 installieren\" installiert die ScanQuix5 Software.\n\"Installation entfernen\" löscht die gesamte ScanQuix-Installation von Ihrer Festplatte.")
              (set t_welcheop_help "By choosing \"Install ScanQuix5\", you can install ScanQuix5 and the scanner driver(s) on your computer.\nWith the choice \"Remove Installation\", an existing installation of ScanQuix and the scanner drivers can be entirely removed from your System.")
)
(if deutsch   (set t_welcheop_1 "ScanQuix5 installieren")
              (set t_welcheop_1 "Install ScanQuix5")
)
(if deutsch   (set t_welcheop_0 "Installation entfernen")
              (set t_welcheop_0 "Remove ScanQuix")
)
(if deutsch   (set t_woanlegen "Wo soll die ScanQuix5 Schublade eingerichtet werden ?")
              (set t_woanlegen "Where do you want the \"ScanQuix5\" drawer to be created ?")
)
(if deutsch   (set t_copying_sq "\n\n\nScanQuix5 wird kopiert...")
              (set t_copying_sq "\n\n\nCopying ScanQuix5...")
)
(if deutsch   (set t_copying_gtlib "\n\n\nDie gtlayout.library wird kopiert...")
              (set t_copying_gtlib "\n\n\nCopying gtlayout.library...")
)
(if deutsch   (set t_copying_aglibs "\n\n\nDie AG-libraries werden kopiert...")
              (set t_copying_aglibs "\n\n\nCopying AG-libraries...")
)
(if deutsch   (set t_copying_device "\n\n\nDas scanner.device wird kopiert...")
              (set t_copying_device "\n\n\nCopying scanner.device...")
)
(if deutsch   (set t_copying_driver "\n\n\nDie Scanner-Treiber werden kopiert...")
              (set t_copying_driver "\n\n\nCopying scanner driver(s)...")
)
(if deutsch   (set t_copying_cat_d "\n\n\nDie deutschen Programmtexte werden kopiert...")
              (set t_copying_cat_d "\n\n\nCopying german catalog files...")
)
(if deutsch   (set t_askloader "Welche Lademodule sollen installiert werden ?")
              (set t_askloader "Which loaders do you want to be installed ?")
)
(if deutsch   (set t_copying_GIO "\n\n\nDas Lademodul für Photogenics wird kopiert...")
              (set t_copying_GIO "\n\n\nCopying Photogenics loader...")
)
(if deutsch   (set t_copying_IFX "\n\n\nDas Scannermodule für ImageFX  wird kopiert...")
              (set t_copying_IFX "\n\n\nCopying ImageFX scanner module...")
)
(if deutsch   (set t_copying_ADPRO "\n\n\nDas Scannermodule für ADPro  wird kopiert...")
              (set t_copying_ADPRO "\n\n\nCopying ADPro scanner module...")
)
(if deutsch   (set t_copying_PGS "\n\n\nDas Scannermodule für PageStream 3 wird kopiert...")
              (set t_copying_PGS "\n\n\nCopying PageStream 3 scanner module...")
)
(if deutsch   (set t_copying_DPV "\n\n\nDas Scannermodule für Deluxe Paint V wird kopiert...")
              (set t_copying_DPV "\n\n\nCopying Deluxe Paint V scanner module...")
)
(if deutsch   (set t_copying_PPaint "\n\n\nDas Eingabemodul für PersonalPaint wird kopiert...")
              (set t_copying_PPaint "\n\n\nCopying loader for PersonalPaint...")
)
(if deutsch   (set t_wirklich_loeschen "\n\n\n\nMöchten Sie wirklich die gesamte ScanQuix Installation\nentfernen ?\n\nAlle Einstellungen werden dabei gelöscht !\nALLE BILDER im ScanQuix5-Verzeichnis WERDEN UNWIEDERBRINGLICH GELÖSCHT !\n\nDateien, die möglicherweise von anderen Programmen benötigt werden, bleiben erhalten.")
              (set t_wirklich_loeschen "\n\n\n\nDo you really want to remove your ScanQuix installation ?\n\nAll settings will be lost !\nALL IMAGES in the ScanQuix5 drawer ARE DELETED !\n\nFiles which might be required by other software are not deleted.")
)
(if deutsch   (set t_loeschen_help "Sie könenn die Scannertreiber jederzeit neu installieren, allerdings sind die Einstellungen verloren !")
              (set t_loeschen_help "You can reinstall your scanner drivers at any time, but you will loose the current settings !")
)
(if deutsch   (set t_loesche_sq "Die ScanQuix Installation wird gelöscht.")
              (set t_loesche_sq "Deleting the ScanQuix installation.")
)
(if deutsch   (set t_makedir "Verzeichnis wird erstellt...")
              (set t_makedir "Creating directory...")
)
(if deutsch   (set t_save_dest "Pfad des ScanQuix5-Verzeichnisses wird gespeichert...")
              (set t_save_dest "Saving path of ScanQuix5 drawer...")
)
(if deutsch   (set t_savedesthelp "Der Pfad wird im ENV: Verzeichnis gespeichert, um die ScanQuix-Installation ggf. vollständig entfernen zu können.")
              (set t_savedesthelp "The Path is saved to the ENV: directory. This is important to uninstall the ScanQuix software.")
)
(if deutsch   (set t_askprocessor "Für welche Prozessoren soll die Software installiert werden ?")
              (set t_askprocessor "For which CPUs do you want to install the software ?")
)
(if deutsch   (set t_askproc_help "Für einige Teile der Software gibt es speziell optimierte Versionen für unterschiedliche Prozessoren. Sie können hier angeben, für welchen Prozessor die passende Software installiert werden soll. Wenn Sie nicht wissen, welchen Prozessortyp Ihr Amiga benutzt oder wenn Sie in Zukunft andere Prozessoren benutzen werden, wählen Sie einfach alle Optionen aus.")
              (set t_askproc_help "There are optimized for different CPU of some parts of the software. You can select the CPU(s) for which the software should be installed. If you do not know the CPU of your Amiga or if you intend to use other CPUs in the future, select all options.")
)
(if deutsch   (set t_askscanner "Für welche Scannertypen sollen Treiber installiert werden ?")
              (set t_askscanner "For which scanner models would you like to install drivers ?")
)
(if deutsch   (set t_askartec "Für welche Artec-Scanner sollen Treiber installiert werden ?")
              (set t_askartec "For which Artec scanners do you want to install drivers ?")
)
(if deutsch   (set t_askcanon "Für welche Canon-Scanner sollen Treiber installiert werden ?")
              (set t_askcanon "For which Canon scanners do you want to install drivers ?")
)
(if deutsch   (set t_askparagon "Für welche Paragon-Scanner sollen Treiber installiert werden ?")
              (set t_askparagon "For which Paragon scanners do you want to install drivers ?")
)
(if deutsch   (set t_askscanex "Für welche ScanExpress-Scanner sollen Treiber installiert werden ?")
              (set t_askscanex "For which ScanExpress scanners do you want to install drivers ?")
)
(if deutsch   (set t_askumax "Für welchen UMAX-Scanner sollen Treiber installiert werden ?")
              (set t_askumax "For which UMAX scanners do you want to install drivers ?")
)
(if deutsch   (set t_asksernum "\n\nGeben Sie bitte hier Ihre persönliche ScanQuix-Seriennummer ein:")
              (set t_asksernum "\n\nPlease enter your personal ScanQuix serial number:")
)
(if deutsch   (set t_helpsernum "Sie finden die Seriennummer in der ScanQuix CD-Hülle. Sollte Ihr Exemplar von ScanQuix keine Seriennummer enthalten, wenden Sie sich bitte an Vesalia Computer, Tel. 02852/9140-10, E-Mail: support@vesalia.de")
              (set t_helpsernum "You can find the serial number inside of the ScanQuix CD cover. If your copy of ScanQuix does not have a serial number, please contact Vesalia Computer for help: Phone: +49/2852/9140-10, email: support@vesalia.de")
)
(if deutsch   (set t_askname "\nBitte geben Sie Ihren Namen für die Registrierung ein:")
              (set t_askname "\nPlease enter your name to register ScanQuix:")
)
(if deutsch   (set t_register "\nWenn Sie auf \"Weiter\" klicken, wird die Registrierung durchgeführt.\n\nDieser Vorgang kann einige Minuten dauern.")
              (set t_register "\nThe registration is performed when you click on \"Proceed\".\n\nThis may take some minutes.")
)
(if deutsch   (set t_sernum_falsch "\nEs ist ein Problem bei der Registrierung aufgetreten. Bitte geben Sie die richtige Seriennummer ein, um die Installation abzuschließen.")
              (set t_sernum_falsch "\nA problem occured with the registration process. Please enter the correct serial number to complete the installation.")
)
(if deutsch   (set t_anleitung_installieren "\nSoll die Anleitung (im HTML-Format) in das ScanQuix-Verzeichnis kopiert werden ?")
              (set t_anleitung_installieren "\nDo you want to copy the manual (in HTML format) into the ScanQuix drawer ?")
)
(if deutsch   (set t_browser_installieren "\nSoll das Anzeigeprogramm (HTML-Browser) für die Anleitung installiert werden ?")
              (set t_browser_installieren "\nDow you want to install the viewer (HTML browser) for the manual ?")
)
(if deutsch   (set t_help_browser "Als Anzeigeprogramm wird eine Spezialversion des HTML-Browsers \"AWeb\" installiert.\n\nWenn Sie lieber einen anderen HTML-Browser benutzen möchten, antworten Sie mit \"Nein\". Es wird dann nur die Anleitung installiert.")
              (set t_help_browser "A special version of the HTML browser \"AWeb\" will be installed. If you prefer to use another HTML browser, answer \"No\". In this case, only the manual itself will be installed.")
)
(if deutsch   (set t_copying_browser "\n\n\nDer HTML-Browser (AWeb) wird installiert...")
              (set t_copying_browser "\n\n\nInstalling the HTML browser (AWeb)...")
)
(if deutsch   (set t_copying_anl "\n\n\nDie Anleitung wird kopiert...")
              (set t_copying_anl "\n\n\nCopying the manual...")
)
;(if deutsch   (set t_ "")
;              (set t_ "")
;)


(set install_sq
  (askbool
    (prompt t_welche_op)
    (help t_welcheop_help)
    (choices t_welcheop_1 t_welcheop_0)
    (default 1)
  )
)

(complete 3)

(if install_sq
 (
  (if (exists "ENV:ScanQuix/Path")
   (set @default-dest (getenv "ScanQuix/Path"))
  )

  (set sq_path
    (askdir
      (prompt t_woanlegen)
      (help @askdir-help)
      (default @default-dest)
    )
  )

  (set @default-dest sq_path)

  (if (NOT (exists "T:"))
    (run "assign T: RAM:")
  )

  (complete 8)

  (copyfiles
    (prompt t_copying_sq)
    (help @copyfiles-help)
    (source "ScanQuix/ScanQuix5")
    (dest (tackon sq_path "ScanQuix5"))
    (all)
    (infos)
    (confirm)
  )

  (if deutsch
    (makedir (tackon sq_path "ScanQuix5/Bilder") 
      (prompt t_makedir)
      (help @makedir-help)
      (infos)
    )
    (makedir (tackon sq_path "ScanQuix5/Pictures")
      (prompt t_makedir)
      (help @makedir-help)
      (infos)
    )
  )

  (if (<= 5 (run (cat "version >NIL: " ver1)))
    (copyfiles
      (prompt t_copying_gtlib)
      (help @copyfiles-help)
      (source "ScanQuix/Libs/gtlayout.library")
      (dest "LIBS:")
      (confirm)
    )
  )

  (complete 20)

  (set processor (askoptions
    (prompt t_askprocessor)
    (help t_askproc_help)
    (choices "68020" "68030" "68040" "68060" "PowerPC")
    (default -1)
  ))

  (set procpat "(|")
  (if (in processor 0)  (set procpat (cat procpat "_68020|")))
  (if (in processor 1)  (set procpat (cat procpat "_68030|")))
  (if (in processor 2)  (set procpat (cat procpat "_68040|")))
  (if (in processor 3)  (set procpat (cat procpat "_68060|")))
  (set procpat (cat procpat ")"))

  (if (<= 5 (run (cat "version >NIL: " ver2)))
    (
      (copyfiles
        (prompt t_copying_aglibs)
        (help @copyfiles-help)
        (source "ScanQuix/Libs/AGlibs")
        (pattern (cat "AGgfx" procpat ".library"))
        (dest "LIBS:AGlibs")
        (confirm)
      )
      (if (in processor 4)
        (copyfiles
          (prompt t_copying_aglibs)
          (help @copyfiles-help)
          (source "ScanQuix/Libs/AGlibs/AGgfx_PPC.library")
          (dest "LIBS:AGlibs")
          (confirm)
        )
      )
    )
    ; else
    (
      (if (AND (in processor 0) (NOT (exists "LIBS:AGlibs/AGgfx_68020.library")))
        (copyfiles (source "ScanQuix/Libs/AGlibs/AGgfx_68020.library") (dest "LIBS:AGlibs") (prompt t_copying_aglibs) (help @copyfiles-help))
      )
      (if (AND (in processor 1) (NOT (exists "LIBS:AGlibs/AGgfx_68030.library")))
        (copyfiles (source "ScanQuix/Libs/AGlibs/AGgfx_68030.library") (dest "LIBS:AGlibs") (prompt t_copying_aglibs) (help @copyfiles-help))
      )
      (if (AND (in processor 2) (NOT (exists "LIBS:AGlibs/AGgfx_68040.library")))
        (copyfiles (source "ScanQuix/Libs/AGlibs/AGgfx_68040.library") (dest "LIBS:AGlibs") (prompt t_copying_aglibs) (help @copyfiles-help))
      )
      (if (AND (in processor 3) (NOT (exists "LIBS:AGlibs/AGgfx_68060.library")))
        (copyfiles (source "ScanQuix/Libs/AGlibs/AGgfx_68060.library") (dest "LIBS:AGlibs") (prompt t_copying_aglibs) (help @copyfiles-help))
      )
      (if (AND (in processor 4) (NOT (exists "LIBS:AGlibs/AGgfx_PPC.library")))
        (copyfiles (source "ScanQuix/Libs/AGlibs/AGgfx_PPC.library") (dest "LIBS:AGlibs") (prompt t_copying_aglibs) (help @copyfiles-help))
      )
    )
  )

  (complete 25)

  (if (<= 5 (run (cat "version >NIL: " ver3)))
    (copyfiles
      (prompt t_copying_aglibs)
      (help @copyfiles-help)
      (source "ScanQuix/Libs/AGlibs")
      (pattern (cat "AGgui" procpat ".library"))
      (dest "LIBS:AGlibs")
      (confirm)
    )
    ; else
    (
      (if (AND (in processor 0) (NOT (exists "LIBS:AGlibs/AGgui_68020.library")))
        (copyfiles (source "ScanQuix/Libs/AGlibs/AGgui_68020.library") (dest "LIBS:AGlibs") (prompt t_copying_aglibs) (help @copyfiles-help))
      )
      (if (AND (in processor 1) (NOT (exists "LIBS:AGlibs/AGgui_68030.library")))
        (copyfiles (source "ScanQuix/Libs/AGlibs/AGgui_68030.library") (dest "LIBS:AGlibs") (prompt t_copying_aglibs) (help @copyfiles-help))
      )
      (if (AND (in processor 2) (NOT (exists "LIBS:AGlibs/AGgui_68040.library")))
        (copyfiles (source "ScanQuix/Libs/AGlibs/AGgui_68040.library") (dest "LIBS:AGlibs") (prompt t_copying_aglibs) (help @copyfiles-help))
      )
      (if (AND (in processor 3) (NOT (exists "LIBS:AGlibs/AGgui_68060.library")))
        (copyfiles (source "ScanQuix/Libs/AGlibs/AGgui_68060.library") (dest "LIBS:AGlibs") (prompt t_copying_aglibs) (help @copyfiles-help))
      )
    )
  )

  (complete 30)

  (if (<= 5 (run (cat "version >NIL: " ver6)))
    (copyfiles
      (prompt t_copying_aglibs)
      (help @copyfiles-help)
      (source "ScanQuix/Libs/AGlibs")
      (pattern (cat "AGfile" procpat ".library"))
      (dest "LIBS:AGlibs")
      (confirm)
    )
    ; else
    (
      (if (AND (in processor 0) (NOT (exists "LIBS:AGlibs/AGfile_68020.library")))
        (copyfiles (source "ScanQuix/Libs/AGlibs/AGfile_68020.library") (dest "LIBS:AGlibs") (prompt t_copying_aglibs) (help @copyfiles-help))
      )
      (if (AND (in processor 1) (NOT (exists "LIBS:AGlibs/AGfile_68030.library")))
        (copyfiles (source "ScanQuix/Libs/AGlibs/AGfile_68030.library") (dest "LIBS:AGlibs") (prompt t_copying_aglibs) (help @copyfiles-help))
      )
      (if (AND (in processor 2) (NOT (exists "LIBS:AGlibs/AGfile_68040.library")))
        (copyfiles (source "ScanQuix/Libs/AGlibs/AGfile_68040.library") (dest "LIBS:AGlibs") (prompt t_copying_aglibs) (help @copyfiles-help))
      )
      (if (AND (in processor 3) (NOT (exists "LIBS:AGlibs/AGfile_68060.library")))
        (copyfiles (source "ScanQuix/Libs/AGlibs/AGfile_68060.library") (dest "LIBS:AGlibs") (prompt t_copying_aglibs) (help @copyfiles-help))
      )
    )
  )

  (if (<= 5 (run (cat "version >NIL: " ver4)))
    (copyfiles
      (prompt t_copying_aglibs)
      (help @copyfiles-help)
      (source "ScanQuix/Libs/AGlibs/AGsys.library")
      (dest "LIBS:AGlibs")
      (confirm)
    )
  )

  (if (<= 5 (run (cat "version >NIL: " ver5)))
    (copyfiles
      (prompt t_copying_aglibs)
      (help @copyfiles-help)
      (source "ScanQuix/Libs/AGlibs/AGio.library")
      (dest "LIBS:AGlibs")
      (confirm)
    )
  )


  (if (exists "LOCALE:Catalogs/deutsch" (noreq))
    (copyfiles
      (prompt t_copying_cat_d)
      (help @copyfiles-help)
      (source "ScanQuix/Catalogs/deutsch/")
      (pattern "(ScanQuix|AGlibs|scannerdevice.catalog)")
      (dest "LOCALE:Catalogs/deutsch")
      (confirm)
    )
  )

  (complete 35)


; Scannertreiber
; --------------

  (set scanner (askoptions
    (prompt t_askscanner)
    (help @askoptions-help)
    (choices "Artec" "Canon" "Epson" "HP ScanJet" "Mustek Paragon" "Mustek ScanExpress" "UMAX")
    (default -1)
  ))
  (if (in scanner 0)
    (
      (set model (askoptions
        (prompt t_askartec)
        (help @askoptions-help)
        (choices "Viewstation A6000C (3-Pass)" "Viewstation A6000C Plus" "AT-3, AT-6, AT-12" "AM-12S")
        (default -1)
      ))
      (if (in model 0)  (copyfiles (source "ScanQuix/Drivers/Artec_A6000_SQ5") (prompt t_copying_driver) (help @copyfiles-help) (dest "DEVS:Scanners")) )
      (if (in model 1)  (copyfiles (source "ScanQuix/Drivers/Artec_A6000Plus_SQ5") (prompt t_copying_driver) (help @copyfiles-help) (dest "DEVS:Scanners")) )
      (if (in model 2)  (copyfiles (source "ScanQuix/Drivers/Artec_AT_SQ5") (prompt t_copying_driver) (help @copyfiles-help) (dest "DEVS:Scanners")) )
      (if (in model 3)  (copyfiles (source "ScanQuix/Drivers/Artec_AM_12S_SQ5") (prompt t_copying_driver) (help @copyfiles-help) (dest "DEVS:Scanners")) )
      (if (exists "LOCALE:Catalogs/deutsch" (noreq))
        (
          (if (in model 0)  (copyfiles (source "ScanQuix/Catalogs/deutsch/Scanners/Artec_A6000.catalog") (prompt t_copying_cat_d) (help @copyfiles-help) (dest "LOCALE:Catalogs/deutsch/Scanners")) )
          (if (in model 1)  (copyfiles (source "ScanQuix/Catalogs/deutsch/Scanners/Artec_A6000Plus.catalog") (prompt t_copying_cat_d) (help @copyfiles-help) (dest "LOCALE:Catalogs/deutsch/Scanners")) )
          (if (in model 2)  (copyfiles (source "ScanQuix/Catalogs/deutsch/Scanners/Artec_AT.catalog") (prompt t_copying_cat_d) (help @copyfiles-help) (dest "LOCALE:Catalogs/deutsch/Scanners")) )
          (if (in model 3)  (copyfiles (source "ScanQuix/Catalogs/deutsch/Scanners/Artec_AM_12S.catalog") (prompt t_copying_cat_d) (help @copyfiles-help) (dest "LOCALE:Catalogs/deutsch/Scanners")) )
        )
      )
    )
  )
  (if (in scanner 1)
    (
      (set model (askoptions
        (prompt t_askcanon)
        (help @askoptions-help)
        (choices "CanoScan 2700F" "CanoScan FS2710")
        (default -1)
      ))
      (if (in model 0)  (copyfiles (source "ScanQuix/Drivers/CanoScan_2700F_SQ5") (prompt t_copying_driver) (help @copyfiles-help) (dest "DEVS:Scanners")) )
      (if (in model 1)  (copyfiles (source "ScanQuix/Drivers/CanoScan_FS2710_SQ5") (prompt t_copying_driver) (help @copyfiles-help) (dest "DEVS:Scanners")) )
      (if (exists "LOCALE:Catalogs/deutsch" (noreq))
        (
          (if (in model 0)  (copyfiles (source "ScanQuix/Catalogs/deutsch/Scanners/CanoScan_2700F.catalog") (prompt t_copying_cat_d) (help @copyfiles-help) (dest "LOCALE:Catalogs/deutsch/Scanners")) )
          (if (in model 1)  (copyfiles (source "ScanQuix/Catalogs/deutsch/Scanners/CanoScan_FS2710.catalog") (prompt t_copying_cat_d) (help @copyfiles-help) (dest "LOCALE:Catalogs/deutsch/Scanners")) )
        )
      )
    )
  )
  (if (in scanner 2)  (copyfiles (source "ScanQuix/Drivers/Epson_GT_SQ5") (prompt t_copying_driver) (help @copyfiles-help) (dest "DEVS:Scanners")) )
  (if (in scanner 3)  (copyfiles (source "ScanQuix/Drivers/HP_ScanJet_SQ5") (prompt t_copying_driver) (help @copyfiles-help) (dest "DEVS:Scanners")) )
  (complete 40)
  (if (in scanner 4)
    (
      (set model (askoptions
        (prompt t_askparagon)
        (help @askoptions-help)
        (choices " 600" "1200" " 600 SP" " 800 SP" "1200 SP" " 600 II SP" " 800 II SP")
        (default -1)
      ))
      (if (in model 0)  (copyfiles (source "ScanQuix/Drivers/Paragon_600_SQ5") (prompt t_copying_driver) (help @copyfiles-help) (dest "DEVS:Scanners")) )
      (if (in model 1)  (copyfiles (source "ScanQuix/Drivers/Paragon_1200_SQ5") (prompt t_copying_driver) (help @copyfiles-help) (dest "DEVS:Scanners")) )
      (if (in model 2)  (copyfiles (source "ScanQuix/Drivers/Paragon_600SP_SQ5") (prompt t_copying_driver) (help @copyfiles-help) (dest "DEVS:Scanners")) )
      (if (in model 3)  (copyfiles (source "ScanQuix/Drivers/Paragon_800SP_SQ5") (prompt t_copying_driver) (help @copyfiles-help) (dest "DEVS:Scanners")) )
      (if (in model 4)  (copyfiles (source "ScanQuix/Drivers/Paragon_1200SP_SQ5") (prompt t_copying_driver) (help @copyfiles-help) (dest "DEVS:Scanners")) )
      (if (in model 5)  (copyfiles (source "ScanQuix/Drivers/Paragon_600IISP_SQ5") (prompt t_copying_driver) (help @copyfiles-help) (dest "DEVS:Scanners")) )
      (if (in model 6)  (copyfiles (source "ScanQuix/Drivers/Paragon_800IISP_SQ5") (prompt t_copying_driver) (help @copyfiles-help) (dest "DEVS:Scanners")) )
      (if (exists "LOCALE:Catalogs/deutsch" (noreq))
        (
          (if (in model 0)  (copyfiles (source "ScanQuix/Catalogs/deutsch/Scanners/Paragon_600.catalog") (prompt t_copying_cat_d) (help @copyfiles-help) (dest "LOCALE:Catalogs/deutsch/Scanners")) )
          (if (in model 1)  (copyfiles (source "ScanQuix/Catalogs/deutsch/Scanners/Paragon_1200.catalog") (prompt t_copying_cat_d) (help @copyfiles-help) (dest "LOCALE:Catalogs/deutsch/Scanners")) )
          (if (in model 2)  (copyfiles (source "ScanQuix/Catalogs/deutsch/Scanners/Paragon_600SP.catalog") (prompt t_copying_cat_d) (help @copyfiles-help) (dest "LOCALE:Catalogs/deutsch/Scanners")) )
          (if (in model 3)  (copyfiles (source "ScanQuix/Catalogs/deutsch/Scanners/Paragon_800SP.catalog") (prompt t_copying_cat_d) (help @copyfiles-help) (dest "LOCALE:Catalogs/deutsch/Scanners")) )
          (if (in model 4)  (copyfiles (source "ScanQuix/Catalogs/deutsch/Scanners/Paragon_1200SP.catalog") (prompt t_copying_cat_d) (help @copyfiles-help) (dest "LOCALE:Catalogs/deutsch/Scanners")) )
          (if (in model 5)  (copyfiles (source "ScanQuix/Catalogs/deutsch/Scanners/Paragon_600IISP.catalog") (prompt t_copying_cat_d) (help @copyfiles-help) (dest "LOCALE:Catalogs/deutsch/Scanners")) )
          (if (in model 6)  (copyfiles (source "ScanQuix/Catalogs/deutsch/Scanners/Paragon_800IISP.catalog") (prompt t_copying_cat_d) (help @copyfiles-help) (dest "LOCALE:Catalogs/deutsch/Scanners")) )
        )
      )
    )
  )
  (complete 45)
  (if (in scanner 5)
    (
      (set model (askoptions
        (prompt t_askscanex)
        (help @askoptions-help)
        (choices "600 CP (Parallel)" "1200 CP (Parallel)" "6000 SP (SCSI)" "12000 SP (SCSI)")
       (default -1)
      ))
      (if (in model 0)  (copyfiles (source "ScanQuix/Drivers/ScanExpress_600CP_SQ5") (prompt t_copying_driver) (help @copyfiles-help) (dest "DEVS:Scanners")) )
      (if (in model 1)  (copyfiles (source "ScanQuix/Drivers/ScanExpress_1200CP_SQ5") (prompt t_copying_driver) (help @copyfiles-help) (dest "DEVS:Scanners")) )
      (if (in model 2)  (copyfiles (source "ScanQuix/Drivers/ScanExpress_6000SP_SQ5") (prompt t_copying_driver) (help @copyfiles-help) (dest "DEVS:Scanners")) )
      (if (in model 3)  (copyfiles (source "ScanQuix/Drivers/ScanExpress_12000SP_SQ5") (prompt t_copying_driver) (help @copyfiles-help) (dest "DEVS:Scanners")) )
      (if (exists "LOCALE:Catalogs/deutsch" (noreq))
        (
          (if (in model 0)  (copyfiles (source "ScanQuix/Catalogs/deutsch/Scanners/ScanExpress_600CP.catalog") (prompt t_copying_cat_d) (help @copyfiles-help) (dest "LOCALE:Catalogs/deutsch/Scanners")) )
          (if (in model 1)  (copyfiles (source "ScanQuix/Catalogs/deutsch/Scanners/ScanExpress_1200CP.catalog") (prompt t_copying_cat_d) (help @copyfiles-help) (dest "LOCALE:Catalogs/deutsch/Scanners")) )
          (if (in model 2)  (copyfiles (source "ScanQuix/Catalogs/deutsch/Scanners/ScanExpress_6000SP.catalog") (prompt t_copying_cat_d) (help @copyfiles-help) (dest "LOCALE:Catalogs/deutsch/Scanners")) )
          (if (in model 3)  (copyfiles (source "ScanQuix/Catalogs/deutsch/Scanners/ScanExpress_12000SP.catalog") (prompt t_copying_cat_d) (help @copyfiles-help) (dest "LOCALE:Catalogs/deutsch/Scanners")) )
        )
      )
    )
  )
  (complete 50)
  (if (in scanner 6)
    (
      (set model (askoptions
        (prompt t_askumax)
        (help @askoptions-help)
        (choices "Astra 610 S" "Astra 1200 S" "Astra 1220 S" "Astra 2400 S" "PowerLook II")
       (default -1)
      ))
      (if (in model 0)  (copyfiles (source "ScanQuix/Drivers/UMAX_Astra_610S_SQ5") (prompt t_copying_driver) (help @copyfiles-help) (dest "DEVS:Scanners")) )
      (if (in model 1)  (copyfiles (source "ScanQuix/Drivers/UMAX_Astra_1200S_SQ5") (prompt t_copying_driver) (help @copyfiles-help) (dest "DEVS:Scanners")) )
      (if (in model 2)  (copyfiles (source "ScanQuix/Drivers/UMAX_Astra_1220S_SQ5") (prompt t_copying_driver) (help @copyfiles-help) (dest "DEVS:Scanners")) )
      (if (in model 3)  (copyfiles (source "ScanQuix/Drivers/UMAX_Astra_2400S_SQ5") (prompt t_copying_driver) (help @copyfiles-help) (dest "DEVS:Scanners")) )
      (if (in model 4)  (copyfiles (source "ScanQuix/Drivers/UMAX_PowerLook_II_SQ5") (prompt t_copying_driver) (help @copyfiles-help) (dest "DEVS:Scanners")) )
      (if (exists "LOCALE:Catalogs/deutsch" (noreq))
        (
          (if (in model 0)  (copyfiles (source "ScanQuix/Catalogs/deutsch/Scanners/UMAX_Astra_610S.catalog") (prompt t_copying_cat_d) (help @copyfiles-help) (dest "LOCALE:Catalogs/deutsch/Scanners")) )
          (if (in model 1)  (copyfiles (source "ScanQuix/Catalogs/deutsch/Scanners/UMAX_Astra_1200S.catalog") (prompt t_copying_cat_d) (help @copyfiles-help) (dest "LOCALE:Catalogs/deutsch/Scanners")) )
          (if (in model 2)  (copyfiles (source "ScanQuix/Catalogs/deutsch/Scanners/UMAX_Astra_1220S.catalog") (prompt t_copying_cat_d) (help @copyfiles-help) (dest "LOCALE:Catalogs/deutsch/Scanners")) )
          (if (in model 3)  (copyfiles (source "ScanQuix/Catalogs/deutsch/Scanners/UMAX_Astra_2400S.catalog") (prompt t_copying_cat_d) (help @copyfiles-help) (dest "LOCALE:Catalogs/deutsch/Scanners")) )
          (if (in model 4)  (copyfiles (source "ScanQuix/Catalogs/deutsch/Scanners/UMAX_PowerLook_II.catalog") (prompt t_copying_cat_d) (help @copyfiles-help) (dest "LOCALE:Catalogs/deutsch/Scanners")) )
        )
      )
    )
  )
  (copyfiles (source "ScanQuix/Drivers/File_SQ5") (prompt t_copying_driver) (help @copyfiles-help) (dest "DEVS:Scanners"))
  (if (exists "LOCALE:Catalogs/deutsch" (noreq))
    (
      (if (in scanner 2)  (copyfiles (source "ScanQuix/Catalogs/deutsch/Scanners/Epson_GT.catalog") (prompt t_copying_cat_d) (help @copyfiles-help) (dest "LOCALE:Catalogs/deutsch/Scanners")) )
      (if (in scanner 3)  (copyfiles (source "ScanQuix/Catalogs/deutsch/Scanners/HP_ScanJet.catalog") (prompt t_copying_cat_d) (help @copyfiles-help) (dest "LOCALE:Catalogs/deutsch/Scanners")) )
      (copyfiles (source "ScanQuix/Catalogs/deutsch/Scanners/File.catalog") (prompt t_copying_cat_d) (help @copyfiles-help) (dest "LOCALE:Catalogs/deutsch/Scanners"))
    )
  )

  (complete 55)


; ENV-Verzeichnisse
; -----------------

  (makedir "ENVARC:ScanQuix"
    (prompt t_makedir)
    (help @makedir-help)
    (infos)
  )

  (makedir "ENVARC:ScanQuix/Scanners"
    (prompt t_makedir)
    (help @makedir-help)
    (infos)
  )

  (makedir "ENV:ScanQuix"
    (prompt t_makedir)
    (help @makedir-help)
    (infos)
  )

  (makedir "ENV:ScanQuix/Scanners"
    (prompt t_makedir)
    (help @makedir-help)
    (infos)
  )

  (textfile
    (prompt t_save_dest)
    (help t_savedesthelp)
    (dest "ENVARC:ScanQuix/Path")
    (append sq_path)
  )

  (textfile
    (prompt t_save_dest)
    (help t_savedesthelp)
    (dest "ENV:ScanQuix/Path")
    (append sq_path)
  )


  (set loader (askoptions
    (prompt t_askloader)
    (help @askoptions-help)
    (choices "Photogenics" "ImageFX" "Art Department Prof." "PageStream 3" "Deluxe Paint V" "Personal Paint")
    (default -1)
  ))

  (complete 60)
  (if (in loader 0)
    (if (exists "Photogenics:Data/GIO" (noreq))
      (
        (copylib
          (prompt t_copying_GIO)
          (help @copylib-help)
          (source "ScanQuix/Support/Photogenics/ScanQuix.gio")
          (dest "Photogenics:Data/GIO")
          (confirm)
        )

        (if (exists "LOCALE:Catalogs/deutsch" (noreq))
          (copyfiles
    	      (prompt t_copying_cat_d)
            (help @copyfiles-help)
            (source "ScanQuix/Support/Photogenics/deutsch/ScanQuix_GIO.catalog")
            (dest "LOCALE:Catalogs/deutsch")
            (confirm)
          )
        )
      )
    )
  )

  (complete 65)
  (if (in loader 1)
    (if (exists "ImageFX:Modules/Scanner" (noreq))
      (copylib
        (prompt t_copying_IFX)
        (help @copylib-help)
        (source "ScanQuix/Support/ImageFX/ScanQuix")
        (dest "ImageFX:Modules/Scanner")
        (confirm)
      )
    )
  )

  (complete 70)
  (if (in loader 2)
    (if (exists "ADPRO:Loaders2" (noreq))
      (copyfiles
        (prompt t_copying_ADPRO)
        (help @copyfiles-help)
        (source "ScanQuix/Support/ADPro/SCANQUIX")
        (dest "ADPRO:Loaders2")
        (confirm)
      )
    )
  )

  (complete 75)
  (if (in loader 3)
    (if (exists "PageStream3:Macros" (noreq))
      (copyfiles
        (prompt t_copying_PGS)
        (help @copyfiles-help)
        (source "ScanQuix/Support/PageStream/ScanImage.rexx")
        (dest "PageStream3:Macros")
        (confirm)
      )
    )
  )

  (complete 78)
  (if (in loader 4)
    (if (exists "DPaintV:Macros" (noreq))
      (copyfiles
        (prompt t_copying_DPV)
        (help @copyfiles-help)
        (source "ScanQuix/Support/DPaintV")
        (dest "DPaintV:Macros")
        (confirm)
        (all)
      )
    )
  )

  (complete 81)
  (if (in loader 5)
    (if (exists "PPaint:libs" (noreq))
      (copylib
        (prompt t_copying_PPaint)
        (help @copylib-help)
        (source "ScanQuix/Support/PPaint/personal_scanquix_io.library")
        (dest "PPaint:libs")
        (confirm)
      )
    )
  )


; Registrierung
; -------------

;  (complete 84)
;
;  (if (<= 5 (run (cat "version >NIL: " ver7)))
;    (
;      (set oldlevel (user 1))
;
;      (until (exists "T:sd")
;        (
;          (set regnr (askstring (prompt t_asksernum) (help t_helpsernum)))
;          (set regname (askstring (prompt t_askname) (help @askstring-help)))
;
;          (complete 87)
;          (message t_register (all))
;          (run (cat "register \"" regnr "\" \"" regname "\""))
;
          (if (exists "faith_in_2001")
            (copyfiles
            (prompt t_copying_device)
              (help @copyfiles-help)
              (source "faith_in_2001")
              (dest "DEVS:")
              (newname "scanner.device")
            ))
;
;           (;  else
;              (message t_sernum_falsch) (all))
;            )
;          )
;        )
;      )
;
;    (run "delete T:sd")
;
;     (user oldlevel)
;    )
;  )
;
;  (complete 90)
;
;  (if (askbool
;        (prompt t_anleitung_installieren)
;        (help @askbool-help)
;        (default 1)
;      )
;    (
;      (if (askbool
;            (prompt t_browser_installieren)
;            (help t_help_browser)
;            (default 1)
;          )
;        (
;          (copyfiles
;            (prompt t_copying_browser)
;            (help @copyfiles-help)
;            (source "AWeb_3.3_local")
;            (dest (tackon sq_path "ScanQuix5/AWeb_3.3_local"))
;            (all)
;            (infos)
;            (noposition)
;            (confirm)
;          )
;
;          (if deutsch (set show_cmd "Zeige_Anleitung")
;                      (set show_cmd "Show_Manual")
;          )
;
;          (copyfiles
;            (prompt t_copying_browser)
;            (help @copyfiles-help)
;            (source show_cmd)
;            (dest (tackon sq_path "ScanQuix5"))
;            (infos)
;            (confirm)
;            (noposition)
;          )
;        )
;      )
;
;      (complete 95)
;
;      (if deutsch (set anl_dir "Manual/Deutsch")
;                  (set anl_dir "Manual/English")
;      )
;
;      (makedir (tackon sq_path "ScanQuix5/Manual") 
;        (prompt t_makedir)
;        (help @makedir-help)
;        (infos)
;      )
;
;      (copyfiles
;        (prompt t_copying_anl)
;        (help @copyfiles-help)
;        (source anl_dir)
;        (dest (tackon (tackon sq_path "ScanQuix5") anl_dir))
;        (all)
;        (infos)
;        (noposition)
;        (confirm)
;      )
;    )
;  )  

  (complete 100)
 )
 (  ; else uninstall

  (set @default-dest "")

  (complete 10)
  (if (askbool
        (prompt t_wirklich_loeschen)
        (help t_loeschen_help)
        (default 0)
      )

    (
     ; uninstall procedure

      (complete 15)
      (if (exists "ENV:ScanQuix/Path")
        (
          (run (cat "delete \"" (tackon (getenv "ScanQuix/Path") "ScanQuix5\"") "all")
            (prompt t_loesche_sq)
            (help t_loeschen_help)
            (confirm)
          )

          (run (cat "delete \"" (tackon (getenv "ScanQuix/Path") "ScanQuix5.info\""))
            (prompt t_loesche_sq)
            (help t_loeschen_help)
            (confirm)
          )
        )
      )


      (complete 20)
      (if (exists "Photogenics:Data/GIO" (noreq))
        (
          (delete "Photogenics:Data/GIO/ScanQuix.gio"
            (prompt t_loesche_sq)
            (help t_loeschen_help)
            (confirm)
          )
          (delete "LOCALE:Catalogs/deutsch/ScanQuix_GIO.catalog"
            (prompt t_loesche_sq)
            (help t_loeschen_help)
            (confirm)
          )
        )
      )

      (complete 25)
      (if (exists "ImageFX:Modules/Scanner" (noreq))
        (delete "ImageFX:Modules/Scanner/ScanQuix"
          (prompt t_loesche_sq)
          (help t_loeschen_help)
          (confirm)
        )
      )

      (complete 30)
      (if (exists "ADPRO:Loaders2" (noreq))
        (delete "ADPRO:Loaders2/SCANQUIX"
          (prompt t_loesche_sq)
          (help t_loeschen_help)
          (confirm)
        )
      )

      (complete 35)
      (if (exists "PageStream3:Macros" (noreq))
        (delete "PageStream3:Macros/ScanImage.rexx"
          (prompt t_loesche_sq)
          (help t_loeschen_help)
          (confirm)
        )
      )

      (complete 40)
      (if (exists "DPaintV:Macros" (noreq))
        (delete "DPaintV:Macros/Scan(Image|Brush).dprx"
          (prompt t_loesche_sq)
          (help t_loeschen_help)
          (confirm)
        )
      )

      (complete 45)
      (if (exists "PPaint:libs" (noreq))
        (delete "PPaint:libs/personal_scanquix_io.library"
          (prompt t_loesche_sq)
          (help t_loeschen_help)
          (confirm)
        )
      )

      (complete 50)
      (run "delete LOCALE:Catalogs/deutsch/ScanQuix all"
        (prompt t_loesche_sq)
        (help t_loeschen_help)
        (confirm)
      )

      (complete 55)
      (run "delete LOCALE:Catalogs/deutsch/Scanners/#?_SQ5.catalog all"
        (prompt t_loesche_sq)
        (help t_loeschen_help)
        (confirm)
      )

      (complete 60)
      (run "delete LOCALE:Catalogs/deutsch/scannerdevice all"
        (prompt t_loesche_sq)
        (help t_loeschen_help)
        (confirm)
      )

      (complete 65)
      (run "delete ENVARC:ScanQuix all"
        (prompt t_loesche_sq)
        (help t_loeschen_help)
        (confirm)
      )

      (complete 70)
      (run "delete ENV:ScanQuix all"
        (prompt t_loesche_sq)
        (help t_loeschen_help)
        (confirm)
      )

      (complete 90)
      (run "delete DEVS:Scanners/#?_SQ5"
        (prompt t_loesche_sq)
        (help t_loeschen_help)
        (confirm)
      )

      (complete 95)
      (run "delete DEVS:scanner.device"
        (prompt t_loesche_sq)
        (help t_loeschen_help)
        (confirm)
      )

      (complete 100)
    )
  )
 )
)
