; ----------------------------------------------------------------------------
; Language:       English
; Platform:       Win9x / NT
; Author:         FuzzBall
; Script Function:
;	Ad-aware 6 Professional
; ----------------------------------------------------------------------------

; ----------------------------------------------------------------------------
; End User Var's
; ----------------------------------------------------------------------------
$SF_1 =	"Ad-aware.exe"						;	Setup File Name
$DL_1 = @ProgramFilesDir & "\Ad-aware\"				; 	Location For Installation
$DD_1 = "daemonB1"						;	Bus driver name
$DD_2 = "daemonP1"						;	Miniport driver name
$OP_1 = "n"							;	(Y)es or (N)o - Install German Language Files
$OP_2 = "n"							;	(Y)es or (N)o - Install HexDump extension
$OP_3 = "n"							;	(Y)es or (N)o - Install FilResource-Dump extension
$OP_4 = "n"							;	(Y)es or (N)o - Install Ad-aware user manual
$SN_1 = "******"						;	Serial Number

; ----------------------------------------------------------------------------
; Prevent Duplicates From Running
; ----------------------------------------------------------------------------

$g_szVersion = "Ad-aware Pro v.6.0.1.162"
If WinExists($g_szVersion) Then Exit ; It"s already running
AutoItWinSetTitle($g_szVersion)


; ----------------------------------------------------------------------------
; Script Defaults
; ----------------------------------------------------------------------------

Opt	("CaretCoordMode",	1)	;1=absolute, 0=relative
Opt	("ExpandEnvStrings",	0)	;0=don"t expand, 1=do expand
Opt	("MouseClickDelay",	10)	;10 milliseconds
Opt	("MouseClickDownDelay",	10)	;10 milliseconds
Opt	("MouseClickDragDelay",	250)	;250 milliseconds
Opt	("MouseCoordMode",	0)	;1=absolute, 0=relative
Opt	("MustDeclareVars",	0)	;0=no, 1=require pre-declare
Opt	("PixelCoordMode",	1)	;1=absolute, 0=relative
Opt	("RunErrorsFatal",	1)	;1=fatal, 0=silent set @error
Opt	("SendAttachMode",	0)	;0=don"t attach, 1=do attach
Opt	("SendCapslockMode",	1)	;1=store and restore, 0=don"t
Opt	("SendKeyDelay",	1)	;5 milliseconds
Opt	("SendKeyDownDelay",	1)	;1 millisecond
Opt	("TrayIconDebug",	1)	;0=no info, 1=debug line info
Opt	("TrayIconHide",	0)	;0=show, 1=hide tray icon
Opt	("WinDetectHiddenText",	0)	;0=don"t detect, 1=do detect
Opt	("WinSearchChildren",	1)	;0=no, 1=search children also
Opt	("WinTitleMatchMode",	3)	;1=start, 2=subStr, 3=exact, 4=...
Opt	("WinWaitDelay",	250)	;250 milliseconds


; ----------------------------------------------------------------------------
; Script Start
; ----------------------------------------------------------------------------

Run		(@ComSpec & " /c " & "start " & $SF_1 , "", @SW_HIDE)

$Title_1 = "Ad-aware 6 Professional"
$Title_2 = "Password"

; Welcome
WinWaitActive( $Title_1 , "Welcome")
ControlClick	( $Title_1 , "", "Button1" )

; License Agreement
WinWaitActive( $Title_1 , "License Agreement")
ControlClick	( $Title_1 , "", "Button1" )

; Desination Location
WinWaitActive	( $Title_1 , "different folder" )
ControlClick	( $Title_1 , "", "Button5" )
ControlSetText	( "" , "", "Edit1", $DL_1 )
Send ("{ENTER}")
ControlClick	( $Title_1 , "", "Button1" )

; Install options
WinWaitActive	( $Title_1 , "options" )
If $OP_1 = "y" Then MouseClick ( "left", 170, 115, 1, 1 )
If $OP_2 = "y" Then MouseClick ( "left", 170, 130, 1, 1 )
If $OP_3 = "y" Then MouseClick ( "left", 170, 145, 1, 1 )
If $OP_4 = "n" Then MouseClick ( "left", 170, 160, 1, 1 )
ControlClick	( $Title_1 , "", "Button1" )

; Start Install
WinWaitActive	( $Title_1 , "ready" )
ControlClick	( $Title_1 , "", "Button1" )

; Install and Get Serial
WinWaitActive	( $Title_2 , "")
WinActivate ( $Title_2 , "")	;Make sure window is the active window
Send	( $SN_1 )		;Use this b/c SetText doesnt work
ControlClick	( $Title_2 , "", "Button2" )

; Finish Install
WinWaitActive	( $Title_1 , "successfully" )
ControlClick	( $Title_1 , "", "Button1" )


Exit
