; Installation script for Twilight Development System
; $VER: Install-TDS 1.99 (10.02.94)

(set @default-dest "WORK:")

(if (< (/ (getversion) 65536) 37)
  (abort "This program requires Kickstart 2.04 or greater to run !")
)

(set destdir
  (askdir
    (prompt "Select where to install TDS")
    (help @askdir-help)
    (default @default-dest)
    (newpath)
  )
)

(set @default-dest
  (tackon destdir "TDS")
)

(makedir @default-dest
  (prompt "Creating Drawer TDS")
  (help @makedir-help)
  (infos)
)

(copylib
  (prompt "Installing Twilight Editor")
  (help @copylib-help)
  (source "Ted")
  (dest @default-dest)
  (infos)
  (confirm)
)

(copylib
  (prompt "Installing Twilight Make")
  (help @copylib-help)
  (source "TMake")
  (dest @default-dest)
  (infos)
  (confirm)
)

(copylib
  (prompt "Installing Twilight Reference Generator")
  (help @copylib-help)
  (source "TRefs")
  (dest @default-dest)
  (confirm)
)

(copyfiles
  (prompt "Installing Ted Frontend")
  (help @copyfiles-help)
  (source "Ed")
  (dest @default-dest)
  (confirm)
)

(copyfiles
  (prompt "Installing Converters")
  (help @copyfiles-help)
  (source "converters")
  (all)
  (dest (tackon @default-dest "converters"))
  (confirm)
)

(copyfiles
  (prompt "Installing TDS.guide")
  (help @copyfiles-help)
  (source "TDS.guide")
  (dest @default-dest)
  (infos)
  (confirm)
)

(if
  (exists "keyfile")
  (copyfiles
    (prompt "Installing Keyfile")
    (help @copyfiles-help)
    (source "keyfile")
    (dest @default-dest)
    (confirm)
  )
)

(copylib
  (prompt "Installing reqtools.library")
  (help @copylib-help)
  (source "libs/reqtools.library")
  (dest "Libs:")
  (confirm)
)

(copyfiles
  (prompt "Installing Icons")
  (help @copyfiles-help)
  (source "env/tds")
  (pattern "#?.info")
  (dest "envarc:tds")
  (confirm)
)

(copyfiles
  (prompt "Installing Catalogs")
  (help @copyfiles-help)
  (source "catalogs")
  (all)
  (dest (tackon @default-dest "catalogs"))
  (confirm)
)

(if 
  (askbool (prompt "Do you want to install the example projects ?")
           (help "The example projects show how to use the features"
                 " of the TDS for building new projects"
           )
  )
  (copyfiles
    (prompt "Installing Examples")
    (help @copyfiles-help)
    (source "examples")
    (all)
    (dest (tackon @default-dest "Examples"))
    (infos)
    (confirm)
  )
)

(startup "TDS"
  (prompt "Do you want to modify the user-startup ?")
  (help @startup-help)
  (command "assign TDS: " @default-dest)
)

(makeassign "TDS" @default-dest)

