;;
;; Install_Istar - Istar installation script for Installer
;;
;; Copyright © Andrew Basden, November 1997
;;
;;     Installer and Installer project icon
;;     (c) Copyright 1991-93 Commodore-Amiga, Inc.  All Rights Reserved.
;;     Reproduced and distributed under license from Commodore.
;;
;;     INSTALLER SOFTWARE IS PROVIDED "AS-IS" AND SUBJECT TO CHANGE;
;;     NO WARRANTIES ARE MADE.  ALL USE IS AT YOUR OWN RISK.  NO LIABILITY
;;     OR RESPONSIBILITY IS ASSUMED.
;;

;; -- IstarSys directory

(set @path
  (askdir 
     (default "work:")
     (prompt "Where do you want to install the Istar program and its system files? (A new Istar diretory will be created for them.)\n\nThe system files include preferences files and a Docs drawer.\n\nNote: If installation goes wrong, manual installation is easy: follow Install.Readme.")
    (help @makedir-help)
  )
)

(set @istarsys (tackon @path "Istar"))

(if (NOT (exists @istarsys)))
  (makedir @istarsys 
    (infos)
  )

;; -- The User directory

(set @user
  (askdir 
     (default @istarsys)
     (prompt "Where do you want the user directories to go?\n\nOften this is in the same directory as the Istar program, but you can place it elsewhere.")
    (help "The user directories include: KBs, Templates, Dump")
  )
)

;; -- Copy the system

(copyfiles
  (prompt "Copy the Istar program?")
  (help "This will copy the Istar program and its icon")
  (source "")
  (dest @istarsys)
        (pattern "Istar")
  (files)
        (infos)
  (confirm)
)

(copylib
  (prompt "Install iff library?")
  (help "IFF library reads pictures.  You should normally Proceed here.")
  (source "iff.library")
  (dest "libs:")
  (confirm)
)

(copyfiles
  (prompt "Copy the Istar Preferencess files?")
  (help "This will copy several preferences files, overwriting any you have of the same name.  Unless you have specially altered versions, you should normally say Proceed here.")
  (source "")
  (dest @istarsys)
        (pattern "Istar#?")
  (files)
        (infos)
  (confirm)
)

(set @docs (tackon @istarsys "Docs"))

(if (NOT (exists @docs)))
  (makedir @docs 
    (infos)
  )

(copyfiles
  (prompt "Copy the Knowledge Engineer Documentation files?")
  (help "This will copy the Docs drawer and sub-drawers.  They are all .html.  You should do this.")
  (source "docs")
  (dest @docs)
        (pattern "#?")
  (files)
        (infos)
  (confirm)
)

(copyfiles
  (prompt "Copy the User Documentation files?")
  (help "This will copy three .html files of documentation for run-time users.")
  (source "")
  (dest @istarsys)
        (pattern "#?.html")
  (files)
        (infos)
  (confirm)
)

;; -- Copy over the user sample stuff

(set @user_kb (tackon @user "KBs"))

(if (NOT (exists @user_kb)))
  (makedir @user_kb 
    (infos)
  )

(set @user_tmpl (tackon @user "Templates"))

(if (NOT (exists @user_tmpl)))
  (makedir @user_tmpl 
    (infos)
  )

(set @user_dump (tackon @user "Dump"))

(if (NOT (exists @user_dump)))
  (makedir @user_dump 
    (infos)
  )

(copyfiles
  (prompt "Copy the sample knowledge bases?  You should Proceed here if you are going to set up the Knowledge Server facility.")
  (help "This will copy example KBs.  Some are used in the tutorials.  It will also copy the Knowledge Server control file, .serverkbs, and descriptions of the KBs used by the Knowledge Server.")
  (source "KBs")
  (dest @user_kb)
        (pattern "#?")
  (files)
        (infos)
  (confirm)
)

(set @istar-assign (cat "assign IstarSys: " @istarsys "\nassign KBTools:" @user))
(startup "Istar"
  (prompt "Istar assigns needs to be added to the \"S:user-startup\".")
  (help "Not strictly necessary, but avoids annoying requesters.  The assigns made are to IstarSys, where various system files are found, and KBTools, where various user directories are sought: KBs, Dump, Templates")
  (command @istar-assign)

)

