; Installer Script for MCF4AmIRC Version 4.2
; $VER: Install_MCF V_4.2 (12.08.96)
(set @def-dest1 "Rexx:")
(set @def-dest2 "AmiTCP:help")
(set @def-dest3 "ENVARC:")
(set @def-dest4 "AmiTCP:Doc")

(set #Hello
(cat "\nWelcome to the Installer Proceedure for MCF for AmIRC"
     " Before using this Installer, you should really read the"
     " documentation first so that you have a better understanding"
     " of what MCF is and how it actually works.  It will also"
     " make the installation process easier to understand."
))

(set #config-player
(cat "\nSelect the program that you wish to us to play sounds."
     " The current default is 'Play16' since this works fine"
     " when you are connected to the net.  The directory path"
     " of your sound play cannot have any spaces in it's name.\n"
))

(set #config-sounds
(cat "\nSelect the directory which contains the sound files"
     " you want to be available for playing thru MCF.  This"
     " directory name cannot have any spaces in it's name.\n"
))

(set #config-o-ajoin
(cat "\nDo you wish to Automacially join a channel when you receive"
     " an Invite to it?\n(default 'Y')\n"
))

(set #config-o-fserv
(cat "\nDo you wish to turn the File Server feature ON?\n(default 'N')\n"
))

(set #config-o-ops
(cat "\nDo you wish to turn Auto OPs ON?\n (default 'Y')\n"
))

(set #config-o-rcmds
(cat "\nDo you wish to turn Remote Commands ON?\n(default 'Y')\n"
))

(set #config-o-sounds
(cat "\nDo you wish to turn the Sounds feature ON?\n(default 'Y')\n"
))

(set #config-o-nosounds
(cat "\nWhich response to 'Soundfile Not Found' condition do you want? (0-3)\n(default '2')\n"
))

(set #player-help
(cat "\nThis is the program that will play your sounds.\n\n"
))

(set #sounds-help
(cat "\nThis is the directory which contains your sound files.\n\n"
))

(set #opts-help
(cat "\nThese are AUTO options that are alterable by using %AUTO.\n\n"
     "AJOIN    = N or Y.  Turns off/on your Auto-Join on an INVITE.\n"
     "FSERV    = N or Y.  Turns off/on your FileServer functions.\n"
     "OP       = N or Y.  Turns off/on your Auto-Ops and %OP functions.\n"
     "RCMD     = N or Y.  Turns off/on your Remote Commands.\n"
     "SOUNDS   = N or Y.  Turns off/on your Sound Playing function..\n"
     "NOSOUNDS = 0 to 9.  Sets your response to 'Soundfile Not Found'."
     "  0 = Do nothing.  1 = Notify Requestor.  2 = Notify You."
     "  3 = Issue CTCP GETSOUND to Requestor."
     "  4 = Issue !Nick Soundfile.wav to Requestor.\n"
     "  5 thru 9 are the same as 0 thru 4 except that they instruct"
     " MCF_Sound.AMIRX to NOT play the sound, AmIRC BETA 1.5 will.\n"
))

(set #path-text-help
(cat "\nSelect directory to install MCF OPs and help files to"
))

(set #path-text-rexx
(cat "\nSelect directory to install MCF Rexx Scripts to"
))

(set #path-help
(cat "\nThis section lets you choose where to install MCF Ops and"
     " help files on your hard disk.  If you already have installed"
     " a previous version or have already configured your MCF.Ops"
     " and MCF.Fserv files, De-Select them before copying.\n\n"
     @askdir-help
))

(set #copy-help
(cat "\nThis section lets you choose where to install MCF Ops and"
     " help files on your hard disk.  If you already have installed"
     " a previous version or have already configured your MCF.Ops"
     " and MCF.Fserv files, De-Select them before copying.\n\n"
     @copyfiles-help
))

(set #path-rexx
(cat "\nThis section lets you choose where to install MCF"
     " Script files on your hard disk.\n"
     "I've found less problems if only 1 directory is assigned"
     " to Rexx:.\n\n"
     @askdir-help
))

(set #rexx-copy-text
(cat "Installing MCF Scripts"
))

(set #help-copy-text
(cat "Installing MCF Ops and Help files. De-Select MCF.Ops and"
     " MCF.Fserv if you have already configured these files"
))

(set #env-copy-text
(cat "Installing MCF ENV: to ENVARC: This step is not necessary"
     " if ENV: and ENVARC: are on your Hard-drive to save Ram:"
))

(set #doc-dir-choose
(cat "\nWhich parts of documentation do you wish to install?"
))

(set #doc-dir-choose-help
(cat "\nSelect which of the following files are to be installed:\n\n"
     "  MCF4AmIRC.guide  - documentation\n"
     "  MCF4AmIRC.readme - ReadMe file. Latest update info\n\n"
     @askdir-help
))

(set #install-docs
(cat "\nInstall documentation?"
     "\n\n"
     "This consists of the following files:\n\n"
     "AmigaGuide documentation\n"
     "ReadMe file. Latest update info\n"
))

(set #goodbye
(cat "\nInstallation of MCF if Complete.  You will need to Re-Boot for "
     "the Assign to MCF: executed unless you manually Assign MCF: to the "
     "proper directory.  Please remember that MCF4AmIRC is not perfect, "
     "nor even anywhere near complete in it's Flood Protection.  Any info "
     "on how to handle Floods not included in MCF would be appreciated\n\n"
))

(set #my-address
(cat	"Donald T Becker\n"
	"335 S Chestnut St\n"
	"Mt Carmel Pa 17851-2219\n\n"
	"email:   dtbecker@prolog.net\n"
	"IRC:     StarDustr!StarDustr@*.ptd.net\n"
))
;********************************************************************

(complete 7) (message #Hello)
(set player
   (askfile (prompt #config-player)
   (help #player-help)
   (default "Play16")
))

(complete 14)
(set sounds
   (askdir (prompt #config-sounds)
   (help #sounds-help)
   (default "")
))

(complete 21)
(set o-ajoin
   (askbool (prompt #config-o-ajoin)
   (help #opts-help)
   (choices "YES" "NO")
   (default 0)
))

(complete 24)
(set o-fserv
   (askbool (prompt #config-o-fserv)
   (help #opts-help)
   (choices "YES" "NO")
   (default 0)
))

(complete 28)
(set o-ops
   (askbool (prompt #config-o-ops)
   (help #opts-help)
   (choices "YES" "NO")
   (default 0)
))

(complete 33)
(set o-rcmds
   (askbool (prompt #config-o-rcmds)
   (help #opts-help)
   (choices "YES" "NO")
   (default 0)
))

(complete 38)
(set o-sounds
   (askbool (prompt #config-o-sounds)
   (help #opts-help)
   (choices "YES" "NO")
   (default 0)
))

(complete 43)
(set o-nosounds
   (askchoice (prompt #config-o-nosounds)
   (help #opts-help)
   (choices "0" "1" "2" "3" "4" "5" "6" "7" "8" "9")
   (default 2)
))

(set ajoin-f "N")
(set fserv-f "N")
(set ops-f "N")
(set rcmds-f "N")
(set sounds-f "N")
(set nosounds-f "2")

(if (= o-ajoin 1)
     (set ajoin-f "Y")
)

(if (= o-fserv 1)
     (set fserv-f "Y")
)

(if (= o-ops 1)
     (set ops-f "Y")
)

(if (= o-rcmds 1)
     (set rcmds-f "Y")
)

(if (= o-sounds 1)
     (set sounds-f "Y")
)

(run "echo >ENV:MCF.Startup $VER: MCF.Startup 4.1 (29.07.96)")
(run "echo >>ENV:MCF.Startup SOUNDPLAYER " player)
(run "echo >>ENV:MCF.Startup SOUNDDIR    " sounds)
(run "echo >>ENV:MCF.Startup AJOIN       " ajoin-f)
(run "echo >>ENV:MCF.Startup FSERV       " fserv-f)
(run "echo >>ENV:MCF.Startup OPS         " ops-f)
(run "echo >>ENV:MCF.Startup RCMDS       " rcmds-f)
(run "echo >>ENV:MCF.Startup SOUNDS      " sounds-f)
(run "echo >>ENV:MCF.Startup NOSOUNDS    " nosounds-f)
(copyfiles
   (source "ENV")
   (dest "ENV:")
   (choices "MCF.Protect" "MCF_QProtect.AMIRX" "MCF_JOIN.AMIRX")
   (files)
)

((complete 49)
(set target1
   (askdir (prompt #path-text-rexx)
   (help #path-rexx)
   (default @def-dest1)
   (newpath)
))
(set @def-dest1 target1)

(complete 56)
(copyfiles
   (prompt #rexx-copy-text)
   (help @copyfiles-help)
   (source "Rexx")
   (dest @def-dest1)
   (pattern "#?")
   (files)
))

(complete 63)
(set target2
   (askdir (prompt #path-text-help)
   (help #path-help)
   (default @def-dest2)
;   (newpath)
))

(makeassign "MCF" target2)

(set @def-dest2 target2)

(complete 70)
(copyfiles
   (prompt #help-copy-text)
   (help @copy-help)
   (source "MCF")
   (dest @def-dest2)
   (choices "MCF.Ops" "MCF.FServ")
   (files)
   (confirm)
)
(copyfiles
   (source "MCF")
   (dest @def-dest2)
   (choices "MCF.Cmds" "MCF.Encrypt" "MCF_AU.help" "MCF_AUTO.help" "MCF_DO.help" "MCF_DU.help"
            "MCF_FLIST.help" "MCF_FSEND.help" "MCF_HELP.help" "MCF_K.help" "MCF_KB.help"
            "MCF_MDO.help" "MCF_MKB.help" "MCF_OP.help" "MCF_OPTS.help" "MCF_QUIT.help"
            "MCF_RC.help" "MCF_RU.help" "MCF_STATUS.help" "MCF_USERS.help")
   (files)
)

(complete 77)
(startup "MCF for AmIRC"
     (prompt
      "An Assign to MCF: needs to be added to the \"S:User-Startup\" so the MCF: knows where to find the OPs and help files.")
     (help "Installs the Assign to MCF: in your S:User-Startup")
     (command (cat "Assign MCF: " '"'(getassign "MCF:" "a")'"' "\n"))
)

(complete 84)
(set earc (askbool   (prompt #env-copy-text)
                (help "Do you wish ENV: files stored in ENVARC:?")
		(choices "YES" "NO")
	  )
)
(if (= earc 1)
   (copyfiles
      (source "ENV:")
      (dest @def-dest3)
      (choices "MCF.Startup" "MCF.Protect" "MCF_QProtect.AMIRX" "MCF_JOIN.AMIRX")
      (files)
   )
)

(set docs (askbool (prompt #install-docs)
		(help #install-docs-help)
		(choices "YES" "NO")
	  )
)

(complete 92)
(if (= docs 1)
	(copyfiles
	   (prompt #doc-dir-choose)
	   (help #doc-dir-choose-help)
           (source "")
           (choices "MCF4AmIRC.guide" "MCF4AmIRC.guide.info" "MCF4AmIRC.ReadMe" "MCF4AmIRC.ReadMe.info")
	   (dest @def-dest4)
	   (infos)
           (files)
	   (confirm)
	)
)

(complete 100) (message #goodbye #my-address)

