;Installer V1.1 For Amiconnect V1
;
;©Martin Hunt 1995
;
;

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

(makeassign "amitcp" amitcpdir
 (safe)
)

(set acdest
   (askdir
       (prompt "Where do you want Amiconnect to be installed?")
       (help @askdir-help)
       (default "amitcp:bin")
   )
)

(makeassign "ac" acdest
(safe)
)

(copyfiles
   (prompt "Copying Amiconnect to " acdest )
   (help @copyfiles-help)
   (source "mainprogram")
   (dest acdest)
   (all)
   (infos)
)

(makedir "amitcp:docs"
  (infos)
  (safe)
)

(set docdest
   (askdir
       (prompt "Where do you want Amiconnects Doc File to be installed?")
       (help @askdir-help)
       (default "amitcp:docs")
   )
)

(copyfiles
   (prompt "Copying Amiconnect Docs to " docdest )
   (help @copyfiles-help)
   (source "docs/amiconnect.guide")
   (dest docdest)
   (infos)
)

(copyfiles
   (prompt "Copying Amiconnect Docs to amitcp:docs")
   (help @copyfiles-help)
   (source "docs/amiconnect.guide")
   (dest "amitcp:docs")
   (infos)
)


(copyfiles
 (prompt "Copying News and Mail stuff to Amitcp:bin ")
   (help @copyfiles-help)
   (source "amitcp/bin")
   (all)
   (dest "amitcp:bin")
   (infos)
   (confirm)
)

(copyfiles
 (prompt "Copying Mail Server to Amitcp:serv ")
   (help @copyfiles-help)
   (source "amitcp/serv")
   (all)
   (dest "amitcp:serv")
   (infos)
   (confirm)
)

(copyfiles
 (prompt "Copying Mail Server Inetd Entry to t: ")
   (help @copyfiles-help)
   (source "amitcp/db/inetd.conf.add")
   (dest "t:")
   (infos)
)

(run "type t:inetd.conf.add >> amitcp:db/inetd.conf"
   (safe)
)

(copylib
   (prompt "Copying Apig.Library to Libs:" )
   (help @copyfiles-help)
   (source "Libs/apig.library")
   (dest "Libs:")
   (infos)
   (confirm)
)

(copylib
   (prompt "Copying Rexxserdev.Library to Libs:" )
   (help @copyfiles-help)
   (source "Libs/rexxserdev.library")
   (dest "Libs:")
   (infos)
   (confirm)
)

(copylib
   (prompt "Copying Rexxreqtools.Library to Libs:" )
   (help @copyfiles-help)
   (source "Libs/rexxreqtools.library")
   (dest "Libs:")
   (infos)
   (confirm)
)

(copylib
   (prompt "Copying Rexxsupport.Library to Libs:" )
   (help @copyfiles-help)
   (source "Libs/rexxsupport.library")
   (dest "Libs:")
   (infos)
   (confirm)
)

(makedir "amitcp:usr"
  (infos)
  (safe)
)
(makedir "amitcp:usr/mail"
  (infos)
  (safe)
)
(makedir "amitcp:usr/news"
  (infos)
  (safe)
)
(makedir "amitcp:usr/spool"
  (infos)
  (safe)
)
(makedir "amitcp:usr/lib"
  (infos)
  (safe)
)
(message "I now need to setup your news,mail,spool and lib directory\nIf this is your first AmiTCP setup just use the defaults\nif not specify your current directories" (SAFE))

(set uunewsdir
   (askdir
       (prompt "Where is your uunews: directory")
       (help "This is the directory where all your \n news articles will be stored")
       (default "amitcp:usr/news")
   )
)
(set uumaildir
   (askdir
       (prompt "Where is your uumail: directory")
       (help "This is the directory where all your \n mail will be stored")
       (default "amitcp:usr/mail")
   )
)
(set uulibdir
   (askdir
       (prompt "Where is your uulib: directory")
       (help "This is the directory where various files are stored/n including your newsgroup, signature, header and config files/n/n It is NOT your libs: library directory")
       (default "amitcp:usr/lib")
   )
)
(makeassign "uulib" uulibdir (SAFE))
(set uuspooldir
   (askdir
       (prompt "Where is your uuspool: directory")
       (help "This is the directory where all your \n outgoing mail, news and the incoming news batchfile \nwill be stored")
       (default "amitcp:usr/spool")
   )
)

(set intro ("; This file contain assigns to important directories\n"))
(set intro2 ("; You may need to change the from what values are set\n"))
(set firststline ("path amitcp:bin add \n"))
(set line2 ("assign uunews: %s \n" uunewsdir))
(set line3 ("assign uumail: %s \n" uumaildir))
(set line4 ("assign uuspool: %s \n" uuspooldir))
(set line5 ("assign uulib: %s \n" uulibdir))

(textfile
   (dest "amitcp:bin/amiconnect.dos")
   (append intro)
   (append intro2)
   (append firstline)
   (append line2)
   (append line3)
   (append line4)
   (append line5)
)

(textfile
   (dest "t:newsgroups")
   (append "comp.sys.amiga.announce 7\n")
   (append "comp.sys.amiga.misc 7\n")
   (append "demon.ip.support.amiga 7\n")
)

(textfile
   (dest "uulib:seq")
   (append "1")
)

(textfile
   (dest "t:tmpaliases")
   (append "Postmaster: $user")
)

(run "type t:tmpaliases >> uulib:aliases"
   (safe)
)

(copyfiles
 (prompt "Copying config to uulib:config ")
   (help @copyfiles-help)
   (source "lib/config")
   (dest "uulib:")
   (confirm)
)

(run "type t:newsgroups >> uulib:newsgroups"
   (safe)
)

(message "Starting Amiconnect Configuration Program"
 (SAFE)
)

(run "ac:amiconnect"
   (safe)
)

