;; ----------------------------------------------------------------------------
;
; AutoIt Version: 3.0
; Language:       English
; Platform:       Win9x / NT
; Author:         FuzzBall
;
; Script Function:
; Winamp 2.91
;
; ----------------------------------------------------------------------------


; ----------------------------------------------------------------------------
; Set up our defaults/Variables
; ----------------------------------------------------------------------------

AutoItSetOption("WinTitleMatchMode", 1)
$dir="C:\Program Files\Winamp"			;Installation directory
$SF= "Winamp291_full.exe"			;Setup file name


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

Run($SF)

WinWaitActive("Winamp Setup: License Agreement")
Send("!A")
WinWaitActive("Winamp Setup: Installation Options")
;Disable Media Library
Send("{TAB 3}  & "{DOWN}" & "{SPACE}")
;Disable WInamp Agent
Send("{DOWN}" & "{SPACE}")
;Disable Video Support(Dont know of anyone who uses winamp for video)
Send("{DOWN 2}" & "{SPACE}")
;Diable Advanced VS Studio
Send("{DOWN}" & "{RIGHT}" & "{DOWN 2}" & "{SPACE}")
;Remove that annoying AOL Icon
Send("{DOWN 2}" & "{SPACE}")
;Next Screen
Send("!N")
WinWaitActive("Winamp Setup: Installation Folder")
ControlSetText("", "", "Edit1", $dir )
Send("!I")
WinWaitActive("Winamp Setup: Settings")
Send("{ENTER}")
WinWaitActive("Winamp Setup: User information")
ControlCommand("Winamp Setup: User information", "Yes, allow anonymous usage statistics (Recommended)", "Button5", "UnCheck", "")
ControlCommand("Winamp Setup: User information", "Stop bugging me!", "Button6", "UnCheck", "")
Send("{ENTER}")
WinWaitActive("Winamp Setup: Winamp successfully installed")
Send("{ENTER}")
;install is finished, winamp now launches

;Waits for winamp to start, then silently kills it
WinWaitActive("Winamp 2.91")
RunWait(@ComSpec & " /c " & 'taskkill.exe /F /IM winamp.exe', "", @SW_HIDE)