; $VER: Install_SuperView.script V4.43 (17.1.95)
; © 1993-95 by Andreas R. Kleinert.
; This is the Installer Script for SuperView

(set selectlang (askchoice
                   (prompt "")
                   (help @askchoice-help)
                   (choices "Deutsche Installation" "English Installation")
                   (default 1)
                 )
)

(if (= selectlang 0)
 ; IF
 (set @language "deutsch")
 ; ELSE
 (set @language "english")
)

(if (= @language "deutsch")

; IF so, set german texts
  (
    (set MSG_wrong_OS       (cat "Sie benötigen mindestens OS V2.04 für SuperView !\n\n"
                                 "SuperView wird auf Ihrem System nicht laufen !"))
    (set MSG_InstallingSuperView "Installiere jetzt SuperView. Die Libraries müssen separat installiert werden !")
    (set MSG_SelectPath          "Wählen Sie das Zielverzeichnis für SuperView")
    (set MSG_InstallingCatalogs  "Installiere jetzt die Katalog-Dateien für die\nOS V2.1+ Sprach-Unterstützung.")
    (set MSG_SelectCatalogPath   "Wählen Sie den Pfad für die Katalog-Dateien")
  )
; ELSE set english texts
  (
    (set MSG_wrong_OS       (cat "You need at least OS V2.04 to run SuperView !\n\n"
                                 "SuperView will not run with your system configuration !"))
    (set MSG_InstallingSuperView "Installing SuperView now. Libraries have to be installed separately !")
    (set MSG_SelectPath          "Select path to install SuperView to")
    (set MSG_InstallingCatalogs  "Installing Catalog-Files for OS V2.1+\nCode localization.")
    (set MSG_SelectCatalogPath   "Select path to install Catalogs to")
  )
)

(set OS_VER (/ (getversion) 65536) )

(if(< OS_VER 37)
  (abort MSG_wrong_OS)
)

(complete 0)


(set iconset (askchoice
                   (prompt "")
                   (help @askchoice-help)
                   (choices "IconSet 1 (default)" "IconSet 2")
                   (default 0)
                 )
)

(if (= iconset 1)
  (
    run( "LHA -xarm -b64 x IconSet2.LHA /")
  )
)

(complete 5)

(copyfiles
  (prompt MSG_Installing)
  (help @copyfiles-help)
  (source "")
  (set svcomdir
              (askdir
                     (prompt MSG_SelectPath)
                     (help @askdir-help)
                     (newpath)
                     (default "SYS:SuperView")
              )
  )
  (dest svcomdir)
  (all)
  (confirm)
)

(complete 70)

(copyfiles
  (prompt MSG_InstallingCatalogs)
  (help @copyfiles-help)
  (source "locale/catalogs")
  (set svcomdir
              (askdir
                     (prompt MSG_SelectCatalogPath)
                     (help @askdir-help)
                     (newpath)
                     (default "SYS:locale/Catalogs")
              )
  )
  (dest svcomdir)
  (all)
  (confirm)
)


(complete 100)
