#region - WordWeb install script - (Automated with WinWait functions)
#include <Common_Functions.au3>
Opt('TrayIconDebug', 1)
Break(False)

; Installer.
$executable = 'WordWeb 4.5a.exe'
; Default group folder in startmenu.
$group = ''
; Installation folder in Program Files.
$directory = 'WordWeb'

; Run the installer.
$pid = _Automated()
AdlibEnable('_Adlib')
If WinWait('WordWeb Setup', 'Do not install to system tray', 60) Then
    ControlClick('WordWeb Setup', 'Do not install to system tray', 'TRadioButton2')
    ControlClick('WordWeb Setup', 'Do not install to system tray', 'TButton2')
    WinWait('WordWeb Setup', '&Browse...')
    ControlClick('WordWeb Setup', '&Browse...', 'TButton2')
    WinWait('WordWeb Setup', 'Your English locale')
    ControlClick('WordWeb Setup', 'Your English locale', 'TGroupButton7')
    ControlClick('WordWeb Setup', 'Your English locale', 'TButton2')
    WinWait('WordWeb Setup', 'Help')
    ControlClick('WordWeb Setup', 'Help', 'TButton3')
Else
    _Abort()
EndIf
ProcessWaitClose($pid)

$source = @ProgramsDir & '\WordWeb.lnk'
$destination = @ProgramsDir & '\General'
If FileExists($source) Then
    FileMove($source, $destination & '\WordWeb.lnk', 9)
EndIf

; Remove shortcuts.
If _Programs('WordWeb.lnk') Then
    FileMove('WordWeb.lnk', 'General\', 9)
EndIf

Exit
#endregion

Func _Adlib()
    If WinExists('WordWeb Installation', 'Accept') Then
        ControlClick('WordWeb Installation', 'Accept', 'Button1')
        AdlibDisable()
    EndIf
EndFunc