;Install script for ShortQt v1.1
;Š 1996 Stv
;
(set #fullinstdir
	(askdir
		(prompt "Where do you want to install ShortQt! ?\n(no drawer will be created)")
		(help @askdir-help)
		(default "Sys:")
	)
)
(set #adddocs
	(askbool
		(prompt "\n\nShould I copy the documentation ?")
		(help @askbool-help)
	)
)
(set #exshortqt (exists "ENV:shortqt.volumes" (noreq)))
(if (= #exshortqt 1)
	(
		(set #convert
			(askbool
				(prompt "\n\nSeems that you have v1.0 installed.\n\nDo you want me to convert old v1.0 volumes file to the new v1.1 format ?\n\n(If you have v1.1 installed you should NOT do this)")
				(help @askbool-help)
			)
		)
		(if (= 1 #convert)
		(
			(run 'convert')
			(copyfiles (source "RAM:shortqt.volumes") (dest "env:") (prompt "Copy new prefs") (help @copyfiles-help) )
			(copyfiles (source "RAM:shortqt.volumes") (dest "envarc:") (prompt "Copy new prefs") (help @copyfiles-help))
			(message "\n\nOK. Volumes list have been updated to v1.1 format.\n\nPlease read the docs, because the new list has not the 'KillCommand' defined.")
		)
		)
	)
	(set #copyconfig
		(askbool
			(prompt "\n\nDo you want to copy a default config-file ?")
			(help @askbool-help)
		)
	)
)
(set #icon
	(askchoice
		(help @askchoice-help)
		(prompt "Select which icon you want to install")
		(choices "NewIcon-Style1" "MWB-Style 1" "MWB-Style 2")
		(default 1)
	)
)
(set #locales
	(askoptions
		(prompt "Which catalogs do you want to install ?")
		(help @askoptions-help)
		(choices "Spanish" "Catalan")
		(default %00)
	)
)
;
; Now the real installation process starts !
;
(set @default-dest #fullinstdir)
(copyfiles (source "/files/ShortQt") (dest #fullinstdir) (prompt "Going to copy the program") (help @copyfiles-help))
(if (= 1 #adddocs)
	(copyfiles (source "/docs/ShortQt.guide") (dest #fullinstdir) (prompt "Going to copy the english documentation of ShortQt") (help @copyfiles-help) (infos))
)
(if (= 1 #copyconfig)
	(	
		(copyfiles (source "/files/SHORTQT.1.cfg") (dest "env:mui/") (prompt "Going to copy the a def config of ShortQt") (help @copyfiles-help) )
		(copyfiles (source "/files/SHORTQT.1.cfg") (dest "envarc:mui/") (prompt "Going to copy the a def config of ShortQt") (help @copyfiles-help) )
		(copyfiles (source "/files/shortqt.volumes") (dest "envarc:") (prompt "Going to copy the a def config of ShortQt") (help @copyfiles-help))
		(copyfiles (source "/files/shortqt.volumes") (dest "env:") (prompt "Going to copy the a def config of ShortQt") (help @copyfiles-help))
	)
)
(select #icon
	(set #iconfile "/icons/NewIcon_Style1.info")
	(set #iconfile "/icons/MWB_Style1.info")
	(set #iconfile "/icons/MWB_Style2.info")
)
(copyfiles (source #iconfile) (dest #fullinstdir) (newname "ShortQt.info") (prompt "Going to copy the ShortQt info file") (help @copyfiles-help) )
(if (in #locales 0)
	(copyfiles (source "/files/locale/catalogs/espaņol") (dest "locale:catalogs/espaņol") (prompt "Installing catalogs") (all) (help @copyfiles-help))
)
(if (in #locales 1)
	(copyfiles (source "/files/locale/catalogs/catalā") (dest "locale:catalogs/catalā") (prompt "Installing catalogs") (all) (help @copyfiles-help))
)
