;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 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"
)

(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 \nusr,news,mail,spool and lib directories\nIf this is your first AmiTCP setup\n just use the defaults\nif not specify your current directories" (SAFE))

(set usrdir
   (askdir
       (prompt "Where is your usr: directory")
       (help "This is the directory where all your \n news,mail,lib,spool directories are usually kept")
       (default "amitcp:usr")
   )
)

(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 line1 ("assign usr: %s \n" usrdir))
(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))
(set line6 ("assign inet: amitcp: \n"))

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

(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)
)

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

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

(run "ac:amiconnect"
   (safe)
)

(message "Showing Postnews.doc, important information about posting news"
(safe)
)
(run "sys:utilities/more amitcp:bin/postnews.doc"
  (safe)
)

