;AVD Installscript by E. Th van den Oosterkamp
;-----------------------------------------------------------------------------
(SET @app-name "Agressive Virus Detector")
(SET @default-dest "SYS:")
(SET Result 1)
(SET KickVer (GETVERSION))
(SET KickVer (/ KickVer 65536))
(SET NewEnvArc 1)
(WELCOME	"  Welcome to the Agressive Virus Detector installation\n\n"
		"     Copyright 1997 by E Th van den Oosterkamp\n\n"
)
;----------------------- Opvragen van doel-directory -------------------------
(SET DestDir
	(ASKDIR	(prompt "Select the directory where you want to put the executables. ")
		(help   "In the selected directory a subdirectory with the "
			"name \"AVD\" will be created. In this subdirectory "
			"all files will be installed...\n\n"
			@askdir-help)
		(default @default-dest)
		(disk)
     )
)
(SET DestDir	(TACKON DestDir "AVD"))
(SET @default-dest DestDir)
(IF (NOT(EXISTS DestDir))
	(MAKEDIR	DestDir (infos))
)
;----------------------- Opvragen van te installeren items -------------------
(SET Sel_AVD		0)
(SET Sel_AVD-Gui	1)
(SET Sel_Libs	 	2)
(SET Sel_HELP	 	3)

(SET InstallMask
	(ASKOPTIONS
		(prompt "Please select what to install")
		(help   "Now you can select what you want to install in the \""
			DestDir "\" directory:\n\n"
			"AVD V2.4     - The AVD itself.\n"
			"AVD-Gui V1.0 - The configuration tool.\n"
			"Libraries    - Some external libraries\n\n"
			"Guide files  - Documents for AVD and Gui.\n"
			"NOTE: The libraries installed are publicdomain libraries "
			"I don not guarranty to have the latest version!\n\n"
 			@askoptions-help)
		(choices "AVD V2.4" "AVD-Gui V1.0" "Libraries" "Guide Files")
		(default %1111)
	)
)
(IF (NOT InstallMask)
	(SET Einde "Nothing to install!?? In that case: I'm ready.")
)

;=============================================================================
;======================= Installeren van de AVD ==============================
;=============================================================================

(IF (IN InstallMask Sel_AVD)
(
	(COPYLIB
		(prompt	"Copying the AVD executable")
		(help	@copylib-help)
		(source "Program/AVD")
		(dest	DestDir)
		(infos)
		(confirm)
		(optional "force")
		(optional "askuser")
	)

	(STARTUP "AVD - The Agressive Virus Detector  © E. Th. van den Oosterkamp"
		(prompt	"Adding AVD to the S:User-StartUp\n\n"
			"This will make the AVD to check the\n"
			"system every time you reboot\n\n"
			"Offcourse you can skip this part and\n"
			"drag the AVD icon into your WBStartup\n"
			"drawer instead.\n")
		(help	@startup-help)
		(command ("Path ADD \"%s\"\nAvd" DestDir) )
	)

	(SET Einde "AVD V2.4 was installed succesfully.\n")
))

;=============================================================================
;======================= Installeren van de AVD-Gui ==========================
;=============================================================================

(IF (< KickVer 36)
(
	(SET Result
		(ASKBOOL
			(prompt	"The AVD-Gui needs KickStart 2.0 or higher! "
				"Install it anyway?")
			(help	"The AVD-Gui is about to be installed on a "
				"machine using a V" KickVer " KickStart. Unfortunately "
				"the AVD-Gui needs Kickstart V36 or higher. Since the "
				"AVD-Gui will not work on this machine it is "
				"up to you to decide to install or not...")
			(choices "Install" "Cancel")

		)
	)
	(IF (NOT Result)
		(SET Einde (CAT Einde	"AVD-Gui V1.0 was NOT installed!\n"
					"It needs KickStart 2.0 or higher!\n\n")
		)
	)
))
(IF (AND (IN InstallMask Sel_AVD-Gui) Result)
(
	(COPYLIB
		(prompt	"Copying the AVD-Gui executable")
		(help	@copylib-help)
		(source "Program/AVD-Gui")
		(dest	DestDir)
		(infos)
		(confirm)
		(optional "force")
		(optional "askuser")
	)

	(SET Einde (CAT Einde "AVD-Gui V1.0 was installed succesfully.\n"))
))

;=============================================================================
;======================= Installeren van enkele bibliotheken =================
;=============================================================================

(IF (IN InstallMask Sel_Libs)
(
	(COPYLIB
		(prompt	"Copying Patch.library")
		(help	@copylib-help)
		(source "libs/patch.library")
		(dest	"LIBS:")
		(infos)
		(confirm)
		(optional "force")
		(optional "askuser")
	)
	(COPYLIB
		(prompt	"Copying Bootblock.library")
		(help	@copylib-help)
		(source "libs/Bootblock.library")
		(dest	"LIBS:")
		(infos)
		(confirm)
		(optional "force")
		(optional "askuser")
	)
	(COPYFILES
		(prompt	"Copying the brainfiles")
		(help	@copyfiles-help)
		(source "L")
		(dest	"L:")
		(all)
		(optional "force")
		(optional "askuser")
	)
	(SET Einde (CAT Einde "The libraries were installed succesfully.\n\n"))
))

;=============================================================================
;======================= Installeren van de Guides ===========================
;=============================================================================

(IF (IN InstallMask Sel_Help)
(
	(SET LANGUAGE
		(ASKCHOICE
			(prompt	"Which guide must be installed? ")
			(help	"Please select the language you prefer for"
				"the help file in AmigaGuide format")
			(choices "English" "Nederlands")
		)
	)
	(IF (= LANGUAGE 0)
	(
		(COPYFILES
			(prompt	"Copying the english guide")
			(help	@copyfiles-help)
			(source "Docs/English")
			(dest	 DestDir)
			(all)
			(infos)
			(optional "force")
			(optional "askuser")
		)
	))
	(IF (= LANGUAGE 1)
	(
		(COPYFILES
			(prompt	"Copying the dutch guide")
			(help	@copyfiles-help)
			(source "Docs/Nederlands")
			(dest	 DestDir)
			(all)
			(infos)
			(optional "force")
			(optional "askuser")
		)
	))

	(SET Einde (CAT Einde "The help guide was installed succesfully.\n\n"))
))


(EXIT Einde)
