; $VER: InfoID Install 1.00 (03.27.95) by Jason Gouger

(set source-dir (pathonly (expandpath @icon)))

(procedure select-prg-destination-directory
	(set prg-destdir
		(askdir
			(prompt "In which drawer should "@app-name" be installed?") 
			(help "You should install "@app-name" in the MEBBSNet:c Path.")
			(default "MEBBSNet:c")
		   (newpath)
		)
	)
)

(procedure copy-InfoID-prg
	(copyfiles
		(source source-dir) (dest prg-destdir)
		(pattern "InfoID")
		(files)
	)
)

(procedure copy-InfoID-doc
	(transcript "\nCopying documentation...\n")
	(if (askbool
		(prompt "Would you like the documentaion installed for "@app-name"?")
		(help "Selecting YES to this option will copy the documentaion to a "
            "selected directory."))
		((set doc-dir
			(askdir
				(prompt "In which drawer should the documentation be installed?") 
				(help "You should select a directory wher you keep you documentation files.")
				(default "MEBBSNet:")
			   (newpath)
			)
		)
		(copyfiles
			(source source-dir) (dest doc-dir)
			(pattern "InfoID.guide")
			(files)
			(if(= 1 install-icons) (infos))
		)
		(if ((exists "SYS:Utilities/MultiView")) 
			(tooltype(
				(dest (tackon doc-dir "InfoID.guide"))
				(setdefaulttool "SYS:Utilities/MultiView")
			))
			(tooltype(
				(dest (tackon doc-dir "InfoID.guide"))
				(setdefaulttool "SYS:Utilities/AmigaGuide")
			))
		)
	))
)

(procedure ask-install-icons
	(set install-icons 0)
	(if (askbool
		(prompt "Would you like the icons installed for "@app-name"?")
		(help "Selecting YES to this option will create the respective icons so that "
				"the directory and documentation may be accessed through WorkBench."))
		((set install-icons 1))
	)
)


(complete 00) (transcript "Installation script for " @app-name ".")
(complete 10) (select-prg-destination-directory)
(complete 25) (ask-install-icons)
(complete 50) (copy-InfoID-prg)
(complete 75) (copy-InfoID-doc)
(set @default-dest prg-destdir)
(complete 100)
