(transcript "Installing Magic User Interface System...")


; **************************************************************************
; **************************************************************************
; **************************************************************************


(set @default-dest "SYS:")


; **************************************************************************
; **************************************************************************
; **************************************************************************


(copylib
	(help @copylib-help)
	(prompt "Installing muimaster.library...")
	(confirm)
	(source "Libs/muimaster.library")
	(dest
		(askdir
			(prompt "Please select a place for \"muimaster.library\".")
			(help @askdir-help)
			(default "LIBS:")
		)
	)
)


(complete 20)


; **************************************************************************
; **************************************************************************
; **************************************************************************


(set classdest
	(askdir
		(prompt "Please select a place for the classes. A sub drawer called \"MUI\" will be created here.")
		(help @askdir-help)
		(default "SYS:Classes")
		(newpath)
	)
)


(makedir classdest)

(makedir (tackon classdest "MUI"))


(foreach "Classes/MUI" "#?.mui"
	(copylib
		(prompt "Installing Classes...")
		(source (tackon "Classes/MUI" @each-name))
		(help @copylib-help)
		(dest (tackon classdest "MUI"))
	)
)


(complete 40)


; **************************************************************************
; **************************************************************************
; **************************************************************************


(copylib
	(prompt "Installing the preferences program...")
	(source "Prefs/MUI")
	(confirm)
	(infos)
	(noposition)
	(help @copylib-help)
	(dest
		(askdir
			(prompt "Please select a place for the preferences program.")
			(help @askdir-help)
			(default "SYS:Prefs")
			(newpath)
		)
	)
)


(complete 50)


; **************************************************************************
; **************************************************************************
; **************************************************************************


(if (askbool (help @askbool-help) (prompt "Do you want to install the additional BOOPSI images?"))
(
	(set boopsidest
		(askdir
			(prompt "Please select a place for the BOOPSI images.")
			(help @askdir-help)
			(default (tackon classdest "Images"))
			(newpath)
		)
	)

	(foreach "Classes/Images" "#?.image"
		(copylib
			(prompt "Installing BOOPSI Images...")
			(source (tackon "Classes/Images" @each-name))
			(help @copylib-help)
			(dest boopsidest)
		)
	)
)
)


(complete 60)


; **************************************************************************
; **************************************************************************
; **************************************************************************


(if (askbool (help @askbool-help) (prompt "Do you want to install the additional ILBM images?"))
(
	(copyfiles
		(prompt "Installing ILBM brushes...")
		(help @copyfiles-help)
		(source "Images")
		(pattern "#?.mb?")
		(dest
			(askdir
				(prompt "Please select a place for the ILBM brushes.")
				(help @askdir-help)
				(default "brush:")
				(newpath)
			)
		)
	)
)
)


(complete 70)


; **************************************************************************
; **************************************************************************
; **************************************************************************


(if (askbool (help @askbool-help) (prompt "Do you want to install the english online help manual?"))
(
	(if (exists "libs:amigaguide.library")
	(
		(copyfiles
			(prompt "Installing the english online help...")
			(source "Docs/English/MUI.guide")
			(help @copyfiles-help)
			(dest
				(set manpath (askdir
					(prompt "Please select a place for the english online help.")
					(help @askdir-help)
					(default "HELP:english")
					(newpath)
				))
			)
		)
	)
   (
		(message "I couldn't locate \"amigaguide.libary\" on your system, you won't be able to use online help.")
	)
	)
)
)


(complete 80)


; **************************************************************************
; **************************************************************************
; **************************************************************************


(if (askbool (help @askbool-help) (prompt "Do you want to install the german online help manual?"))
(
	(if (exists "libs:amigaguide.library")
	(
		(copyfiles
			(prompt "Installing the german online help...")
			(source "Docs/Deutsch/MUI.guide")
			(help @copyfiles-help)
			(dest
				(askdir
					(prompt "Please select a place for the german online help.")
					(help @askdir-help)
					(default "HELP:deutsch")
					(newpath)
				)
			)
		)
	)
   (
		(message "I couldn't locate \"amigaguide.libary\" on your system, you won't be able to use online help.")
	)
	)
)
)


(complete 90)



; **************************************************************************
; **************************************************************************
; **************************************************************************


(set vernum (getversion "exec.library" (resident)))
(set ver (/ vernum 65536))

(if (< ver 39)
(
	(startup "MUI"
		(prompt "You are not running Kickstart 3.0 or higher, so I have to add some commands to your user-startup.")
		(help @startup-help)
		(command "assign add LIBS: \"" classdest "\"")
	)
)
)


(complete 100)


; **************************************************************************
; **************************************************************************
; **************************************************************************




(exit)
