; $VER: HiSpeed 5.3 (19.4..93)
; Copyright (C)1992-1993 Dietmar Eilert

(complete 0)
(delopts "oknodelete" "force" "askuser")

(set #bad-kick
(cat " Sorry, this package requires OS v2.04 or better.  \n"
     " Contact your local C= dealer if you want to order \n"
     " a Kickstart upgrade kit.                          \n"
))

(set #which-disk
(cat " Where do you want to have the package installed ? \n"))

(set #target-help
(cat "                                                   \n"
     " Simply select a directory (a root directory is    \n"
     " fine, too). I'm going to create a new directory   \n"
     " called 'HiSpeed' within the directory you specify.\n"
     "                                                   \n"
))

(set #abortmsg
(cat "                                              \n"
     " This installation requires about 400 KBytes  \n"
     " free storage on the volume where you wish to \n"
     " install HiSpeed. Please make this space      \n"
     " available and then run install again.        \n"
     "                                              \n"
))

(set #startup
(cat "                                                   \n"
     " Add 'HISPEED:' assign to 's:user-startup' ?       \n"
))

(set #startup-help
(cat "                                                   \n"
     " A 'HISPEED:' assign is required if you want to run\n"
     " HiSpeed without having to worry about the current \n"
     " path (i.e. you won't have to CD to HiSpeed's dir).\n"
     " However, this assignment is not required if you   \n"
     " don't intend to use the softfonts of this package.\n"
     "                                                   \n"
))

(set #support
(cat "                                                   \n"
     " Please select support utilities/files. Existing   \n"
     " files won't be overwritten (unless outdated):     \n"
))

(set #support-choices1
(cat " Reqtools.library (requester library)"))

(set #support-choices2
(cat " xpk.library (cruching/decrunching)"))

(set #support-help
(cat "                                                   \n"
     " Some functions of this program heavily depend on  \n"
     " external support libraries. THE REQTOOLS LIBRARY  \n"
     " MUST BE AVAILABLE !                               \n"
     " These packages are not complete (just the basic   \n"
     " stuff to keep HiSpeed running). Check your local  \n"
     " BBS to get the full releases.                     \n"
     " 'Reqtools.library' is İNico François              \n"
     " 'xpk.library' is İU.D.Mueller, Bryan Ford, ...    \n"
     "                                                   \n"
))

(set #askdelete
(cat "                                                   \n"
     " Do you want to have old HiSpeed config files      \n"
     " removed from your system (if any are present) ?   \n"
))

(set #askdelete-help
(cat "                                                   \n"
     " HiSpeed v5.3 can't read the old files, so I would \n"
     " suggest to have them deleted.                     \n"
))


; ----------------------------------------------------------------------------

(set reboot FALSE)

(complete 0)

; sure we are running under a 2.04 ROM ?

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

(set target (askdir 

    (prompt  #which-disk )
    (help    #target-help)
    (default "SYS:UTILITIES" )
))

(complete 20)

(set @default-dest target)
(set targetsize (getdiskspace target))

(if (< targetsize 400000) (

    (if (<> (getdevice target) "RAM") (
        (abort #abortmsg)
    ))
))

(run (cat "delete " (cat (tackon target "HiSpeed") "/#? ALL QUIET")))

(copyfiles

    (source "MAIN")
    (dest target)
    (infos)
    (all)
)

(complete 70)

    (startup

        "HISPEED"
        (prompt   #startup)
        (help     #startup-help)
        (command  ("ASSIGN >NIL: HISPEED: %s " (tackon target "HiSpeed")))
    )

(complete 80)

; install support libraries ?

(set tools (askoptions

    (prompt #support)

    (help #support-help)

    (choices #support-choices1
             #support-choices2)

   (default 3)
))

; install reqtools library ?

(if (IN tools 0) (

    (copylib 
        (source "reqtools/libs20/reqtools.library")
        (dest   "libs:")
    )
    (if (not (exists "sys:prefs/reqtools")) (

        (copyfiles

            (source "reqtools/prefs")
            (dest "sys:prefs")
            (infos)
            (all)
        )
    ))
))

(complete 85)

; install xpk library ?

(if (IN tools 1) (

    (copylib 
        (source "xpk/xpkmaster.library")
        (dest   "libs:")
    )

    (if (not (exists "libs:compressors")) (

         (makedir "libs:compressors")
    ))

    (copylib 
        (source "xpk/compressors/xpkIMPL.library")
        (dest   "libs:compressors")
    )
))

(if (askbool

    (prompt #askdelete)

    (help #askdelete-help)

    (default TRUE)) (

        (delete "envarc:hispeed.config")
        (delete "s:hispeed.config")
))

(set oldcfgBackup (exists "envarc:HiSpeed"))

(if oldcfgBackup (

    (delete "envarc:HiSpeed/HiSpeed.prefs")
))

(if (not (exists "envarc:HiSpeed")) (

     (makedir "envarc:HiSpeed")
))

(copyfiles

    (source  "envarc/HiSpeed")
    (dest    "envarc:HiSpeed")
    (infos)
    (all)
)

(complete 100)

