; .-------------------------------------------------.
; |    Install script for GOldNEST, $VER: 0.20      |
; `-------------------------------------------------'

    (message "\n\nThis script will install GOldNEST to the selected device/drawer\n\n>-----------------------------<\n\n(C) 1998 Lennart Johannesson\n95lenjo@ostrabo.uddevalla.se\n")

    (complete 10)

;***************************************************************************
;* MAKES THE "GOldNEST" DIRECTORY
;***************************************************************************

    (set dest_dir
      (tackon (askdir
                (prompt "Where would you like to install GOldNEST?\n"
                        "A drawer called GOldNEST will be created.")
                (help @askdir-help)
                (default "ram:")
                (disk)
              )
              "GOldNEST"
      )
    )

    (set @default-dest dest_dir)
    (makedir dest_dir)

    (Complete 20)

;***************************************************************************
;* DELETES OLD STUFF (IF PRESENT)
;***************************************************************************
(if (= (exists (tackon dest_dir "Start_GOldNEST") (noreq)))
 (delete (tackon dest_dir "Start_GOldNEST")))
(if (= (exists (tackon dest_dir "Start_GOldNEST.info") (noreq)))
 (delete (tackon dest_dir "Start_GOldNEST.info")))
(if (= (exists (tackon dest_dir "GOldNEST.exe") (noreq)))
 (delete (tackon dest_dir "GOldNEST.exe")))

;***************************************************************************
;* ASKS FOR ICONTYPE TO INSTALL
;***************************************************************************

    (set icont
       (askchoice
         (prompt "Which icon type would you like?")
         (choices
               "MagicWB  (8col / HiresLace)"
               "SmalMWB  (8col / Hires)"
               "Normal   (4col / HiresLace)"
               "Smal     (4col / Hires)"
               "NewIcons (Not Available Yet!)"
         )
         (help @askchoice-help)
         (default 0)              
       )
    )

    (Complete 30)

;***************************************************************************
;* COPIES THE GOldNEST EXECUTABLE TO THE DESTINATION DIRETORY
;***************************************************************************

    (copyfiles
      (source "GOldNEST")
      (dest (dest_dir))
    )

    (Complete 60)

;***************************************************************************
;* COPIES THE GOldNEST GUIDE FILE TO THE DESTINATION DIRETORY
;***************************************************************************

    (copyfiles
      (source "GOldNEST.Guide")
      (dest (dest_dir))
    )

    (Complete 85)

;***************************************************************************
;* CREATES AND COPIES THE CONTENTS OF THE PALETTE DIRECTORY
;***************************************************************************

    (makedir (tackon dest_dir "Palettes"))
    (copyfiles
      (source "Palettes")
      (all)
      (dest ((tackon dest_dir "Palettes")))
    )

    (Complete 90)
    
;***************************************************************************
;* DEFINE ICON DRAWERS AND INSTALLS THE CORRECT ONES
;***************************************************************************

    (if (= icont 0) (set icontype "MagicWB"))
    (if (= icont 1) (set icontype "SmalMWB"))
    (if (= icont 2) (set icontype "Normal"))
    (if (= icont 3) (set icontype "Smal"))
    (if (= icont 4) (set icontype "MagicWB")) ; Change when NewIcons are added

    (copyfiles (source ("icons/%s/GOldNEST.Guide.info" icontype)) (dest dest_dir))
    (copyfiles (source ("icons/%s/Start_GOldNEST.info" icontype)) (newname ("GOldNEST.info")) (dest dest_dir))
    (copyfiles (source ("icons/%s/GOldNEST.info" icontype)) (dest (tackon dest_dir "/")))

    (complete 100)

    (exit)
