; $VER: Dragonstone HD Install-Script V1.0 (16.12.94) by Roland for Sentinel

(set GameDir "Dragonstone")
(set TotalDisks 4)
(set CurrentDisk 0)
(set Percent 20)
(set DiskPercent (/ (- 100 Percent) TotalDisks))
(set keuze 0)

;try to figure out a place where the user usually installs his games
(if (exists "Games:" (noreq) )
    (set @default-dest "Games:")
    (if (exists "SYS:Games" (noreq) )
        (set @default-dest "SYS:Games")
        (if (exists "Work:Games" (noreq) )
            (set @default-dest "Work:Games")
            (set @default-dest "SYS:")
        )
    )
)

;ask the user to select a directory to install the game into
(set default-dest
     (tackon (askdir (prompt "Where would you like " @app-name " installed?\n"
                             "A drawer called " GameDir " will be created.")
                     (help @askdir-help)
                     (default @default-dest)
                     (newpath)
             )
     GameDir
     )
)
(set @default-dest default-dest)
(complete 5)

;create the selected directory and a subdirectory called Data
(makedir @default-dest
         (infos)
)
;No data-directory needed this time!
;(makedir (tackon @default-dest "Data")
;)
(complete 10)

;copy all extra files to this directory
(set keuze
     (askchoice (prompt "Which HD-version do you wish to install?\n\n"
                        "If you have 6MB or more RAM you can install "
                        "the 6MB version which doesn't load during "
                        "the game.")
                (help @askchoice-help)
                (choices "2MB Version" "6MB Version (RAM)")
     )
)
(if (= keuze 0)
; copy the extra files for the 2mb version
    ( (copylib (prompt "Copying hd.library to LIBS:...")
               (help @copylib-help)
               (source "hdgame.library")
               (dest "LIBS:")
               (confirm)
      )
      (copyfiles (source "Dragonstone.2mb")
                 (dest @default-dest)
                 (newname "Dragonstone")
      )
      (copyfiles (source "Dragonstone.2mb.icon")
                 (dest @default-dest)
                 (newname "Dragonstone.info")
      )
      (copyfiles (source "Mountlist")
                 (dest @default-dest)
      )
      (copyfiles (source "Boot")
                 (dest @default-dest)
      )
      (copyfiles (source "Reboot")
                 (dest @default-dest)
      )
    )
; install the extra files for the 6MB-version:
    (
      (copyfiles (source "Dragonstone.6mb")
                 (dest @default-dest)
                 (newname "Dragonstone")
      )
      (copyfiles (source "Dragonstone.6mb.icon")
                 (dest @default-dest)
                 (newname "Dragonstone.info")
      )
    )
)
(complete Percent)

;copy all the disks to the data directory
(until (= CurrentDisk TotalDisks)
       (set CurrentDisk (+ CurrentDisk 1))
       (message "\n\n\n\n\n\nPlease insert " @app-name " Disk "
                CurrentDisk " into DF0:"
       )
       (working "\n\n\n\nConverting disk " CurrentDisk
                "\n\n\n\nCall one of our boards:\n\n"
                "Neon City:    +31 (0)478012733\n"
                "              +31 (0)478014014\n"
                "Dream Scape:  +31 (0)52552372 \n"
                "State Dreams: +31 (0)204208053\n"
       )
       (run (cat "Read DISK " CurrentDisk " TO " (tackon @default-dest (cat "Dragonstone.D" CurrentDisk) ) )
       )
       (set Percent (+ Percent DiskPercent))
       (complete Percent)
)
(complete 100)
