(welcome "Welcome to the DMS-gui installer.")

(set @app-name "DMS-gui")
(set tmp @user-level)
(user 2)

;------------------------------------------
(set sourc
  (askdir
    (prompt "Please select where you have un-arced this.")
    (help @askdir-help)
    (default "ram:")
    (newpath)
    (disk)

  )
)
;

(set instdir
   (askdir
      (prompt "Please select a destination path for DMS-gui.")
      (help @askdir-help)
      (default "Workbench:")
      (newpath)
      (disk)
   )
)
;******************************************
(if ( = (exists instdir (noreq)) 1)   ;if selected path is a file...
   ;then delete file and make dir
   (
      (set tmp @user-level)
      (user 2)
      (delete instdir 
         (prompt ("\n\"%s\" exists as a file.\n\nDelete and continue?" instdir))
         (help "\nSelecting \"Proceed\" will delete the existing file.  "
              "Selecting \"Abort Install\" will cancel operation.  "
              "Install again in either Intermediate or Expert level to change the installation path.")
         (confirm) 
         (optional "askuser")
      )
      (user tmp)
      (makedir instdir
         (prompt ("creating directory \"%s\"" instdir))
         (help @makedir-help)
         (infos)
         (confirm)
      )
   )
   ;else
   (
      (if ( = (exists instdir (noreq)) 0)   ;if selected path doesn't exist...
         ;then create dir
         (makedir instdir
            (prompt ("creating directory \"%s\"" instdir))
            (help @makedir-help)
            (infos)
            (confirm)
         )
         ;else directory is already there - use it.
         ;()
      )
   )
)
(set @default-dest instdir)
(    (copyfiles
      (source sourc)
      (dest instdir)
      (pattern "DMS#?")
      (files)
      (infos)
     )
)
;
(
  (copylib
   (prompt "Checking for the reqtools.library.")
   (source "reqtools.library")
   (dest "libs:")
   (help @copylib-help)
   (confirm)
  )
)
;
(
(set fmsdest
 (askdir
  (prompt "Where do you want the FF0: (unit0) file ?")
  (help @askdir-help)
  (default "workbench:")
  (newpath)
  (disk)
 )
)
(
 (copyfiles
  (source sourc)
  (dest "devs:")
  (prompt "Copying files...")
  (pattern "fmsdisk#?")
  (files)
 )
  (startup "FMS"
   (prompt "Adding assign to user-startup.")
   (help @append-help)
   (command "assign fms: " fmsdest)
  )
)
)
