;Installer V1 For Control Panel 6 
;$VER: ControlPanel6 (160196)
;©Martin Hunt 1996
;
(complete 0)
(set tfsis1 "Amiga Internet Suite Installation\n\n")
(set tfsis2 "Installation Script and Control Panel 6\nby Martin Hunt - martin@mchunt.demon.co.uk\n\n")
(set tfsis3 "\n")
(set tfsis4 "Some Of The Programs In This Archive Are Shareware\n")
(set tfsis5 "Please Register Them\n\n")
(set tfsis6 "")

(set tfsis
  (cat tfsis1 tfsis2 tfsis3 tfsis4 tfsis5 tfsis6)
)

(message tfsis (safe))
(welcome)
;Get Version Info Etc
(set cpu (database "cpu"))
(debug cpu)
(set totmem (database "total-mem"))
(debug totmem)
(set osver (/ (getversion "LIBS:version.library") 65536))

( if (= osver 37) ( (set workbench "2")))
( if (= osver 38) ( (set workbench "2")))
( if (= osver 39) ( (set workbench "3")))
( if (= osver 40) ( (set workbench "3")))
( if (= osver 41) ( (set workbench "3")))
(debug workbench)

(set forh
   (askbool
      (prompt "Are You Installing From Hard Drive or Floppy Disk?")
      (help "Do you really need an explanation?")
      (choices "Hard Drive" "Floppy Disks")
      (default 0)
   )
)

(if (= 1 forh) 
   (
   (set hdlocation 
      (askdir 
         (prompt "Which directory are the necessary archives stored?")
         (help "All the necessary archives must be in the same directory, which you must select here.")
         (default "work:")
      )
   )
   (makeassign "TISAmiga1" hdlocation (SAFE))
   (makeassign "TISAmiga2" hdlocation (SAFE))
   (makeassign "TISAmiga3" hdlocation (SAFE))
   (debug hdlocation)
   (makeassign "TISAmiga4" hdlocation (SAFE))
   ) 
)
   
(set amitcpdir
   (askdir
       (prompt "Where do you want The Internet Suite installed?")
       (help @askdir-help)
       (default "dh1:amitcp")
   )
)

(set @default-dest amitcpdir)
(makeassign "amitcp" amitcpdir
 (safe)
)

(set insamitcp
   (askbool
      (prompt "Do you want to install the Amitcp-4.0b archive?")
      (help "If you haven't installed AmiTCP yet, select yes")
   )
)

(if (= insamitcp 1)
   (
      (Message "Extracting AmiTCP Archive\n\nThis may take a little time\nso be patient")
      (working "Extracting AmiTCP Archive")

      (set dearchiveamitcp "lha e TISAmiga2:amitcp-demo-40.lha amitcp:")
      (run dearchiveamitcp)
      (working "Moving AmiTCP Files")

      (run "rename amitcp:amitcp-4.0/#? all amitcp: quiet")
      (run "delete amitcp:amitcp-4.0/#? quiet")
      (run "delete amitcp:amitcp-4.0.info all quiet")
      (run "delete amitcp:amitcp-4.0 quiet")
      (run "copy amitcp:devs/#? all devs: quiet")
      (run "copy amitcp:l/#? all l: quiet")
      (run "copy amitcp:libs/#? all libs: quiet")
      (run "rename amitcp:db/group-example amitcp:db/group")
      (textfile (dest "t:host.tmp")
         (append "127.0.0.1 localhost\n")
         (append "# Real EoF\n")
      )
      (run "type t:host.tmp >> amitcp:db/hosts")
      (run "delete t:#?.tmp quiet")
   )
)
(complete 15)

(set insppp
   (askbool
      (prompt "Do you want to install PPP?\nIf you haven't already installed PPP you should do so now")
      (help "")
   )
)
(makedir "amitcp:docs")
(if (= insppp 1)
   (
      ;Add PPP extraction commands here
      (set ppparchive
         (askfile 
            (prompt "Select the PPP archive")
            (help "Choose the filename of the ppp archive\nThis installer has been tested with the 1.44 version of the archive but should work with others")
            (default "tisamiga2:ppp1_45.lha")
         )
      )
      (set unarcppp ("lha e %s ram:" ppparchive))          
      (debug unarcppp)
      (run unarcppp)
      (working "Moving PPP files around")
      (run "copy ram:ppp/bin/#? amitcp:bin quiet")
      (run "copy ram:ppp/ppp.guide amitcp:docs quiet")
      (makedir "devs:networks")
      ( if (< cpu 68020) ( (set pppv "000")))
      ( if (> cpu 68019) ( (set pppv "020")))
      ( if (= pppv "000") ((run "copy ram:ppp/devs/ppp.device.000.eval devs:networks/ppp.device")))
      ( if (= pppv "020") ((run "copy ram:ppp/devs/ppp.device.020.eval devs:networks/ppp.device")))
      (textfile
         (dest "t:interfaces")
         (append "#PPP Device Driver Entry\n")
         (append "#TIS Amiga Installation\n")
         (append "ppp0 DEV=DEVS:networks/ppp.device UNIT=0\n")
         (append "#eof for real!\n")
      )

      (run "type t:interfaces >> amitcp:db/interfaces")
      (run "delete ram:ppp all quiet")
      (makedir "env:sana2")
      (makedir "envarc:sana2")
   )
)

(working "Extracting Control Panel 6")
(run "lha e TISAmiga1:cp6.lha ram:")

(copyfiles
   (prompt "Copying Amiconnect to " acdest )
   (help @copyfiles-help)
   (source "ram:cp6/mainprogram")
   (dest "amitcp:bin")
   (all)
   (infos)
)
(complete 25)
(makedir "amitcp:docs"
  (infos)
  (safe)
)

(set docdest "amitcp:docs")

(copyfiles
   (prompt "Copying documentation to " docdest )
   (help @copyfiles-help)
   (source "ram:cp6/docs")
   (dest docdest)
   (infos)
   (all)
)
(copyfiles
   (prompt "Copying PostNews to Amitcp:bin ")
   (help @copyfiles-help)
   (source "ram:cp6/amitcp/bin/postnews.nntpput")
   (dest "amitcp:bin")
   (newname "postnews")
)
(copyfiles
   (prompt "Copying NNTP Put to Amitcp:bin ")
   (help @copyfiles-help)
   (source "ram:cp6/amitcp/bin/nntpput")
   (dest "amitcp:bin")
)
(copyfiles
   (prompt "Copying Sendnews to Amitcp:bin ")
   (help @copyfiles-help)
   (source "ram:cp6/amitcp/bin/sendnews")
   (dest "amitcp:bin")
)

(copyfiles
   (prompt "Copying Common Binaries to Amitcp:bin ")
   (help @copyfiles-help)
   (source "ram:cp6/amitcp/bin/all")
   (dest "amitcp:bin")
   (all)
)


(set popmail
   (askbool 
      (prompt "Do you have POP or SMTP mail?")
      (help "Most systems use POP mail, some such as Demon however use SMTP\nSelect your mail system here")
      (choices "SMTP" "POP")
      (default 0)
   )
)

(if (= popmail 0)
   (
      (Working "Installing AmiPOP")
      (copyfiles 
         (prompt "Copying AmiPOP to Amitcp:bin")
         (help @copyfiles-help)
         (source "ram:cp6/amipop/amipop-amitcp")
         (dest "amitcp:bin")
         (newname "amipop")
      )
      (set mailcmd "setenv ac!mailtype 5")
      (run mailcmd) 
   )
)
(if (= popmail 1)
   (
      (working "Installing SMTP Daemon")

      (copyfiles 
         (prompt "Copying Mail Daemon To Amitcp:serv")
         (help @copyfiles-help)
         (source "ram:cp6/amitcp/serv/in.smtpd")
         (dest "amitcp:serv")
      )
      (run "type ram:cp6/amitcp/db/inetd.conf.add >> amitcp:db/inetd.conf")
      (set mailcmd "setenv ac!mailtype 1")
      (run mailcmd)
   )
)

(set fo 0)
(complete 30)
(copylib
   (prompt "Copying Apig.Library to Libs:" )
   (help @copyfiles-help)
   (source "ram:cp6/Libs/apig.library")
   (dest "Libs:")
   (infos)
   (confirm)
)

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

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

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

(copylib
   (prompt "Copying Rexxdossupport.Library to Libs:" )
   (help @copyfiles-help)
   (source "ram:cp6/Libs/rexxdossupport.library")
   (dest "Libs:")
   (infos)
   (confirm)
)
(complete 35)
(set cp5dest
   (askdir
       (prompt "Where do you want Control Panel 6 to be installed?")
       (help @askdir-help)
       (default "sys:wbstartup")
   )
)

(copyfiles
   (prompt "Copying AmiTCP Control Panel to " @default-dest )
   (help @copyfiles-help)
   (source "ram:cp6/ControlPanel6")
   (dest cp5dest)
   (infos)
   (confirm)
)
(copyfiles
   (prompt "Copying AmiTCP Control Panel to " @default-dest )
   (help @copyfiles-help)
   (source "ram:cp6/c/cp6.exe")
   (dest "c:")
   (confirm)
)
(complete 40)
(makedir "amitcp:cp" (infos) (SAFE))
(set cp5 "amitcp:cp")

(makeassign "CP" cp5
  (safe)
)

(copyfiles
 (prompt "Copying AmiTCP Control Panel's Auxillary Programs to "cp5)
   (help @copyfiles-help)
   (source "ram:cp6/cp")
   (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 "ram:cp6/prefs")
   (all)
   (dest "cp:prefs")
   (infos)
   (confirm)
)

(run "copy cp:prefs/programs.tfs cp:prefs/programs.cp6 quiet")
(run "rename cp:cpis.exe cp:cpis2.exe")

(Copyfiles
      (prompt "Copying AmiTCP Control Panel Main Prefs to s:cp.config")
      (help @copyfiles-help)
      (source "ram:cp6/s/cp.config.amiconnect")
      (dest "s:")
      (confirm)
      (newname "cp.config")
)

(run "delete ram:cp#? all quiet")
(complete 45)
(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)
)


(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: amitcp:usr\n")
(set line2 "assign uunews: amitcp:usr/news\n")
(set line3 "assign uumail: amitcp:usr/mail\n")
(set line4 "assign uuspool: amitcp:usr/spool\n")
(set line5 "assign uulib: amitcp:usr/lib\n")
(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)
)

(run "execute amitcp:bin/amiconnect.dos")

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

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

(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 line5 "alias ftp ncftp\n")

(complete 50)
(message "We must now setup Amiconnect\nWe will start with your User Details"
(help "You need to set up various environment variable so that Amiconnect will function correctly.\nThe following part of the installer will assist in this procedure")
(safe)
)

(set username
   (askstring
      (prompt "Enter Your User Name")
      (help "Your user name is the bit before the @ in you email address\ne.g. USERNAME@nodename.domainname\n\nThis should be a single word")
      (default "John")
   )
)
(set nodename
   (askstring
      (prompt "Enter Your Node Name")
      (help "Your node name is the bit directly after the @ in you email address\ne.g. username@NODENAME.domainname\n\nThis should be a single word")
      (default "unix")
   )
)
(set domainname
   (askstring
      (prompt "Enter Your Doamin Name")
      (help "Your domain name is the last bit of your email address\ne.g. username@nodename.DOMAINNAME\n\nThis should start with a .")
      (default ".tfs.net")
   )
)

(set acemail ("%s@%s%s" username nodename domainname))
(set hostname ("%s%s" nodename domainname))
(if (= insamitcp 1)
 (
   (set ns
     (askstring 
       (prompt "Enter The Ip Address Of Your Providers Nameserver")
       (help "")
       (default "0.0.0.0")
     )
   )
   (set ns1 ("NAMESERVER %s\n" ns)) 
   (set dn1 ("DOMAIN %s\n" domainname))
   (textfile (dest "t:resolv.tmp")
    (append ";NameServer\n")
    (append ns1)
    (append "NAMESERVER 158.152.1.58\n")
    (append "NAMESERVER 193.122.96.33\n")
    (append ";Domain Names\n")
    (append dn1)
    (append "DOMAIN .net\n")
    (append "DOMAIN .co.uk\n")
    (append "DOMAIN .com\n")
    (append "DOMAIN .ac.uk\n")
    (append "DOMAIN .edu\n")
   )
   (run "type t:resolv.tmp >> amitcp:db/resolv.conf")
 )
)
(textfile (dest "envarc:username") (append username))
(textfile (dest "env:username") (append username))
(textfile (dest "envarc:nodename") (append nodename))
(textfile (dest "env:nodename") (append nodename))
(textfile (dest "envarc:domainname") (append domainname))
(textfile (dest "env:domainname") (append domainname))
(textfile (dest "envarc:hostname") (append hostname))
(textfile (dest "env:hostname") (append hostname))

(set home ("amitcp:usr/%s" username))

(makedir home
  (infos)
  (safe)
)

(set line6 ("assign home: %s \n" home))

(startup "CP6"
   (prompt "Adding assigns and paths to s:user-startup")
   (help @startup-help)
   (command line1)
   (command line15)
   (command line2)
   (command line3)
   (command line4)
   (command line5)
   (command line6)
)
(textfile
   (dest "env:ac!home")
   (append home)
)
(complete 55)
(textfile
   (dest "env:ac!email")
   (append acemail)
)

(set realname
   (askstring
      (prompt "Enter Your Real Name")
      (help "This is the name which will be sent with your mail and news messages\nIt helps people see who you really are, if you do not set this you will be known as realname")
      (default "John Smith")
   )
)

(textfile
   (dest "env:realname")
   (append realname)
)
(textfile
   (dest "envarc:realname")
   (append realname)
)

(if (= insamitcp 1)
 (
  (set passline ("%s|*|100|100|%s|%s|shell" username realname home))
  (textfile (dest "amitcp:db/passwd") (append passline))
 )
)

(set userfile (cat username "," realname ",http://www.webzone1.co.uk/www/plymouthweb/," username "," realname))
(textfile (dest "cp:prefs/users") (append userfile))

(complete 60)
(message "We now need to setup your modem details, this may be tricky, so have your modem manual handy."
  (safe)
)

(set serial
   (askfile
      (prompt "What serial device driver are you using?")
      (help "This is the program that allows the Amiga to talk to the modem via your serial port.\n\nThe driver supplied with your Amiga is called serial.device but you are advised to use an improved driver such as artser.device")
      (default "devs:serial.device")
    )
)

(textfile
   (dest "env:ac!serial")
   (append serial)
)

(set devno
   (asknumber
      (prompt "What serial port number are you using?")
      (help "The inbuilt serial port is 0, unless you have an additional serial ports added to your Amiga you should use this port")
      (default "0")
   )
)

(textfile
   (dest "env:ac!devno")
   (append devno)
)

(set bdrte
   (askchoice
      (prompt "What baud rate do you wish to use?")
      (help "This is the rate that your Amiga communicates with the modem.\n\nIf you are using a 14400 modem use 19200 or 38400\nIf you are using a 28800 modem use 38400 or 57600\n\nPlease note a standard Amiga will not cope with rates above 57600.")
      (choices "2400" "4800" "9600" "19200" "38400" "57600" "115200")
      (default 3)
   )
)
(if (= bdrte 0) (set baudrate 2400))
(if (= bdrte 1) (set baudrate 4800))
(if (= bdrte 2) (set baudrate 9600))
(if (= bdrte 3) (set baudrate 19200))
(if (= bdrte 4) (set baudrate 38400))
(if (= bdrte 5) (set baudrate 57600))
(if (= bdrte 6) (set baudrate 115200))
(textfile
   (dest "env:ac!baudrate")
   (append baudrate)
)
(complete 60)
(set slipdev "PPP")

(textfile
   (dest "env:ac!slipdev")
   (append slipdev)
)

(set init
   (askstring
      (prompt "Enter Modem Initialisation String")
      (help "This is the command you send to you modem to reset/initialise it.\n This is nearly always ATZ")
      (default "ATZ")
   )
)

(textfile
   (dest "env:ac!init")
   (append init)
)

(set dial
   (askstring
      (prompt "Enter Your Modems Dial Command")
      (help "This will depend on whether you are connected to a pulse dial exchange or a tone dial compatable exchange\nMost modern exchanges are tone dial and the usual command is ATDT, for pulse dial it is usually ATDP.")
      (default "ATDT")
   )
)

(textfile
   (dest "env:ac!dial")
   (append dial)
)

(set helpdtr "The DTR (Data Terminal Ready) signal tells the modem to drop the call once all data has stopped.\n As amiconnect needs to stop data transmission while it switches from the serial device to the network (slip/ppp) driver, we need to overide")
(set helpdtr2 "this signal.\n\n On a USRobotics Sportster modem this command is AT&d0")

(set helpdtrt
  (cat helpdtr helpdtr2)
)

(set dtr_on
   (askstring
      (prompt "Enter the command to\noveride DTR (Data Terminal Ready)")
      (help helpdtrt)
      (default "AT&d0")
    )
)

(textfile
   (dest "env:ac!dtr_on")
   (append dtr_on)
)

(set dtr_off
   (askstring
      (prompt "Enter the command to disable\n the DTR (Data Terminal Ready) overide")
      (help "This is the command which resets the DTR (Data Terminal Ready) overide to off.\n\nFor a USRobotics Sportster this is AT&d2")
      (default "AT&d2")
    )
)

(textfile
   (dest "env:ac!dtr_off")
   (append dtr_off)
)

(set hang
   (askstring
      (prompt "Enter the command to hang up the modem")
      (help "This command is needed to disconnect your modem call to your service provider, failure to set this correctly could lead to a very large telephone bill!\n\nThe usual command is ATH")
      (default "ATH")
   )
)

(textfile
   (dest "env:ac!hang")
   (append hang)
)

(set cmd
   (askstring
      (prompt "What is the escape code to return your modem to command mode?")
      (help "This command is needed to switch your modem into its command mode in the middle of data transmission. It is referred to commonly as the escape code.\n\nOn USRobotics Sportster Modems it is +++")
      (default "+++")
   )
)

(textfile
   (dest "env:AC!cmd")
   (append cmd)
)

(set dte1 "This is probably the most problematic command to enter.\n In manuals it may be referred to as the DTE Rate, Terminal to Modem, serial port rate or simply Data Rate.")
(set dte2 "\nYou need to set this command so that the data rate is fixed.\n\n On a USRobotics Sportster the command is at&b1\n\nOn some other modems the command is /n")
(complete 65)
(set dtehelp
  (cat dte1 dte2)
)

(set datarate
   (askstring
      (prompt "Enter the command to set the serial port data rate (DTE)")
      (help dtehelp)
      (default "AT&b1")
   )
)

(textfile
   (dest "env:ac!datarate")
   (append datarate)
)

(set ok
   (askstring
      (prompt "What string does your modem return when a command has been completed successfully?")
      (help "This is usually OK.\n\nIf this isn't set correctly Amiconnect will not know whether your modem has completed what it has been asked to do")
      (default "OK")
   )
)

(textfile
   (dest "env:ac!ok")
   (append ok)
)

(textfile
   (dest "env:ac!ipno")
   (append "0.0.0.0")
)


(set gate "0.0.0.0")

(textfile
   (dest "env:ac!gate")
   (append gate)
)

(set defmailserver ("mail%s" domainname))
(set defnewsserver ("news%s" domainname))
(set mailserver
   (askstring
      (prompt "Enter The Name Of Your MailServer")
      (help @askstring-help)
      (default defmailserver)
   )
)
(set newsserver
   (askstring
      (prompt "Enter The Name Of Your News Server")
      (help @askstring-help)
      (default defnewsserver)
   )
)


(textfile
   (dest "env:ac!mailserver")
   (append mailserver)
)

(textfile
   (dest "env:ac!newsserver")
   (append newsserver)
)

(set pop1
   (askstring
      (prompt "Enter the name of your main pop")
      (help "It is suggested that you enter the location of the main pop here such as London.")
      (default "Yourtown")
   )
)

(textfile
   (dest "env:ac!pop1")
   (append pop1)
)

(set phone1
   (askstring
      (prompt "Enter the phone number of your main pop")
      (help "Enter the phone number you usually dial to connect your computer to the internet")
      (default "01234 5678")
   )
)

(textfile
   (dest "env:ac!phone1")
   (append phone1)
)

(set pop2
   (askstring
      (prompt "Enter the name of your backup pop")
      (help "Many providers have additional pops which you may use when your pop is down or engaged, if so enter your second choice of pop here.")
      (default "Yourtown")
   )
)

(textfile
   (dest "env:ac!pop2")
   (append pop2)
)

(set phone2
   (askstring
      (prompt "Enter the phone number of your backup pop")
      (help "Enter the phone number you dial if your first pop is unable to connect your computer to the internet")
      (default "01234 5678")
   )
)

(textfile
   (dest "env:ac!phone2")
   (append phone2)
)


(set login1 "The standard login procedure will cope with most service providers. If your login procedure is similar to that below please use the standard procedure, otherwise you will need to use the advanced login")
(set login2 "\n\nSystem sends login/username prompt, you reply with username\nThe system then sends password prompt, you reply with your password\nThe system then asks what protocol you are using (slip or PPP), you reply either slip or ppp\n")
(set login3 "you are then logged on and on the net.\n\n the actual prompts can be changed but they need to be in the above order and shouldn't have any additional requests for information\n\n")
(set login4 "The advanced login requires you to enter quite a bit of data, so it is advised that if unsure you try the standard login first and then if that fails use the advanced login script to attempt to setup the advanced login.")

(set loginhelp
   (cat login1 login2 login3 login4)
)

(set logintype
   (askbool
      (prompt "Do you want to use the standard or advanced login procedure?\n\n(Please see help for more details)")
      (help loginhelp)
      (choices "Standard Login" "Advanced Login")
      (default 1)
   )
)

(if (= logintype 1)
    ;Standard login clauses
   (
      (set acprompt
         (askstring
            (prompt "Enter login prompt")
            (help "This is the initial prompt which is usually Login: or User:\nIt is often advisable to miss off the first character so login: would be ogin:")
            (default "ogin:")
         )
      )
      (textfile
         (dest "env:ac!prompt")
         (append acprompt)
      )
      (set loginname
         (askstring
            (prompt "Enter your response to the login prompt")
            (help "This is usually your username or your nodename")
            (default username)
         )
      )
      (textfile
         (dest "env:ac!loginname")
         (append loginname)
      )
      (set passprompt
         (askstring
            (prompt "Enter the prompt that requests your password")
            (help "What text is displayed just before you usually enter your password?\nThis is usually pass: or password:")
            (default "assword:")
         )
      )
      (textfile
         (dest "env:ac!passprompt")
         (append passprompt)
      )
      (set password
         (askstring
            (prompt "Enter your password")
            (help "What do you type when asked for your password")
            (default "********")
         )
      )
      (textfile
         (dest "env:ac!password")
         (append password)
      )
      (textfile 
   (dest "env:ac!loginscript")
             (append "NOCUSTOMSCRIPTNEEDED")
      )
      (set protocol
         (askstring
            (prompt "Enter the protocol prompt")
            (help "This is the prompt that asks what protocol you are using.\nAmiconnect will reply to this prompt with either slip or ppp depending on how you set up the modem details")
            (default "rotocol:")
         )
      )
      (textfile
         (dest "env:ac!protocol")
         (append protocol)
      )
   )

   (

      (set sendcmd "#")

      (textfile
         (dest "amitcp:db/aclogonscript")
      )

      (until (= sendcmd "\0")
        (
         (set rcvcmd
            (askstring
               (prompt "Enter Prompt\n\n(leave blank to exit dialscript editor)")
               (help "Enter the text which your internet provider has sent for you to reply to, e.g. login:")
            )
         )

         (set sendcmd
            (askstring
               (prompt "Enter Response To Prompt - " rcvcmd " \n\n(leave blank to exit dialscript editor)")
               (help "Enter the text which you send after receiving the prompt mentioned in previous data entry box")
            )
         )
         (debug rcvcmd sendcmd)

         (if (and (= rcvcmd "\0") (= sendcmd "\0"))

                 (set fred "fred")

                 (
                   (textfile
                     (dest "t:dialtest")
                     (append rcvcmd)
                     (append "\n")
                     (append sendcmd)
                     (append "\n")
                   )
                   (run "type t:dialtest >> amitcp:db/aclogonscript")
                   (textfile
                       (dest "env:ac!loginscript")
                       (append "amitcp:db/acloginscript")
                   )
                 )

         )
        )
     )

   )
)

(run "copy env:ac!#? envarc:")
(run "copy env:realname envarc:")

(set insconfig
   (askbool
      (prompt "Do you wish to setup your uulib:config file?\n\nIf you have not already configured this file you must do so now")
      (help "This file is crucial, you need it")
      (default 1)
   )
)
(if (= insconfig 1)
  (
      (set line1 ("UserName   %s" username))
      (set line2 ("RealName   %s" realname))
      (set line3 ("Nodename   %s" nodename))
      (set line4 ("Hostname   %s" hostname))
      (set organisation "http://www.webzone1.co.uk/www/plymouthweb/")
      (set line5 ("Organization   %s" organisation))
      (set tz 
         (askstring 
            (prompt "Enter Your Timezone i.e. GMT,CST,CET,EST etc.")
            (help @askstring-help)
            (default "GMT")
         )
      )
   
      (set line6 ("Timezone   %s" tz))
      (set defaultnode mailserver)
      (set line7 ("DefaultNode   %s" defaultnode))
      (set line8 ("NNTPServer   %s" newsserver))
      (set line9 ("ReplyPrefix   >"))
      (set line10 ("MailEditor   c:ed"))
      (set line11 ("NewsEditor   c:ed"))
      (set line12 ("RMail   amitcp:bin/rmail"))
      (set line13 ("SendMail   amitcp:bin/sendmail"))

      (set nl "\n")
      (textfile
         (dest "uulib:config")
         (append line1)
         (append nl)
         (append line2)
         (append nl)
         (append line3)
         (append nl)
         (append line4)
         (append nl)
         (append line5)
         (append nl)
         (append line6)
         (append nl)
         (append line7)
         (append nl)
         (append line8)
         (append nl)
         (append line9)
         (append nl)
         (append line10)
         (append nl)
         (append line11)
         (append nl)
         (append line12)
         (append nl)
         (append line13)
      )
   )
)

(complete 75)
;Extract and setup Mail


(set fred 0)
(if (= fred 1)
   (
;check for mui if not warn
(working "Checking For MUI")

(set mui (exists "mui:libs/muimaster.library"))
(set mui2 (exists "libs:muimaster.library"))
(set muiinstalled (+ mui mui2))

(if (= muiinstalled 0)
   (message "Warning:\n\nYou Will Need MUI To Run Amosaic\n\n I will install Amosaic but it won't\nwork until you install MUI"))

;setup Amosaic
(working "Extracting AMprefs.lha")
(run "lha e TISAmiga1:amprefs.lha ram:")
(run "copy ram:amprefs/amp#? sys:prefs quiet")
(run "copy ram:amprefs/README amitcp:docs/AMPrefs.readme quiet")
(run "copy ram:amprefs/README.info amitcp:docs/AMPrefs.readme.info quiet")
(run "delete ram:ampref#? all quiet")
(if (= workbench "2")
   (
      (Working "Install Amosaic1.2 for WB2")
      (run "lha e TISAmiga1:Mosaic-1.2.1-AmiTCP.lha ram:")
      (run "copy ram:mosaic-1.2.1-AmiTcp amitcp:bin/amosaic quiet")
      (run "copy ram:mosaic-1.2.1-AmiTCP.readme amitcp:docs quiet")
      (run "copy ram:print.www s: quiet")
      (run "delete ram:mos#? quiet")
      (run "delete ram:print.www quiet")
      (working "Amosaic Extracted")
   )
)
(if (= workbench "3")
   (
      (Working "Install Amosaic2 for WB3+")
      (run "lha e TISAmiga1:AMosaic2.lha ram:")
      (run "copy ram:Amosaic-AmiTcp amitcp:bin/amosaic quiet")
      (run "copy ram:Amosaic-AmiTCP.info amitcp:bin/amosaic.info quiet")
      (run "copy ram:readm#? amitcp:docs quiet")
      (run "delete ram:readm#? quiet")
      (run "delete ram:Amosaic#? quiet")
      (working "Amosaic Extracted")
      (working "Now We Need To Extract ZGif")
      (complete 90)
      ; setup zgif
      (run "lha e TISAmiga1:ZGIFDT39_16.lha ram:")
      (run "copy ram:gif.datatype sys:classes/datatypes/ quiet")
      (run "copy ram:datatypes/gi#? devs:datatypes/ quiet")
      (run "copy ram:zgifdatat#? amitcp:docs quiet")
      (run "delete ram:datatyp#? all quiet")
      (run "delete ram:gif.datatype quiet")
      (run "delete ram:zgif#? quiet")
      (working "ZGif Datatype Installed")
   )   
)
))
(if (= insamitcp 1)
   (
      (set pm ("Postmaster: %s" username))
      (textfile
         (dest "t:tmpaliases")
         (append pm)
      )
   
      (run "type t:tmpaliases >> uulib:aliases")
   )
)
(set installgrn 
   (askbool
      (prompt "Do you wish to install the GRn Newsreader?")
      (help "have you the archive Grn-2.1a.lha?\ndo you want it installed?\n\nThis program will allow you to read the usenet messages")
   )
)
(if (= installgrn 1)
   (
      (welcome "Installing Grn Newsreader")
      (run "lha -r -x x tisamiga3:Grn-2.1a.lha")
      (run "copy ram:grn-2.1a/fonts fonts: all clone quiet")
      (run "copy ram:grn-2.1a/grn.amitcp amitcp:bin/grn clone quiet")
      (run "copy ram:grn-2.1a/grn.info amitcp:bin clone quiet")
      (run "copy ram:grn-2.1a/grn.guide amitcp:docs clone quiet")
   
   )
)

(run "path amitcp:bin add")
(run "path cp: add")

(complete 95)
;Register Messages
(set cp1 "Control Panel 6 Is Shareware\nby Martin Hunt - Martin@mchunt.demon.co.uk\n")
(set cp2 "The UK Fee is £10 standard or £20 delxe\n")
(set cp3 "The US Fee is $20 standard or $40 deluxe\n\n")
(set regmessage (cat cp1 cp2 cp3))
(message regmessage)
(exit "Please Read Amitcp:docs/cp6.guide\n&\namitcp:docs/controlpanelprefs.guide\nfor useage instructions\n\nCP6 - Martin Hunt 1996")

