; Installer Script for MyMatch
; $VER: Install_MyMatch V_1.0 (11.04.99)

(set #install-docs
(cat " Install documentation?\n"
     "This consists of 2 files and their icons.\n"
))

(set #goodbye
(cat "\nInstallation of MyMatch 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:   strdustr@ptd.net\n"
	"IRC:     StarDustr!StarDustr@*.ptd.net\n"
))

(set mmver (getversion "AmIRC/Rexx/MyMatch.amirx"))
(set mrver (getversion "Rexx/MatchResolve.rexx"))
;********************************************************************

(complete 10)
(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 target2 (tackon target1 "Rexx"))
(set mmfile (tackon target1 "Rexx/MyMatch.amirx"))
(set mrfile ("Rexx:MatchResolve.rexx"))

(set oldver (- 1 1))
(if (Exists mmfile) (
	(set oldver (getversion mmfile))
))

(complete 25)
(if (> mmver oldver)(
	(complete 50)
	(copyfiles (
		(source  "AmIRC/Rexx")
		(dest    target2)
		(choices "MyMatch.amirx")
	))
))

(set oldver (- 1 1))
(if (Exists mrfile) (
	(set oldver (getversion mrfile))
))

(complete 40)
(if (> mrver oldver)(
	(complete 50)
	(copyfiles (
		(source  "Rexx")
		(dest    "Rexx:")
		(choices "MatchResolve.rexx")
	))
))

(complete 55)
(copyfiles (
	(prompt  "Select Data Files you wish Installed")
	(help    "These files contain Non-Standard Domains/IPs for use by MyMatch")
	(source  "AmIRC")
	(dest    target1)
	(choices "America.USA.MyMatch" "Australia.AU.MyMatch"
		"Canada.CA.MyMatch" "France.FR.MyMatch"
		"Netherlands.NL.MyMatch" "Sweden.SE.MyMatch"
		"Thailand.TH.MyMatch" "UnitedKingdom.UK.MyMatch"
		"Yugoslavia.YU.MyMatch")
	(CONFIRM)
	)
)

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

(complete 85)
(if (= docs 1)				(
	(set target3			(askdir
		(prompt "Select Directory for MyMatch.doc")
		(help "Directory where MyMatch.doc will be copied to.")
		(default target1)
	))
	(copyfiles (
		(prompt  "Select Docs you wish Installed")
		(help "Documentation.")
		(source  "Docs")
		(dest    target3)
		(choices "DISCLAIMER" "MyMatch.readme")
		(CONFIRM)
	))
))

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

(exit (quiet))
