(complete 0)

(set #bad-kick
(cat "You must be using Kickstart 2.0 (V37) to install AlertPatch"
))

(set #which-disk
(cat "\nSelect directory to install to"
))

(set #which-disk-help
(cat "\nThis section lets you choose where to install AlertPatch "
     "on your hard disk. This should normally go in the Workbench "
     "Startup drawer - SYS:WBStartup.\n\n"
     @askdir-help
))

(set #which-language
(cat "\nWhich languages should be installed"
))

(set #which-language-help
(cat "\nCheck the boxes of the languages you wish "
     "to have available with AlertPatch.\n\n"
     @askoptions-help
))

(set #which-icons
(cat "\nInstall MagicWB style icons?"
))

(set #which-icons-help
(cat "\nThe MagicWB icon for AlertPatch was designed by Osma Ahvenlampi (oahvenla@snakemail.hut.fi) "
     @askbool-help
))


(if (< (/ (getversion) 65536) 37)
(
    (abort #bad-kick)
))

(complete 15)

;=============================================================================
; Installation target dir?

(set target (askdir (prompt #which-disk)
		(help #which-disk-help)
		(default "SYS:WBStartup")
	)
)
(set @default-dest target)

(complete 30)

;=============================================================================
; which languages should be installed?

(set lang (askoptions (prompt #which-language)
		      (help #which-language-help)
		      (choices "Franais" )
		      (default 0)
	  )

)

    (set n 0)

    (while (set language (select n "franais" "" ) )
    (
	(if (IN lang n)

	(copyfiles
		(source (cat "catalogs/" language "/matrix/" ))
		(dest (cat "LOCALE:catalogs/" language "/matrix/" ))
		(all)
	)
	)
	    (set n (+ n 1))
    ))

(complete 50)

;=============================================================================
; Required libraries

(copylib
	(prompt "Installing matrix.library")
	(help @copylib-help)
	(source "matrix.library")
	(dest "LIBS:")
	(confirm)
)
(complete 75)

;=============================================================================
; Main program

(copyfiles
	(prompt "Copying to " #target )
	(help @copyfiles-help)
	(source "")
	(dest (cat target) )
	(choices "AlertPatch")
)

(complete 90)

(set iconz (askbool (prompt #which-icons)
		(help #which-icons-help)
		(choices "YES" "NO")
	  )
)


    (if (= iconz 0)                           ; conditional test
        (set #iconname (cat "AlertPatch.info" )
	)
        (set #iconname (cat "AlertPatch.magicwb" )
	)
    )

(copyfiles
	(prompt "Installing icons...")
	(help @copyfiles-help)
	(source #iconname)
	(dest (cat target) )
	(newname "AlertPatch.info" )
)

(complete 100)

