; Installer Script for MCF_Buttons Version 5.1
; $VER: Install_MCF_Buttons V_5.1 (22.11.97)

(set #install-docs
(cat " Install documentation?\n"
     "This consists of up to 9 files and thier icons.\n"
))

(set #goodbye
(cat "\nInstallation of MCF_Buttons is Complete.\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"
))

(set dalrc (= 1))
(set mbver (+ 4 (* 5 65536)))
(set abver (+ 1 (* 5 65536)))
(set sbver (+ 1 (* 5 65536)))
(set wwver (+ 1 (* 5 65536)))
;********************************************************************

(complete 1)

(set target1			(askdir
	(prompt "Select Directory where your AmIRC program is")
	(help "This directory should also have a  Rexx  directory in it")
	(default "RAM:")
))

(set @def-target (target1))
(set @old-file (tackon target1 "MCF.Buttons"))

(if (Exists "Rexx:SendBrowser.amirx" (noreq))
	(run "delete <>nil: Rexx:SendBrowser.amirx")
)
(if (Exists "Rexx:MCF_About.amirx" (noreq))
	(run "delete <>nil: Rexx:MCF_About.amirx")
)
(if (Exists "Rexx:MCF_Buttons.amirx" (noreq))
	(run "delete <>nil: Rexx:MCF_Buttons.amirx")
)
(if (Exists "Rexx:MCF_WWW.amirx" (noreq))
	(run "delete <>nil: Rexx:MCF_WWW.amirx")
)

(if (Exists @old-file (noreq))
	(set dalrc (- dalrc 1))
)

(if (Exists "MCF:MCF.Buttons" (noreq))	(
	(run "copy <>nil: mcf:MCF.Buttons" @def-target)
	(run "delete <>nil: mcf:MCF.Buttons")
	(set dalrc (- dalrc 1))
))

(if (= dalrc 1)
   (run "copy MCF/MCF.Buttons" @def-target)
)

(complete 20)
(set target2			(askdir
	(prompt "Select Rexx Directory")
	(help "Directory where MCF_Buttons.amirx will be copied to.")
	(default @def-target)
))

(set mbfile (tackon target2 "MCF_Buttons.amirx"))
(set abfile (tackon target2 "MCF_About.amirx"))
(set sbfile (tackon target2 "SendBrowser.amirx"))
(set wwfile (tackon target2 "MCF_WWW.amirx"))
(set oldver (- 1 1))
(if (Exists mbfile)
	(set oldver (getversion mbfile))
)
(if (> mbver oldver)(
	(complete 30)
	(copyfiles (
		(source  "Rexx")
		(dest	 target2)
		(choices "MCF_Buttons.amirx")
	))
))

(set oldver (= 0))
(if (Exists abfile (noreq))
	(set oldver (getversion abfile))
)
(if (> abver oldver) (
	(complete 40)
	(copyfiles
		(source  "Rexx")
		(dest	 target2)
		(choices "MCF_About.amirx")
	)
))

(set oldver (= 0))
(if (Exists sbfile (noreq))
	(set oldver (getversion sbfile))
)
(if (> sbver oldver) (
	(complete 50)
	(copyfiles
		(source  "Rexx")
		(dest	 target2)
		(choices "SendBrowser.amirx")
	)
))

(set oldver (= 0))
(if (Exists wwfile (noreq))
	(set oldver (getversion wwfile))
)
(if (> wwver oldver) (
	(complete 60)
	(copyfiles
		(source  "Rexx")
		(dest	 target2)
		(choices"MCF_WWW.amirx")
	)
))

(complete 70)
(if (askbool
    (prompt "Do you wish to Install MCF_Buttons Alias?")
      (help "This will install Aliases that make starting MCF_Buttons easier.")
      (choices "YES" "NO")
      (default 1))
      (
        (message ("Start a copy of AmIRC that has\nAMIRC.1 in the top left corner.\nClick Proceed when ready."))
        (run "rx \"address AMIRC.1 say '/ALIAS MB /Rx MCF_Buttons %p'\"")
))

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

(complete 90)
(if (= docs 1)	(
	(set target3
		(askdir
			(prompt "Select Directory for MCF_Buttons documentation.")
			(help "Directory where MCF_Buttons documentation will be copied to.")
			(default @def-target)
	))
	(copyfiles 
		(prompt "Check off Docs that you want copied.")
		(help "")
		(source "docs")
		(dest target3)
		(choices "DISCLAIMER" "DwarfX.ReadMe" "History" "Kuangıı.ReadMe" "MCF.ReadMe" "MCF_Buttons.readme" "Phoenix.ReadMe" "ReadMe.First" "WildIRC.ReadMe")
		(confirm)
		(infos)
	)
))

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

(exit (quiet))
