;Installer V2 For AmiTCP Control Panel V5.2
;
;©Martin Hunt 1995
;
;


(set amitcpdir
   (askdir
       (prompt "Where is AmiTCP installed?")
       (help @askdir-help)
       (default "dh1:amitcp")
   )
)

(makeassign "amitcp" amitcpdir
 (safe)
)

(set cp5dest
   (askdir
       (prompt "Where do you want Control Panel 5 to be installed?")
       (help @askdir-help)
       (default "sys:wbstartup")
   )
)

(copyfiles
   (prompt "Copying AmiTCP Control Panel to " @default-dest )
   (help @copyfiles-help)
   (source "ControlPanel5")
   (dest cp5dest)
   (infos)
)
(copyfiles
   (prompt "Copying AmiTCP Control Panel to " @default-dest )
   (help @copyfiles-help)
   (source "cp5.exe")
   (dest "c:")
)

(set cp5
   (askdir
       (prompt "Where do you want CP5's scripts to be installed?")
       (help @askdir-help)
       (default "amitcp:cp")
   )
)

(makeassign "CP" cp5
  (safe)
)

(copyfiles
 (prompt "Copying AmiTCP Control Panel Scripts and Commands to "cp5)
   (help @copyfiles-help)
   (source "bin")
   (all)
   (dest cp5)
   (infos)
   (confirm)
)

(makedir "cp:prefs"
  (prompt)
  (infos)
  (safe)
)

(Copyfiles
(prompt "Copying AmiTCP Control Panel Default Prefs to "cp5"/prefs")
   (help @copyfiles-help)
   (source "prefs")
   (all)
   (dest "cp:prefs")
   (infos)
   (confirm)
)

(Copyfiles
(prompt "Copying AmiTCP Control Panel Main Prefs to s:cp.config")
   (help @copyfiles-help)
   (source "s")
   (all)
   (dest "s:")
   (infos)
   (confirm)
)

(copylib
   (prompt "Copying Apig.Library to Libs:" )
   (help @copyfiles-help)
   (source "Libs/apig.library")
   (dest "Libs:")
   (infos)
   (confirm)
)
(copyfiles
 (prompt "Copying More To Ram")
   (help @copyfiles-help)
   (source "sys:utilities/more")
   (dest "ram:")
   (SAFE)
)
(copyfiles
 (prompt "Copying More To Ram")
   (help @copyfiles-help)
   (source "docs/connectionsetup")
   (dest "t:")
   (SAFE)
)

(message "Adding Assigns To S:user-startup")

(set intro (";BEGIN CP5 \n"))
(set line1 ("Assign Amitcp: %s \n" amitcpdir))
(set line15 ("Assign Inet: %s \n" amitcpdir))
(set line2 ("Assign Cp: %s \n" cp5))
(set line3 ("path amitcp:bin add \n"))
(set line4 ("path cp: add \n"))
(set end (";END CP5 \n"))

(textfile
   (dest "t:userstartup")
   (append intro)
   (append line1)
   (append line15)
   (append line2)
   (append line3)
   (append line4)
   (append end)
)

(run "type t:userstartup >> s:user-startup"
)

(run (cat "run ram:more") (tackon "t:" "connectionsetup")
(PROMPT "Display Connection Setup Doc") (HELP "Not much help, am I") (SAFE)
(CONFIRM))

(run "cp:controlpanelprefs main"
   (prompt "Starting Main Preference Editor" )
   (help "FRED")
   (confirm)
   (safe)
)

(run "cp:controlpanelprefs programs"
   (prompt "Starting Program Preference Editor" )
   (help "FRED")
   (confirm)
   (safe)
)

(run "cp:controlpanelprefs options"
   (prompt "Starting Options Preference Editor" )
   (help "FRED")
   (confirm)
   (safe)
)

(run "cp:controlpanelprefs Edit"
   (prompt "Starting EditFile Preference Editor" )
   (help "FRED")
   (confirm)
   (safe)
)

(run "cp:controlpanelprefs POPS"
   (prompt "Starting PoP Preference Editor" )
   (help "FRED")
   (confirm)
   (safe)
)

(run "cp:changeuser.exe"
   (prompt "Starting User Editor" )
   (help "RTFM!")
   (CONFIRM)
)
