
; Install script for Requestor (Workbench 2.1 or higher)

(set old_level @user-level)

(set requestordir "//")
(set catalogdir "//Catalogs/")

;=============================================================================
; English strings

(set default_lang 4)

(set #bad-kick
(cat "You must be using Kickstart 2.04 to install using this script!"
))

(set #where-requestor
(cat "Where would you like to install Requestor ?\n"
     "(A drawer will be created)"
))

(set #add-rexxmast-startup
(cat "\nAdd Rexxmast startup to \"S:user-startup\" "
     "so that your system will be properly startup rexxmast for Requestor ? "
     "Select Help if you want know why."
))
(set #add-rexxmast-startup-help
(cat "\nRequestor will need rexxmast to create a communication channel "
     "between Requestor and Trapdoor, Requestor and Spot"
))

(set #which-language
(cat "\nWhich languages should be installed?"
))
(set #which-language-help
(cat "\nThe Amiga can be operated in many different"
     " languages. If you want Requestor to use the same"
     " language as the Amiga Workbench"
     " then a catalog file must be copied to your"
     " harddisk for each language supported.\n\n"
     "To reduce the amount of space consumed by the"
     " language files, you can select to have only the"
     " files of specific languages copied.\n\n"
     "Simply check the boxes of the languages you wish"
     " to have available on your system.\n\n"
     @askoptions-help
))

(set #install-msg
(cat "\n\nRequestor installation script.\n"
     "This script installs Requestor on your Amiga.\n\n"
     "Read the README file for more information\n"
     "on the distribution of Requestor.\n\n"
     "Requestor © 1995 Stephan Kortleven\n"
     "All rights reserved."
))

(set #requestor-wbstartup "\nInstall Requestor in WbStartup too ?\nChoose Help to know why !")
(set #requestor-wbstartup-help
(cat "\nThis will install Requestor in WbStartup for Iconify or timer uses. "
     "Requestor will the first time it's started create a directory called data. "
     "All other Requestor versions will use this created directory. So, it would "
     "be smart to start first the version i just have installed otherwise there "
     "will be a data directory created in the WbStartup directory that you "
     "dont want have at that place !"
))

(set #notfound
(cat "\nSys:System/Rexxmast not found !\n\n"
     "Requestor will need Rexxmast to work !\n"
     "I hope you have put it somewhere else. ;-)\n"
     "It has to be started before running Requestor !\n"
))

;=============================================================================
; Dutch strings

(if (= @language "nederlands")
(

(set default_lang 64)

(set #bad-kick
(cat "U moet Kickstart 2.04 gebruiken om met dit installatie script te"
     " installeren!"
))

(set #where-requestor
(cat "Waar wilt u Requestor installeren ?\n"
     "(Er zal een lade aangemaakt worden)"
))

(set #add-rexxmast-startup
(cat "\nRexxmast toewijzen aan \"S:user-startup\" "
     "Zo uw systeem start rexxmast voor Requestor ?"
))
(set #add-rexxmast-startup-help
(cat "\nRexxmast toewijzen aan \"S:user-startup\". "
     "Zodat uw systeem rexxmast opstart voor Requestor ?"
))

(set #which-language
(cat "\nWelke talen moeten geïnstalleerd worden?"
))
(set #which-language-help
(cat "\nDe Amiga kan werken in verschillende talen."
     " Als u wilt dat Requestor in dezelfde taal werkt"
     " dan moet er voor elke taal een bestand naar"
     " uw vaste schijf gekopieerd worden.\n\n"
     "Om de grootte van het geheugen die de taal bestanden"
     " innemen te verkleinen, kunt u een keuze maken uit"
     " de talen, die vervolgens naar uw systeem disk worden"
     " gekopieerd .\n\nU hoeft alleen die talen die u op"
     " uw systeem wilt hebben aan te klikken.\n\n"
     @askoptions-help
))

(set #install-msg
(cat "\n\nRequestor installatie script.\n"
     "Dit script installeert Requestor op uw Amiga.\n\n"
     "Lees het 'README' bestand voor meer\n"
     "informatie over de verspreiding van Requestor.\n\n"
     "Requestor © 1995 Stephan Kortleven\n"
     "Alle rechten voorbehouden."
))


(set #requestor-wbstartup "\nRequestor ook in WbStartup instaleren ?\nKies Help als je wil weten waarom !")
(set #requestor-wbstartup-help
(cat "\nDit zal Requestor in uw WbStartup instaleren voor Iconify of klok "
     "Gebruik. Requestor zal de eerste maal dat hij gestart word een data "
     "lade aanmaken. Alle andere Requestor versies zullen van deze lade "
     "gebruikt maken. Het is dus verstandig de zojuiste geinstalleerde versie "
     "eerst te starten anders krijg je je data lade in WbStartup wat mischien "
     "niet gewenst is."
))

(set #notfound
(cat "\nSys:System/Rexxmast niet gevonden !\n\n"
     "Requestor heeft Rexxmast nodig om te kunnen werken !\n"
     "Ik hoop dat u het ergens anders heeft staan. ;-)\n"
     "Het moet gestart worden voor Requestor gestart word !\n"
))

))

;=============================================================================
; make sure we are running under a 2.04 ROM

(if (< (/ (getversion) 65536) 37)
(
    (abort #bad-kick)
))

;=============================================================================

(message #install-msg)

(welcome)

(set requestordestdir
   (tackon
      (askdir
         (prompt #where-requestor)
         (help @askdir-help)
         (default @default-dest)
      )
      "Requestor"
   )
)

(set @default-dest requestordestdir)

(makedir requestordestdir (infos))
(makedir (tackon requestordestdir "Data"))
(makedir (tackon requestordestdir "Catalogs"))


(copyfiles
   (source (tackon requestordir "Requestor"))
   (dest requestordestdir)
   (infos)
)
(copyfiles
   (source (tackon requestordir "Requestor.Junior"))
   (dest requestordestdir)
   (infos)
)


(copyfiles
   (source (tackon requestordir "Requestor.Guide"))
   (dest requestordestdir)
   (infos)
)
(copyfiles
   (source (tackon requestordir "Requestor.Doc"))
   (dest requestordestdir)
   (infos)
)


(if (< (/ (getversion) 65536) 39)
(
   (tooltype
      (dest (tackon Requestordestdir "Requestor.guide"))
      (setdefaulttool "SYS:Utilities/AmigaGuide")
   )
   (tooltype
      (dest (tackon Requestordestdir "Requestor.Doc"))
      (setdefaulttool "SYS:Utilities/More")
   )
))


(copyfiles
   (source (tackon requestordir "Requestor.Readme"))
   (dest requestordestdir)
   (infos)
)
(if (< (/ (getversion) 65536) 39)
(
   (tooltype
      (dest (tackon requestordestdir "Requestor.Readme"))
      (setdefaulttool "SYS:Utilities/More")
   )
))


(copyfiles
   (source (tackon requestordir "World"))
   (dest requestordestdir)
   (infos)
)
(if (< (/ (getversion) 65536) 39)
(
   (tooltype
      (dest (tackon requestordestdir "World"))
      (setdefaulttool "SYS:Utilities/More")
   )
))

(copyfiles
   (source (tackon requestordir "Print.World"))
   (dest requestordestdir)
   (infos)
)

(copyfiles
   (source (tackon requestordir "README"))
   (dest requestordestdir)
   (infos)
)
(if (< (/ (getversion) 65536) 39)
(
   (tooltype
      (dest (tackon requestordestdir "README"))
      (setdefaulttool "SYS:Utilities/More")
   )
))


(if
 (askbool
  (prompt #requestor-wbstartup)
  (help #requestor-wbstartup-help)
  (default 0)
 )
 (
   (copyfiles
     (source (tackon requestordir "Requestor"))
     (dest "Sys:WbStartup")
     (infos)
   )
 )
)


(if
  (exists "Sys:System/RexxMast" (noreq))
  (if
    (askbool
      (prompt #add-rexxmast-startup)
      (help #add-rexxmast-startup-help)
      (default 1)
    )
    (startup "Requestor"
      (prompt #add-rexxmast-startup)
      (help #add-rexxmast-startup-help)
      (command
       "Sys:System/RexxMast >nil:\n"
      )
    )
  )
  (message #notfound)
)

(if (exists "SYS:Locale")
(
   (if (exists "LOCALE:")
   (
      (user 1)
      (set lang (askoptions (prompt #which-language)
                            (help #which-language-help)
                            (choices
                               "English"
                               "Nederlands"
                            )
                            (default default_lang)
                )
      )
      (user old_level)

      (set n 0)
      (while (set language (select n
                              "english"
                              "nederlands"
                              "")
              )
      (
         (if (IN lang n)
         (
            (if (<> 0 n)
            (
               (makedir (tackon requestordestdir (cat "Catalogs/" language)))
               (copyfiles (source (tackon (tackon catalogdir language) "requestor.catalog"))
                          (dest (tackon requestordestdir (cat "Catalogs/" language)))
               )
            ))
         ))
         (set n (+ n 1))
      ))
   ))
))

