;$VER:Script for HFMounter 2.0

;********************************************************************************
;
; Read All System information
;
;********************************************************************************
(set osver (/ (getversion "LIBS:version.library") 65536))

( if (= osver 37)  (set workbench "2.0"))

( if (= osver 38)  (set workbench "2.1"))

( if (= osver 39)  (set workbench "3.0"))

( if (= osver 40)  (set workbench "3.1"))

( if (= osver 41)  (set workbench "4.0"))


(run "type >RAM:lan EnvArc:sys/locale.prefs opt h")

(set runstring (cat "search" " RAM:lan "))

(set english "")  (set german  "")

(set runstring1 (cat runstring "\"deutschland\""))   (if (= (run runstring1) 0) (set german1 "Deutsch"))

(set runstring1 (cat runstring "\"english\""))   (if (= (run runstring1) 0) (set english1 "English"))

;********************************************************************************
;
;ASK DEFAULT LANG
;
;********************************************************************************
(set #langQuestion (cat "The following were found in Locale:\n\n" english1 "\n"german1"\n\nSelect one of the installers supported Languages."
                   )
)

(set LAN (askchoice (choices "German (Deutsch)" "English"
                         (prompt #langQuestion)
                         (help "Select a Language")
                         (default lang)
                    )
         )
)

(set @hfm-dest "SYS:C/")

;********************************************************************************
;
;English Information
;
;********************************************************************************


(set #Intro-Txt (cat "\n\nWelcome to \n\n"
                     "HFMounter 2.0\n"
                     "Hard Disk Install Script\n\n"
                     "HFMounter is ©1995 by SuicideSoft\n\n"
                )
)

(set #MinReqOS (cat "The following are the MINIMUM REQUIREMENTS!\n"
                    "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n"
                    "Kickstart 2.1, **You only have " workbench "**\n"
               )
)

(set #Path-Txt (cat "Select the target directory for HFM."
               )
)

(set #Path-Help (cat "\nThis section lets you choose the\n"
                     "target directory to install HFMounter 2.0 in.\n\n"
                     "Default is SYS:C/\n\n\n"
                 @askdir-help
                )
)

(set #Copyfile-txt (cat "Copying HFM to "
                   )
)

(set #copycat-txt (cat "Copying Catalog-file to locale:"
                  )
)

(set #devcopy-txt (cat "Copying fmsdisk.device to devs:"
                  )
)

(set #devcopy-help (cat "\nThis section installs the fmsdisk.device\n"
                        "in yoour system's devs: directory"
                   )
)

(set #mountl-txt (cat "\nCopying HF-Mountlist to devs:\n"
                )
)

(set #mountl-help (cat "\nThis mountlist consists of the\n"
                       "entries for 12  HF-Units. The programm\n"
                       "needs it in devs:\n"
                  )
)

(set #bgui-txt (cat "\nCopying BGUI-Library to LIBS:\n"
               )
)

(set #bgui-help (cat "\n The BGUI-Library is responsible for the\n"
                     "neat GUI of HFMounter. Destination is LIBS:\n"
                )
)


(set #Pathdriver-Txt (cat "Select the target directory for \n"
                          "the example dosdriver."
                     )
)

(set #Pathdriver-Help (cat "\nThis section lets you choose the target directory\n"
                           "to install an example dosdriver in.\n\n"
                           "Default is SYS:storage/dosdrivers/\n\n\n"
                       @askdir-help
                      )
)

(set #driver-txt (cat "\n Copying example-dosdriver\n"
                 )
)


(set #driver-help (cat "\n An example dosdriver will be copiied\n"
                       " that may be duplicated and renamed.\n\n"
                       " Infos about using dosdrivers in AmigaOS dos-manual\n"
                  )
)

(set #Pathguide-Txt (cat "Select the target directory for HFM_e.guide."
                    )
)

(set #Pathguide-Help (cat "\nThis section lets you choose the "
                          "target directory to install HFM.guide in.\n\n"
                          "Default is locale:help/deutsch/\n\n\n"
                      @askdir-help
                     )
)

(set #guide-txt (cat "\n Copying Amigaguide document to: \n\n"
                )
)

(set #guide-help (cat "\n This section copies the documentation in amigaguide-\n"
                      " format in a directory of your choice.\n"
                      " In case you are uncertain about anything in HFMounter,\n"
                      " you should refer to this helptext.\n"
                 )
)

(set #Assign-Help-Txt (cat "\nA script located in the target directory will make "
                          "the Assigns. The User-Startup will be patched in order "
                          "to call this script.\n\n\n"
                      @startup-help
                     )
)

;********************************************************************************
;
;German Information
;
;********************************************************************************
(if (= LAN 0)

(

(set #Intro-Txt (cat"\n\nWillkommen zum \n\n"
                    "HFMounter 2.0\n"
                    "Hard Disk Install Script\n\n"
                    "HFMounter ist ©1995 von SuicideSoft\n\n"
                )
)

(set #MinReqOS (cat "Das Folgende ist MINIMAL erforderlich\n"
                    "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n"
                    "Kickstart 2.1, **Du hast nur " workbench "**\n"
               )
)

(set #Path-Txt (cat "Bestimme das Zielverzeichnis\n"
                    "         fuer HFM           \n"
               )
)

(set #Path-Help (cat "\nHier kannst Du das Zielverzeichniss\n"
                     "fuer den HFMounter 2.0 angeben.\n\n"
                     "      Default ist SYS:C/       \n\n\n"
                 @askdir-help
                )
)

(set #Copyfile-txt (cat "Kopiere HFM nach "
                   )
)

(set #Copycat-txt (cat "Kopiere deutsches Catalogfile nach locale:catalogs/deutsch/"
                  )
)

(set #copycat-help (cat "\nHier kannst Du Dich fuer das Deutsche Sprachfile fuer\n"
                        "HFMounter entscheiden, es wird nach Localae:catalogs/deutsch\n"
                        "kopiert und beim naechsten Start von HFMounter eingelesen"
                   )
)

(set #devcopy-txt (cat "Kopiere das fmsdisk.device nach devs:"
                  )
)

(set #devcopy-help (cat "\nHier wird das fmsdisk.device installiert\n"
                        "Es gehört ins DEVS: Verzeichnis"
                   )
)

(set #mountl-txt (cat "\nKopiere die HF-Mountlist nach Devs:\n"
                )
)

(set #mountl-help (cat "\nDie Mountlist enthaelt die Einträge von\n"
                       " 12  HF-Units. Das Programm benoetigt sie in DEVS:\n"
                  )
)

(set #bgui-txt (cat "\n Kopiere die BGUI-Library nach LIBS:\n"
               )
)

(set #bgui-help (cat "\n Die BGUI-Library ist fuer die Oberfläche des\n"
                     " HFMounters zustaendig. Sie gehört nach LIBS:\n"
                )
)

(set #Pathdriver-Txt (cat "Wähle das Zielverzeichnis\n"
                          "fuer den Beispielsdosdriver.\n"
                     )
)

(set #Pathdriver-Help (cat "\n Hier kannst Du das Zielverzeichnis\n"
                           " fuer einen Beispielsdosdriver angeben.\n\n"
                           " Default ist SYS:storage/dosdrivers/\n\n\n"
                       @askdir-help
                      )
)

(set #driver-txt (cat "\n Kopiere Beispielsdosdriver \n"
                 )
)


(set #driver-help (cat "\n Es wird ein Beispielsdosdrver kopiert\n"
                       " der dupliziert und umbenannt werden kann.\n\n"
                       " Infos zu Dosdrivern findest Du im AmigaOS Dos-Manual\n"
                  )
)


(set #Pathguide-Txt (cat "\n Wähle das Zielverzeichnis\n"
                         " fuer den Amigaguide Hilfstext.\n"
                    )
)

(set #Pathguide-Help (cat "\n Hier kannst Du das Zielverzeichnis\n"
                          " fuer den HFM.guide angeben.\n\n"
                          " Default ist locale:help/deutsch/\n\n\n"
                      @askdir-help
                     )
)

(set #guide-txt (cat "\n Kopiere Amigaguide-Hilfstext nach: \n\n"
                )
)

(set #guide-help (cat "\n Hier wird die Dokumentation im Amigaguide-Format\n"
                      " in das Verzeichnis Deiner Wahl kopiert.\n"
                      " Falls am HFMounter etwas unklar sein sollte,\n"
                      " kannst Du dort Informationen zum Programm finden\n"
                 )
)

(set #Assign-Help-Txt (cat "\nEin Skript im Zielverzeichnis wird das nötige Assign\n"
                          "machen. Die User-Startup wird gepatcht um das Skript\n"
                          "dann aufzurufen.\n\n\n"
                      @startup-help
                     )
)

))

;
; Main Script
;
(if (< osver 38)  (abort #MinReqOS) )
(message #Intro-txt)

(complete 0)

(set target (askdir (prompt (cat #Path-Txt))
                    (help   (cat #Path-Help))
                    (default @hfm-dest)
            )
)

(set @hfm-dest target)

(copyfiles (prompt (cat #Copyfile-txt " " @hfm-dest))
           (help @copy-files-help)
           (source "c/HFM")
           (dest (tackon @hfm-dest ""))
           (confirm)
)

(complete 20)

;(set @copycat 0 )
;
;(set @copycat (askchoice (choices "NO" "YES")
;                           (prompt "\nDo you want to install the german catalog-file?\n\n"
;                                   "Möchtest Du das deutschsprachige Catalog-File installieren?\n")
;                           (help (cat #copycat-help))
;                           (default @copycat)
;                         )
;)
;
(set @catdest "locale:catalogs/deutsch")

(if (= LAN 0) (copyfiles (prompt (cat #copycat-txt " " ))
                              (source "catalogs/deutsch/HFM.catalog")
                              (dest (tackon @catdest ""))
                              (help @copy-files-help)
                              (confirm)
                   )
)

(complete 40)

(copylib (prompt (cat #devcopy-txt " " ))
                  (help (cat #devcopy-help))
                  (source "devs/fmsdisk.device")
                  (dest (tackon "devs:" ""))
                  (confirm)
)

(copyfiles (prompt (cat #mountl-txt " " ))
                     (help (cat #mountl-help))
                     (source "devs/hf-mountlist")
                     (dest (tackon "devs:" ""))
                     (confirm)
)

(complete 60)

(copylib (prompt (cat #bgui-txt " " ))
                   (help (cat #bgui-help))
                   (source "libs/bgui.library")
                   (dest (tackon "libs:" ""))
                   (confirm)
)

(set target (askdir (prompt (cat #Pathdriver-Txt " " ))
                    (help (cat #Pathdriver-Help))
                    (default "Sys:storage/dosdrivers/")
                    (newpath)
            )
)

(complete 80)

(copyfiles (prompt (cat #driver.txt " "))
                     (help (cat #driver-help))
                     (source "devs/dosdrivers/HF0")
                     (dest (tackon target ""))
                     (infos)
                     (confirm)
)

(set target (askdir (prompt (cat #Pathguide-Txt))
                    (help (cat #Pathguide-Help))
                    (default "locale:help/deutsch/")
                    (newpath)
            )
)

(if (= LAN 0) (copyfiles (prompt (cat #guide-txt target))
                                 (help (cat #guide-help))
                                 (source "HFM.guide")
                                 (dest (tackon target ""))
                                 (infos)
                                 (confirm)
                   )
)

(if (= LAN 1) (copyfiles (prompt (cat #guide-txt target))
                                 (help (cat #guide-help))
                                 (source "HFM_e.guide")
                                 (dest (tackon target ""))
                                 (infos)
                                 (confirm)
                   )
)
(message "\n Have\n   PHUN\n       guys!!!")
(complete 100)
