$SF_1 =	"AutoPlay.exe"			; 		  Setup File Name (yes I ran it off the autorun instead :P)
$UN_1 = "FirstName"			; 		  Your First Name
$UNL_1 = "LastName"			; 		  Your Last Name
$SN_1 = "****-****-****-****-****-****"	; 		  Your S/N
; ----------------------------------------------------------------------------
; Prevent Duplicates From Running
; ----------------------------------------------------------------------------

If WinExists ( $SF_1 ) Then Exit
AutoItWinSetTitle ( $SF_1 )


; ----------------------------------------------------------------------------
; 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",	100)	;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",	4)	;1=start, 2=subStr, 3=exact, 4=...
Opt	("WinWaitDelay",	250)	;250 milliseconds


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

; Execute Installer
If FileExists	( @ScriptDir & "\" & $SF_1 ) Then	
	Run	( @ScriptDir & "\" & $SF_1 )
Else
	Exit
EndIf

; Welcome dialog.
If WinWait("Adobe Photoshop CS with ImageReady CS") Then
ControlClick("Adobe Photoshop CS with ImageReady CS", "", "Button1")
EndIf

; License Agreement.
If WinWait("End User License Agreement") Then
ControlClick("End User License Agreement", "", "Button1")
EndIf

; Install PS & IR
If WinWait("Adobe Photoshop CS with ImageReady CS") Then
ControlClick("Adobe Photoshop CS with ImageReady CS", "", "Static14")
EndIf

; Setup
If WinWait("Adobe Photoshop CS and ImageReady CS Setup") Then
ControlClick("Adobe Photoshop CS and ImageReady CS Setup", "", "Button1")
EndIf

; Wizard
If WinWait("Adobe Photoshop CS and ImageReady CS Setup", "The InstallShield(R) Wizard will install Adobe Photoshop") Then
ControlClick("Adobe Photoshop CS and ImageReady CS Setup", "The InstallShield(R) Wizard will install Adobe Photoshop", "Button1")
EndIf

;Restart
If WinWait("Adobe Photoshop CS and ImageReady CS Setup", "To avoid restarting your system after installation") Then
ControlClick("Adobe Photoshop CS and ImageReady CS Setup", "To avoid restarting your system after installation", "Button1")
EndIf

;Lang
If WinWait("Select Language") Then
ControlClick("Select Language", "Choose the language that you would prefer to view the end user license agreement.", "Button3")
EndIf

; Setup
If WinWait("Adobe Photoshop CS and ImageReady CS Setup") Then
ControlClick("Adobe Photoshop CS and ImageReady CS Setup", "Please read the following License Agreement.", "Button2")
ControlSetText("Adobe Photoshop CS and ImageReady CS Setup", "", "Edit2", $UN_1 )
ControlSetText("Adobe Photoshop CS and ImageReady CS Setup", "", "Edit4", $UNL_1 )

EndIf

;paste key

If WinWait("Adobe Photoshop CS and ImageReady CS Setup") Then
ControlClick("Adobe Photoshop CS and ImageReady CS Setup", "", "Edit6")
ControlSetText	( "Adobe Photoshop CS and ImageReady CS Setup" , "" , "Edit6" , $SN_1 )
EndIf

; Next after serial
If WinWait("Adobe Photoshop CS and ImageReady CS Setup") Then
ControlClick("Adobe Photoshop CS and ImageReady CS Setup", "", "Button2")

EndIf

;Reg ok
If WinWait("Adobe Photoshop CS and ImageReady CS Setup", "Is this registration information correct?") Then
ControlClick("Adobe Photoshop CS and ImageReady CS Setup", "Is this registration information correct?", "Button1")
EndIf

;Destination
If WinWait("Adobe Photoshop CS and ImageReady CS Setup", "Choose Destination Location") Then
ControlClick("Adobe Photoshop CS and ImageReady CS Setup", "Choose Destination Location", "Button1")
EndIf

;File type ass.
If WinWait("Adobe Photoshop CS and ImageReady CS Setup", "Select the file types you would like Photoshop") Then
ControlClick("Adobe Photoshop CS and ImageReady CS Setup", "Select the file types you would like Photoshop", "Button1")
EndIf

;Ok with setup
If WinWait("Adobe Photoshop CS and ImageReady CS Setup") Then
ControlClick("Adobe Photoshop CS and ImageReady CS Setup", "", "Button1")
EndIf


; Activation Screen cancel...
If WinWait("CLASSNAME=#32770", "Intro") Then
ControlClick("CLASSNAME=#32770", "", "Button6")
EndIf

;Adobe Activation
If WinWait("Adobe Activation") Then
ControlClick("Adobe Activation", "", "Button1")
EndIf

; Uncheck readme and finish


If WinWait("Adobe Photoshop CS and ImageReady CS Setup", "Display Photoshop") Then
ControlClick("Adobe Photoshop CS and ImageReady CS Setup", "Display Photoshop", "Button1")
ControlClick("Adobe Photoshop CS and ImageReady CS Setup", "Display Photoshop", "Button4")
Sleep(300)
EndIf

; Uncheck readme and finish
If WinWait("Adobe Photoshop CS and ImageReady CS Setup", "Thank you for choosing Adobe Photoshop CS") Then
ControlClick("Adobe Photoshop CS and ImageReady CS Setup", "Thank you for choosing Adobe Photoshop CS", "Button1")
EndIf

Exit

; EOF