
; ----------------------------------------------------------------------------
;
; AutoIt Version: 3.0
; Language:       English
; Creator: 				Nologic
; Upadated:       ddSHADOW
; Version:	  2.0
;
; Script Function:
; HyperSnap-DX
;
; ----------------------------------------------------------------------------


; ----------------------------------------------------------------------------
; End User Var's
; ----------------------------------------------------------------------------

$SF_1 = "HS6Setup.exe"					; Setup File Name
$UB_1 = "A"						; Install for (C)urrent User or (A)ll Users
$SM_1 = "HyperSnap 6"				; Start Menu Location
$SM_2 = "N"						; Auto Start HS-DX 6 (Y)es or (N)o
$SM_3 = "N"						; Create Desktop Icon (Y)es or (N)o
$RH_1 = "N"						; Run HS-DX 6 Now (Y)es or (N)o
$SC_1 = "N"						; Delete Link To HyperSnap-DX 6 (Y)es or (N)o
$SC_2 = "N"						; Delete Link To HyperSnap-DX 6 Help (Y)es or (N)o
$SC_3 = "Y"						; Delete Link To Read about HyperSnap-DX 6 (Y)es or (N)o
$SC_4 = "Y"						; Delete Link To Register HyperSnap-DX 6 (Y)es or (N)o
$SC_5 = "Y"						; Delete Link To Uninstall HyperSnap-DX 6 (Y)es or (N)o

; ----------------------------------------------------------------------------
; Prevent Dup Script From Running
; ----------------------------------------------------------------------------

$g_szVersion = "HyperSnap-DX v5.61.00"
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", 5)		;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 Var's
; ----------------------------------------------------------------------------

$title1 = "Setup - CFi ShellToys XP"

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

Run($SF_1)

;Unninstall old instalations
WinWait		("HyperSnap Setup")
$check="already installed"
if WinActive ( "HyperSnap Setup" ,$check ) Then
ControlClick	("HyperSnap Setup", "&Yes", "Button1")
EndIf

;Setup
WinWait		("HyperSnap Setup")
ControlClick	("HyperSnap Setup", "&Next >", "Button2")
;
;
;Licence Agreement
WinWait		("Please accept the License Agreement")
ControlClick	("Please accept the License Agreement", "Yes", "Button2")
;
;
;User Base
WinWait		("HyperSnap Setup")
If $UB_1 = "A" Then
	ControlClick	("HyperSnap Setup", "", "Button2")
EndIf
ControlClick	("HyperSnap Setup", "&Next >", "Button6")
;
;
;Start Menu
ControlSetText	("HyperSnap Setup", "", "Edit1", $SM_1)
If $SM_2 = "Y" Then
	ControlClick	("HyperSnap Setup", "", "Button1")
EndIf
If $SM_3 = "N" Then
	ControlClick	("HyperSnap Setup", "", "Button2")
EndIf
ControlClick	("HyperSnap Setup", "&Next >", "Button4")
;
;
;Ready
ControlClick	("HyperSnap Setup", "&Next >", "Button3")
;
;
;Finish
WinWait		("HyperSnap Setup", "Run HyperSnap")
If $RH_1 = "Y" Then
	ControlClick	("HyperSnap Setup", "Run HyperSnap", "Button1")
EndIf
ControlClick	("HyperSnap Setup", "&Finish >", "Button3")
Sleep(2000)
ProcessClose("IEXPLORE.EXE")
ProcessClose("iexplore.exe")
ProcessClose("firefox.exe")
;
;
;Delete Shortcuts
If $UB_1 = "A" Then
	$SC_P = @ProgramsCommonDir
Else
	$SC_P = @ProgramsDir
EndIf
If $SC_1 = "Y" Then
	FileDelete($SC_P & "\" & $SM_1 & "\HyperSnap 6.lnk")
EndIf
If $SC_2 = "Y" Then
	FileDelete($SC_P & "\" & $SM_1 & "\HyperSnap 6 Help.lnk")
EndIf
If $SC_3 = "Y" Then
	FileDelete($SC_P & "\" & $SM_1 & "\Read about HyperSnap 6.lnk")
EndIf
If $SC_4 = "Y" Then
	FileDelete($SC_P & "\" & $SM_1 & "\Register HyperSnap 6.lnk")
EndIf
If $SC_5 = "Y" Then
	FileDelete($SC_P & "\" & $SM_1 & "\Uninstall HyperSnap 6.lnk")
EndIf

Exit

;EOF