;*************************************************************************
;  Title:
;     Install-INTRA
;*************************************************************************
;  Description:
;     The Commodore Installer Script for INTRA
;*************************************************************************
;  Author:
;     Frank Maesen
;*************************************************************************
;  History:
;     12:24:21 GMT, 3 Apr 1993
;*************************************************************************

(set diskname "" )
(welcome "\n           Welcome to the INTRA installer.\n")

(procedure get_rexx_dest
 (if (= dest_dir 0) 
  (set dest_dir "REXX:") 
  (set dest_dir (cat @default-dest "/Rexx") ) ) )

(if (< (/ (getversion) 65536) 37) 
 (abort ("\nYou need OS2.04 or higher to run INTRA !!!") )
 ((message "\n\n\nTo install INTRA to your Harddrive, you will need about 150 Kb." )
  (complete 0)
  (set @default-dest
     (askdir (prompt "Select a directory or volume name where INTRA should be "
                     "installed. Keep in mind that this script will create a "
                     "directory called \"INTRA\"." )
             (help @askdir-help)
             (default @default-dest) ) )
  (if (<> "INTRA" (fileonly @default-dest) )
   ((set @default-dest (tackon @default-dest "INTRA") )
    (makedir (@default-dest) (infos) ) ) )
  (complete 1)

  (working "Copying INTRA.")
  (copyfiles (prompt "Copy these files.")
             (help @copyfiles-help)
             (source diskname)
             (dest @default-dest)
             (choices "INTRA" "INTRA.info")
             (confirm) )
  (complete 37)

  (working "Scanning your LIBS: directory.\n\n"
           "The present libraries will be compared to the libraries on the install disk".)
  (copylib (prompt "\n\"reqtools.library\"")
             (help @copylib-help)
             (source (cat diskname "Libs/reqtools.library") ) 
             (dest "LIBS:") (optional) (confirm) )
  (complete 68)

  (copyfiles (prompt "Copy the default icon and prefs to your ENVARC:\n"
                     "A directory \"INTRA\" will be created with these files.")
             (help @copyfiles-help)
             (source (cat diskname "Prefs/ENVARC/INTRA") )
             (dest "ENVARC:INTRA")
             (optional) (choices "def_intra.info" "Intra.Prefs") (confirm) )
  (if (exists "ENVARC:INTRA/def_intra.info")
   (tooltype (dest "ENVARC:INTRA/def_intra.info")
             (setdefaulttool (tackon @default-dest "INTRA") ) (noposition) ) )
  (complete 70)

  (working "Copying REXX scripts.")
  (if (getassign "REXX" "a")
   ((set dest_dir
     (askchoice (prompt (cat "Install the Rexx script to \"Rexx:\" or\n\"" @default-dest "/Rexx\"") )
             (help @askchoice-help)
             (choices "REXX:" (cat @default-dest "/Rexx") ) (default 0) ) )
    (get_rexx_dest) )
   (set dest_dir (cat @default-dest "/Rexx") ) )
  (copyfiles (prompt "Copy these REXX scripts.")
             (help @copyfiles-help)
             (source (cat diskname "Rexx") )
             (dest (dest_dir) )
             (all) (optional) (confirm) )
  (complete 76)

  (working "Copying docs.")
  (copyfiles (prompt "Copy these docs.")
             (help @copyfiles-help)
             (source (cat diskname "Docs") )
             (dest (cat @default-dest "/Docs") )
             (all) (infos) (optional) (confirm) )
  (complete 98)

  (working "Copying Data.")
  (copyfiles (prompt "Copy this/these data files.")
             (help @copyfiles-help)
             (source (cat diskname "Data") )
             (dest (cat @default-dest "/Data") )
             (infos) (all) (optional) (confirm) )

  (complete 100)
 )
)
