; G-Force A4000-040 Install Script
; Version 1.1
; By Michael Erwin ----- 24 March 1994
; Written for use with Commodore's Installer.

; English Strings *************************************************

(set default_lang 4)

(set #BootPartitionPrompt
  (cat   "Which partition do you usually boot from?\n"
         "The required utilities should be installed there."
  )
)

(set #040LibraryPrompt "Install 68040.library")

(set #040LibraryHelp
  (cat   "The 68040.library is required for the A4000 G-Force040 "
         "accellerator to work properly.\n\n"
  )
)

(set #SetPatchPrompt "Install SetPatch")

(set #SetPatchHelp
  (cat   "This version of SetPatch is required for the "
         "provided 68040.library.\n\n"
  )
)

(set #UtilitiesPrompt "Install the GVP support software")

(set #UtilitiesHelp
  (cat   "This software allows you to configure, control, "
         "and test the A4000 G-Force040 accelerator.\n\n"
  )
)

(set #GVPKSRemapPrompt
  (cat   "Install GVPKSRemap to copy Kickstart into RAM.\n\n"
         "NOTE: You must have a SIMM in the second or eighth "
         "memory socket for this option to work.\n\n"
  )
)

(set #GVPKSRemapHelp
  (cat   "This will copy an icon to the WBStartup drawer that "
         "executes GVPKSRemap during startup to remap Kickstart "
         "into system Fast RAM for faster access to routines "
         "that are normally located in ROM.  512K of RAM will "
         "be used to hold the Kickstart image.\n\n"
  )
)

(set #StartupPrompt
  (cat   "Add GVPConfigMem to startup-sequence.\n\n"
         "NOTE: This is required to configure memory properly.\n\n"
  )
)

(set #StartupHelp
  (cat   "This will add a line to the beginning of the "
         "startup-sequence to run the GVPConfigMem program.  "
         "It is required to configure the memory on the G-Force040 "
         "and must be executed before the SetPatch program to work "
         "properly.\n\n"
  )
)

; German Strings **************************************************

(if (= @language "deutsch")
  (
  (set default_lang 2)

  ; German Text Here

  )
)

; MAIN EXECUTE ****************************************************

(complete 0)

(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_3.x:, System3.0:, dh0:, or Workbench3.0:.  Ask
; user if we can't figure out where s/he boots from, and/or for confirmation.

(set target (getassign "wb_3.x" 'd'))             ; Device-only check.

(if (= target "")
    (set target (getassign "System3.0" 'v'))      ; VolumeName-only check.
)

(if (= target "")
    (set target (getassign "Workbench3.0" 'v'))   ; VolumeName-only check.
)

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

(if (= target "")
    (set target (getassign "System3.0"))          ; Logical assign check.
)

(if (= target "")
    (set target (getassign "dh0"))                ; Logical assign check.
)

(if (= target "")
   (set target @default-dest)                     ; default destination
)

; Now, make absolutely, positively sure that we go to the right place.
(set target (askdir (prompt #BootPartitionPrompt)
                    (help @askdir-help)
                    (default target)
            )
)

; Copy 68040.library
(copylib (source (tackon instldsk "libs/68040.library"))
         (dest (tackon target "libs"))
         (prompt #040LibraryPrompt)
         (confirm)
         (help #040LibraryHelp @copylib-help)
)

(complete 20)

; Copy SetPatch
(copylib (source (tackon instldsk "c/SetPatch"))
         (dest (tackon target "c"))
         (prompt #SetPatchPrompt)
         (confirm)
         (help #SetPatchHelp @copylib-help)
)

(complete 40)

; Copy GVP Utilities
(copyfiles (source (tackon instldsk "GVP"))
           (dest (tackon target "Utilities/GVP"))
           (all)
           (infos)
           (confirm)
           (prompt #UtilitiesPrompt)
           (help #UtilitiesHelp @copyfiles-help)
)

(complete 60)

; Add GvpConfigMem to startup
(copyfiles (source (tackon instldsk "s/pre-startup"))
           (dest "RAM:")
           (safe)
)

(copyfiles (source (tackon target "s/startup-sequence"))
           (dest "RAM:")
           (newname "old-startup")
           (safe)
)

(run (tackon instldsk "c/join RAM:pre-startup RAM:old-startup AS RAM:startup-sequence")
     (safe)
)

(delete "RAM:pre-startup" (safe))
(delete "RAM:old-startup" (safe))

(message (#StartupPrompt)
         (help #StartupHelp)
)

(copyfiles (source "RAM:startup-sequence")
           (dest (tackon target "s"))
)

(delete "RAM:startup-sequence" (safe))

(complete 80)

; Copy GVPKSRemap icon
(copyfiles (source (tackon instldsk "WBStartup/GVPKSRemap.info"))
           (dest (tackon target "WBStartup"))
           (prompt #GVPKSRemapPrompt)
           (confirm)
           (help #GVPKSRemapHelp @copyfiles-help)
)

(set @default-dest target)

(complete 100)

