
; 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"
))

;=============================================================================
; 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 "Catalogs"))
(makedir (tackon requestordestdir "Data"))

(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)
)
(if (< (/ (getversion) 65536) 39)
(
   (tooltype
      (dest (tackon Requestordestdir "Requestor.Guide"))
      (setdefaulttool "SYS:Utilities/AmigaGuide")
   )
))

(copyfiles
   (source (tackon requestordir "Requestor.Doc"))
   (dest requestordestdir)
   (infos)
)
(if (< (/ (getversion) 65536) 39)
(
   (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)
)

