; A4008 Install Script
; Version 2.05
; By Gary Nush ---------- 11 January 1993
; Edits by Gary Nush ---- 04 August 1993
; Edits by Gary Nush ---- 09 August 1993

; Written for use with Commodore's Installer.

(set instldsk "GVP.Install:")

; ========================
; If the user has booted from this floppy, we need to find out
; where the usual SYS: partition is.  Try a few looks about the system...
; Currently looks for WB_2.x:, System2.0:, or dh0:.  Ask user if we can't
; figure out where s/he boots from, and/or for confirmation.

(set target (getassign "dh0" 'd'))     ; Device-only check.
(if (= target "")
    (set target (getassign "dh0")))    ; Logical assign check.

; If we're at Wit's End: -- Welcome to Wit's End, population 1?
(if (= target "")
   (set target @default-dest)          ; Let Installer choose a destination
)

; Now, make absolutely, positively sure that we go to the right place.
(set target (askdir (prompt "Which partition do you usually boot from?\n"
                            "The required utilities should be installed there.")
                    (help @askdir-help)
                    (default target)))

; ====================
; This is where the installation occurs:
;

(copylib (source (tackon instldsk "Expansion/gvpscsi"))
         (infos)
         (dest (tackon target "Expansion"))
         (confirm)
         (prompt "I will install the binddrivers version of the "
                 "gvpscsi driver in the Expansion drawer...")
         (help "The binddrivers version can be called by the Binddrivers "
               "command to initialize the gvpscsi.device after the Amiga "
               "has started to boot from an alternate device.\n\n"
               "This is useful in an A4000 where the internal IDE drive "
               "is the default boot device.\n\n"
               @copylib-help))

(copyfiles (source (tackon instldsk "GVP"))
           (dest (tackon target "GVP"))
           (all)
           (infos)
           (confirm)
           (prompt "Shall I install the GVP support software?")
           (help "This software allows you to control and configure "
                 "all aspects of the A4008.\n\n"
                 @copyfiles-help))

(set afour 0)
(if (> @user-level 1)
   (set afour
      (askbool
         (prompt "Are you running on an Amiga 4000?")
         (help "")
         (default 0)
      )
   )
)
(if (<> afour 0)
   (
      (run "GVP.Install:GVP/SCSI/SetAllMasks")
      (run "GVP.Install:GVP/SCSI/BufferCount")

      (set maxafour 1)
      (set buffers (getenv "HDBuffers"))
      (set a4008prompt "")
      (set a4008prompt (cat a4008prompt "Do you want to sacrifice "))
      (set a4008prompt (cat a4008prompt buffers))
      (set a4008prompt (cat a4008prompt " bytes of Chip RAM for SCSI device buffer storage"))
      (set a4008prompt (cat a4008prompt " to maximize SCSI throughput performance?\n\n"))
      (set a4008prompt (cat a4008prompt "NOTE:  If you do not have any RAM installed"))
      (set a4008prompt (cat a4008prompt " directly on the A4008, you MUST say 'Yes' to"))
      (set a4008prompt (cat a4008prompt " option!"))

      (if (> @user-level 1)
         (set maxafour
            (askbool
               (prompt a4008prompt)
               (help "Test results have shown that by placing SCSI device "
                     "buffers in Chip RAM on the A4000 results in higher "
                     "data transfer speed performance.\n\n"
                     "Using motherboard FastRAM severely reduces performance"
                     "speeds, and without onboard A4008 RAM, you *MUST* use"
                     "ChipRAM!")
               (default 1)
            )
         )
      )

      (if (<> maxafour 0)
         (
            (working "Updating GVPSCSI Rigid Disk Blocks for maximum A4000 operation...")
            (run "GVP.Install:GVP/SCSI/SetAllMasks CHIP")
         )
      )
   )
)

(set @default-dest target)
