;
; $VER: PopupMenuInstaller V1.2 (21.11.98)
; Copyright ©1996-1997 Henrik Isaksson
;

(complete 0)

(welcome "Welcome to the PopupMenu Library Developer Package Installer!")

(copylib
	(prompt		"Installing the popupmenu.library...")
	(help		@copylib-help)
	(source		"Libs/popupmenu.library")
	(dest		"LIBS:")
	(confirm)
)

(complete 10)


(if	(askbool
		(prompt "Do you want to install the preferences program?")
		(help " ")
		(default 1)
	)
	(
		(set #prefsdest (askdir
			(prompt "Where do you keep your preferences programs?")
			(help @askdir-help)
			(newpath)
			(default "SYS:Prefs/")
		))

		(copyfiles
			(prompt "Copying preferences programs.")
			(help @copyfiles-help)
			(source "prefs")
			(dest #prefsdest)
			(pattern "#?")
		)
	)
)

(complete 25)

(if	(askbool
		(prompt "Do you want to install the Demo programs (executables)?")
		(help "A few examples showing what popupmenu.library can do.")
		(default 0)
	)
	(

		(set #pmdest (askdir
			(prompt "Where do you want to install the demos?\nA new directory will be created. (PopupMenu-Demos/)")
			(help @askdir-help)
			(newpath)
			(default @default-dest)
		))

		(makedir (tackon #pmdest "PopupMenu-Demos/"))
	
		(copyfiles
			(prompt "Copying demos.")
			(help @copyfiles-help)
			(source "Demos")
			(dest (tackon #pmdest "PopupMenu-Demos/"))
			(pattern "#?")
		)

		(set @default-dest (tackon #pmdest "PopupMenu-Demos/"))
	)
)

(complete 45)

(if	(askbool
		(prompt "Do you want to install the documentation?")
		(default 0)
		(help "")
	)
	(

		(set #pmddest (askdir
			(prompt "Where do you want to install the documentation?")
			(help @askdir-help)
			(newpath)
			(default "RAM:")
		))

		(copyfiles
			(prompt "Copying docs.")
			(help @copyfiles-help)
			(source "")
			(dest #pmddest)
			(pattern "#?.(doc|guide)")
		)
	)
)

(complete 60)

(if	(askbool
		(prompt "Do you want to install the C include-files and example sources?")
		(help "You will only need theese files if you are a C-developer.")
		(default 0)
	)
	(
		(set #incdest (askdir
			(prompt "In wich directory or assign do you keep your include-files?")
			(help "This will install the needed C-headers if you are going to develop your own menus.")
			(newpath)
			(default "INCLUDE:")
		))

		(copyfiles
			(prompt "Copying Include files.")
			(help @copyfiles-help)
			(source "C/Include")
			(dest #incdest)
			(pattern "~(#?.info)")
		)

		(set #cdemodest (askdir
			(prompt "Where do you want the example source to be copied?")
			(newpath)
			(default "RAM:")
			(help "Source code for the demo programs.")
		))
			
		(copyfiles
			(prompt "Copying example sources.")
			(help @copyfiles-help)
			(source "C/Demos")
			(dest #cdemodest)
			(pattern "#?.c")
		)
	)
)

(complete 80)

(if	(askbool
		(prompt "Do you want to install the Amiga E modules and example sources?")
		(help "You will only need theese files if you are a E-developer.")
		(default 0)
	)
	(
		(set #incdest (askdir
			(prompt "In wich directory or assign do you keep your include-files?")
			(help "This will install the required E-modules if you are going to develop your own menus.")
			(newpath)
			(default "EMODULES:")
		))

		(copyfiles
			(prompt "Copying Include files.")
			(help @copyfiles-help)
			(source "E/Modules")
			(dest #incdest)
			(pattern "~(#?.info)")
		)

		(set #cdemodest (askdir
			(prompt "Where do you want the example source to be copied?")
			(newpath)
			(default "RAM:")
			(help "Source code for the demo programs.")
		))
			
		(copyfiles
			(prompt "Copying example sources.")
			(help @copyfiles-help)
			(source "e/Demos")
			(dest #cdemodest)
			(pattern "#?.e")
		)
	)
)

(complete 99)

(exit)
