;$VER: BattleShips install script v1.0

(complete 0)
(set @default-dest "Work:")

; Texts

(set #Intro-Txt
   (cat "\n\nWelcome to \n"
        "BattleShips\n"
        "Hard Disk Install Script\n\n"
        "You will require a maximum of 1 MB free."
))
(set #Path-Txt
   (cat "Select the target directory. A directory called\n"
        "BShips will be created there."
))
(set #Path-Help
   (cat "\nThis section lets you choose the "
      "target directory to install BattleShips. \n\n"
      "A directory BShips will be created there.\n\n"
      "Default is Work:\n\n\n"
      @askdir-help
))
(set #sortsfx-text
   (cat "\nNow running SortSFX\n"
        "to reorganise the SFX\n"
        "drawer.\n\n"
        "Please Wait."
))
; Main 

(message #Intro-Txt)
(set target 
   (askdir
      (prompt #Path-Txt)
      (help #Path-Help)
      (default @default-dest)
      (newpath)
))
(set @default-dest target)

(makedir
   (tackon target "BShips")
   (infos)
)

(copyfiles
   (source "Battleships")
   (dest
      (tackon target "BShips")
))

(complete 33)

(copyfiles
   (source "SortSFX")
   (dest
      (tackon target "BShips"))
)

(complete 35)

(copyfiles
   (source "BShips.Guide")
   (dest
      (tackon target "BShips"))
)

(complete 40)

(copyfiles
   (source "Install-BShips")
   (dest
      (tackon target "BShips"))
)

(complete 45)

(makedir
   (tackon target "BShips/SFX")
)

(copyfiles
   (prompt "Selct SFX to copy.")
   (help @copyfiles-help)
   (source "SFX")
   (dest (tackon target "BShips/SFX"))
   (pattern "#?")
   (files)
   (confirm)
)

(complete 95)

(set icontype
   (askchoice
      (prompt "Which icon type do you prefer?")
      (help @askchoice-help)
      (choices "Standard" "Magic Workbench")
   )
)

(if (= icontype 0)
   (copyfiles
      (source "Icons-WB")
      (dest (tackon target "BShips"))
      (pattern "#?.info")
   )
   (copyfiles
      (source "Icons-MWB")
      (dest (tackon target "BShips"))
      (pattern "#?.info")
   )
)

(complete 99)

(set @execute-dir (tackon target "BShips"))

(message #sortsfx-text)

(run "SortSFX")

(complete 100)
