
; StopMenu Install Script

; $Id: Install,v 1.5 2000/06/29 13:59:20 damir Rel $

; (C)2000 Damir Arh


; Installs StopMenu


;-------------------------------------------------

; string declaration

(set #select-dest
	(cat "Please select where you want StopMenu to be installed.\n"
		"A new drawer will be created.")
)

(set #create-dest
	(cat "Creating destination drawer")
)

(set #copy-icon
	(cat "Copying drawer icon")
)

(set #copy-files
	(cat "Copying program files")
)

(set #copy-example
	(cat "Copying a sample menu")
)

(set #copy-setting
	(cat "Copying sample StopMenu settings")
)

(set #copy-starter
	(cat "Setting up StopMenu autostart")
)

(set #copy-newicon
	(cat "Copying newicon.library")
)

(set #copy-thomson
	(cat "Copying thomson.library")
)

(set #copy-wbstart
	(cat "Copying wbstart.library")
)

(set #copy-fonts
	(cat "Copying fonts")
)

(set #modify-startup
	(cat "Modifying User-Startup file")
)

(set #exit
	(cat "Congratulations!\n"
		"You have succesfully installed StopMenu.")
)

(set #select-icons
	(cat "Select which icons do you want the installer to set as default. "
		"The other icons will also be installed. Check the documentation on "
		"how to change the used ones.")
)

(set #choice-newicon "NewIcons style")
(set #choice-glowicon "GlowIcon style")

(set #bit-newicon %0)
(set #bit-glowicon %1)

;-------------------------------------------------

; initialization

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

(set #dest-dir
	(askdir
		(prompt #select-dest)
		(help @askdir-help)
		(default @default-dest)
	)
)

(set @default-dest (tackon #dest-dir "StopMenu"))

(if (= (exists @default-dest) 0)
	(
		(copyfiles
			(prompt #copy-icon)
			(source (tackon #source-dir "external/StopMenu.info"))
			(dest #dest-dir)
			(noposition)
		)
		(makedir @default-dest
			(prompt #create-dest)
		)
	)
)

(set #icons
	(askchoice
		(prompt #select-icons)
		(help @askchoice-help)
		(choices
			#choice-newicon
			#choice-glowicon
		)
		(default 0)
	)
)

(complete 20)


;------------------------------------------------

; copying

(if (= #icons #bit-newicon)
	(set #icons-filename "all/newicons")
	(set #icons-filename "all/glowicons")
)

(rename
	(tackon #source-dir #icons-filename)
	(tackon #source-dir "all/icons")
	(prompt "")
	(help "")
)

(copyfiles
	(prompt #copy-files)
	(source (tackon #source-dir "all"))
	(dest @default-dest)
	(noposition)
	(all)
)

(rename
	(tackon #source-dir "all/icons")
	(tackon #source-dir #icons-filename)
	(prompt "")
	(help "")
)

(if (= (exists (tackon @default-dest "StopMenu.menus")) 0)
	(copyfiles
		(prompt #copy-example)
		(source (tackon #source-dir "external/StopMenu.menus"))
		(dest @default-dest)
	)
)

(if (= (exists (tackon @default-dest "StopMenu.prefs")) 0)
	(copyfiles
		(prompt #copy-setting)
		(source (tackon #source-dir "external/StopMenu.prefs"))
		(dest @default-dest)
	)
)

(copyfiles
	(prompt #copy-starter)
	(source (tackon #source-dir "external/StopMenuStarter.info"))
	(dest "SYS:WBStartup")
)

(complete 40)

(copylib
	(prompt #copy-newicon)
	(source (tackon #source-dir "libs/newicon.library"))
	(dest "LIBS:")
)

(copyfiles
	(prompt #copy-thomson)
	(source (tackon #source-dir "libs/thomson.library"))
	(dest "LIBS:")
)

(copylib
	(prompt #copy-wbstart)
	(source (tackon #source-dir "libs/wbstart.library"))
	(dest "LIBS:")
)

(complete 60)

(copyfiles
	(prompt #copy-fonts)
	(source (tackon #source-dir "fonts"))
	(dest "FONTS:")
	(all)
)

(complete 80)

(startup "StopMenu"
	(prompt #modify-startup)
	(help @startup-help)
	(command (cat "Assign StopMenu: " @default-dest))
)

(makeassign "StopMenu" @default-dest)

(complete 100)


;-------------------------------------------------

; installation completed

(exit #exit)

