
; ----------------------------------------------------------------------------
;
; AutoIt Version: 3.0
; Language:       English
; Platform:       Win9x / NT
; Author:         Nologic
; Co-Author:	  Powerhouse
;
; Script Function:
; Stardock CursorXP 1.3
;
; ----------------------------------------------------------------------------


; ----------------------------------------------------------------------------
; End User Var"s
; ----------------------------------------------------------------------------

$SF_1 =	"cursorxpplus.exe"				; Setup File Name
$SN_1 = "CX-xxxxxxxxxxxxxxxxxxxx-xxxxxxxxx"		; Serial Number
$UI_L = "English"					; User Language
$DL_1 = @ProgramFilesDir & "\GUI\CursorXP"		; Destination Location
$RN_1 = "N"						; Read Release Notes
$CC_1 = "N"						; Configure CursorXP
$SK_1 = "A"						; Installed SKin
; Delete CursorXP Short Cuts
$SC_1 = "N"						; (Y)es or (N)o - Delete Short Cut For Configure CursorXP
$SC_2 = "Y"						; (Y)es or (N)o - Delete Short Cut For CursorXP Plus
$SC_3 = "Y"						; (Y)es or (N)o - Delete Short Cut For Eula
$SC_4 = "Y"						; (Y)es or (N)o - Delete Short Cut For Readme
$SC_5 = "Y"						; (Y)es or (N)o - Delete Short Cut For Uninstall CursorXP
$SC_6 = "Y"						; (Y)es or (N)o - Delete Short Cut For Website


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

$g_szVersion = "CursorXP 1.3"
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",	0)	;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		( $SF_1 )

; License
WinWaitActive	( "Stardock CursorXP setup" )
ControlClick	( "Stardock CursorXP setup", "I accept all the terms of the preceding License Agreement", "Button4" )
ControlClick	( "Stardock CursorXP setup", "Next", "Button2" )

; Registration
ControlSetText	( "Stardock CursorXP setup", "", "Edit2", $SN_1 )
ControlClick	( "Stardock CursorXP setup", "Next", "Button2" )

; Language
If $UI_L <> "English" Then
	ControlClick	("Stardock CursorXP setup", "", "ComboBox1")
	If $UI_L = "croatian"		 Then Send	( "{UP 4}" )
	If $UI_L = "czech"		 Then Send	( "{UP 3}" )
	If $UI_L = "danish"		 Then Send	( "{UP 2}" )
	If $UI_L = "dutch"		 Then Send	( "{UP}" )
	If $UI_L = "french"		 Then Send	( "{DOWN}" )
	If $UI_L = "german"		 Then Send	( "{DOWN 2}" )
	If $UI_L = "greek"		 Then Send	( "{DOWN 3}" )
	If $UI_L = "hebrew"		 Then Send	( "{DOWN 4}" )
	If $UI_L = "italian"		 Then Send	( "{DOWN 5}" )
	If $UI_L = "korean"		 Then Send	( "{DOWN 6}" )
	If $UI_L = "latvian"		 Then Send	( "{DOWN 7}" )
	If $UI_L = "magyar"		 Then Send	( "{DOWN 8}" )
	If $UI_L = "norwegian"		 Then Send	( "{DOWN 9}" )
	If $UI_L = "persian"		 Then Send	( "{DOWN 10}" )
	If $UI_L = "polish"		 Then Send	( "{DOWN 11}" )
	If $UI_L = "portuguese"		 Then Send	( "{DOWN 12}" )
	If $UI_L = "portuguese (brasil)" Then Send	( "{DOWN 13}" )
	If $UI_L = "russian"		 Then Send	( "{DOWN 14}" )
	If $UI_L = "serbian"		 Then Send	( "{DOWN 15}" )
	If $UI_L = "simplified chinese"  Then Send	( "{DOWN 16}" )
	If $UI_L = "slovensko"		 Then Send	( "{DOWN 17}" )
	If $UI_L = "spanish"		 Then Send	( "{DOWN 18}" )
	If $UI_L = "swedish"		 Then Send	( "{DOWN 19}" )
	If $UI_L = "traditional chinese" Then Send	( "{DOWN 20}" )
	If $UI_L = "turkish"		 Then Send	( "{DOWN 21}" )
	ControlClick	( "Stardock CursorXP setup", "", "ComboBox1" )
EndIf
ControlClick	( "Stardock CursorXP setup", "Next", "Button2" )

; Destination Location
WinWaitActive	( "Stardock CursorXP setup", "Setup will install Stardock CursorXP in the following folder." )
MouseClickDrag	( "left", 42, 250, 284, 250, 1 )
Send		( "{DELETE}" & $DL_1 )
ControlClick	( "Stardock CursorXP setup", "Next", "Button2" )

; Finish
WinWait		( "Stardock CursorXP setup", "Choose the final options, then click Finish to complete the installation." )
If $RN_1 = "n" Then MouseClick ( "left", 44, 202, 1, 1 )
If $CC_1 = "n" Then MouseClick ( "left", 44, 234, 1, 1 )
ControlClick	( "Stardock CursorXP setup", "Finish", "Button2" )

; Mouse Properties
Sleep	( 500 )
If WinExists ( "Mouse Properties" ) Then WinClose ( "Mouse Properties" )

; Create Directorys if Non-Existant
If FileExists	( @ProgramsCommonDir & "\Object Desktop" ) = 0 Then DirCreate ( @ProgramsCommonDir & "\Object Desktop" )

; Move Directorys
DirMove		( @ProgramsCommonDir & "\StarDock CursorXP", @ProgramsCommonDir & "\Object Desktop\CursorXP" )

; Delete Old Directory
DirRemove 	( @ProgramsCommonDir & "\StarDock CursorXP", 1 )

; Copy Themes
If FileExists	(@WorkingDir & "\Themes") Then
	DirCopy	(@WorkingDir & "\Themes", $DL_1 & "\Themes", 1)

EndIf

; Theme Configuration
Run		( @ProgramFilesDir & "\GUI\CursorXP\curxpcpl.exe" )
Sleep		( 1000)

; Theme Configuration (Continued)
WinWaitActive	( "CursorXP configuration" )
Send		( $SK_1 & "{ENTER}" )

Exit

; EOF