; *************************************************************************
; ******************  FIRDesigner Installation Script  ********************
; *************************************************************************
;
; $VER: FIRDesign.install 1.0 (28.11.95)
;
; Copyright ©1995 Harald Zottmann
;
; *************************************************************************
;


; ------------------------------------------------------------------------
; Set default destination directory

	(set def-fir-dir "SYS:")


; ------------------------------------------------------------------------
; Init some strings

	(set #yes-msg "Yes")
	(set #no-msg "No")

	(set #mc00 "68000")
	(set #mc20 "68020")
	(set #mc40 "68040")

	(set #bad-kick-msg 
		"FIRDesigner requires AmigaOS 2.04 or better !"
	)

	(set #hello-msg
		(cat
		"Welcome to the FIRDesigner. "
		"This script will install the FIRDesigner and "
		"related files on your Amiga.\n\n"
		"You will need to answer a few questions such as "
		"where you would like the program installed.\n\n"
		"If you do not wish to install the FIRDesigner at this time, "
		"select the 'Abort Install' button now. "
		)
	)

	(set #mcu-msg
		"Select your processor type. "
	)

	(set #mcu-help
		(cat
		"This option gives you the choice to select a program "
		"version, which is optimized for the processor of "
		"your Amiga.\n\n"
		"If you are not sure about this, select the default "
		"value (68000)."
		)
	)

	(set #goodbye-msg
		(cat
		"The installation of the FIRDesigner is now complete. "
		"Have a look at the guides to get more information "
		"about this powerful tool. "
		"Don`t forget to register if you use the FIRDesigner "
		"frequently. See the docs for more information.\n\n"
		"Have fun..."
		)
	)

	(set #shortbye-msg
		(cat
		"Don`t forget to register if you use the FIRDesigner "
		"frequently. See the docs for more information.\n\n"
		"Have fun..."
		)
	)

	(set #fir-askdir-msg 
		"Select the directory to install the FIRDesigner in."
	)


; ************************************************************************
; Begin actual installation
; ************************************************************************


; ------------------------------------------------------------------------
; Check for KickV37 or better

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


; ------------------------------------------------------------------------
; Print the welcome message

	(message #hello-msg)


; ------------------------------------------------------------------------
; Ask the user where we should install the FIRDesigner.

	(if (= 0 @user-level)
		(
		(set firdir (tackon @default-dest "FIRDesigner") )
		(set @default-dest firdir)
		(makedir firdir)
		(copyfiles (source "/FIRDesigner") (dest firdir) (infos) (all))
		(exit (#shortbye-msg)) 
		)
	)

	(set firdir
		(askdir
			(prompt #fir-askdir-msg)
			(help @askdir-help)
			(default def-fir-dir)
		)
	)
	(set @default-dest firdir)

; ------------------------------------------------------------------------
; Ask for 68000, 68020 or 68040

	(set mcu-version
		(askchoice
			(prompt #mcu-msg)
			(help #mcu-help)
			(choices
				#mc00
				#mc20
				#mc40
			)
			(default 0)
		)
	)

	(if (= 0 mcu-version)
		(
		(copyfiles (source "FIRDesign68000")  (dest firdir) (infos) )
		)
	)

	(if (= 1 mcu-version)
		(
		(copyfiles (source "FIRDesign68020")  (dest firdir) (infos) )
		)
	)
	(if (= 2 mcu-version)
		(
		(copyfiles (source "FIRDesign68040")  (dest firdir) (infos) )
		)
	)

	(copyfiles (source "FIRDesign.guide")         (dest firdir) (infos) )
	(copyfiles (source "FIRDesign.readme")        (dest firdir) (infos) )

	(copyfiles (source "Bandpass.FIR")            (dest firdir) )
	(copyfiles (source "Differentiator.FIR")      (dest firdir) )
	(copyfiles (source "Hilbert.FIR")             (dest firdir) )
	(copyfiles (source "Lowpass.FIR")             (dest firdir) )
	(copyfiles (source "Highpass.FIR")            (dest firdir) )
	(copyfiles (source "Multipass.FIR")           (dest firdir) )
	(copyfiles (source "Notch.FIR")               (dest firdir) )


; ------------------------------------------------------------------------
; Print the goodbye message

	(message #goodbye-msg)


