;
; $Id: Install-Script 1.1 2000/02/22 19:32:25 hys Exp hys $
; (c) 2000 by Hynek Schlawack, All Rights Reserved
;
(set #ds_what_req       "What do you want me to install:")
(set #ds_what_hlp
	(cat "Select what you would like to install.\n\n" @askoptions-help)
)
(set #DS_COPY_ALL  %1111)
(set #DS_COPY_BIN  %0001)
(set #DS_COPY_ICN  %0010)
(set #DS_COPY_CAT  %0100)
(set #DS_COPY_MAN  %1000)
(set #ds_bin_dest_req   "Where do you want me to install the DirScanner binaries?")
(set #ds_bin_dest_hlp
	(cat "A seperate directory will *NOT* be created.\n\n" @askdir-help)
)
(set #ds_cat_dest_req   "Where do you want me to install the catalogs?")
(set #ds_cat_dest_hlp
	(cat "Use either the same directory as DirScanner or LOCALE:.\n\n" @askdir-help)
)
(set #ds_which_icon_req "Which icon do you wish?")
(set #ds_which_icon_hlp
	(cat "Have a look in the icon directory.\n\n" @askoptions-help)
) 
(set #ds_man_dest_req   "Where do you want me to install the manual?")
(set #ds_man_dest_hlp
	(cat "If you wish the online help then use HELP:english/.\n\n" @askdir-help)
)
(set #ds_start_req      "May I start with copying the files?")
(set #ds_start_hlp
	(cat @askbool-help)
)
(set #ds_aborted_req    "Aborted!\n\nNo file has been copied.")
(set #ds_progress_req   "Installing DirScanner.")
(set #ds_progress_hlp
	(cat @copyfiles-help)
)

(complete 0)

(if (= @user-level 2)
	(set #ds_what
		(askoptions
			(prompt #ds_what_req)
			(help #ds_what_hlp)
			(choices
				"Binary"
				"Icon"
				"Catalogs"
				"Manual"
			)
		)
	)
	(set #ds_what #DS_COPY_ALL)
)
(complete 10)
(if (BITAND #ds_what #DS_COPY_BIN)
	(set @default-dest
	    (askdir
			(prompt #ds_bin_dest_req)
			(help #ds_bin_dest_hlp)
			(default "SYS:Tools/")
		)
	)
)

(complete 20)

(if (BITAND #ds_what #DS_COPY_ICN)
	(set #ds_which_icon
		(askchoice
			(prompt #ds_which_icon_req)
			(help #ds_which_icon_hlp)
			(choices
				"Icon 1"
				"Icon 2"
				"Icon 3"
			)
			(default 0)
		)
	)
)

(complete 30)

(if (BITAND #ds_what #DS_COPY_CAT)
	(set #ds_cat_dest
	    (askdir
		    (prompt #ds_cat_dest_req)
		    (help #ds_cat_dest_hlp)
		    (default "LOCALE:Catalogs/")
	    )
	)
)

(complete 40)

(if (BITAND #ds_what #DS_COPY_MAN)
	(set #ds_man_dest
		(askdir
			(prompt #ds_man_dest_req)
			(help #ds_man_dest_hlp)
			(default "HELP:english/")
		)
	)
)
(complete 50)
(set #ds_start
	(askbool
		(prompt #ds_start_req)
		(help #ds_start_hlp)
		(default 1)
	)
)
(if (NOT #ds_start)
	(
		(message #ds_aborted_req)
		(exit)
	)
)

(if (BITAND #ds_what #DS_COPY_BIN)
	(copyfiles
		(prompt #ds_progress_req)
		(help #ds_progress_hlp)
		(source "DirScanner")
		(dest @default-dest)
	)
)
(complete 70)
(if (BITAND #ds_what #DS_COPY_ICN)
	(
		(set #ds_which_icon_str "Icons/DirScanner01.info")
		(if (BITAND #ds_which_icon %1)
			(set #ds_which_icon_str "Icons/DirScanner02.info")
			(if (BITAND #ds_which_icon %10)
				(set #ds_which_icon_str "Icons/DirScanner03.info")
			)
		)

		(copyfiles
			(prompt #ds_progress_req)
			(help #ds_progress_hlp)
			(source #ds_which_icon_str)
			(newname "DirScanner.info")
			(dest @default-dest)
			(noposition)
		)
	)
)
(complete 80)
(if (BITAND #ds_what #DS_COPY_CAT)
	(
		(copyfiles
			(prompt #ds_progress_req)
			(help #ds_progresss_req)
			(source "Catalogs")
			(dest #ds_cat_dest)
			(all)
		)
	)
)
(complete 90)
(if (BITAND #ds_what #DS_COPY_MAN)
	(
		(copyfiles
			(prompt #ds_progress_req)
		    (help #ds_progress_hlp)
			(source "Docs/DirScanner.guide")
			(dest #ds_man_dest)
		)
	)
)
(complete 100)
