#NoTrayIcon
;--------------------------------------------------------------;脚本开始
Opt("TrayIconDebug", 1) ;0=无信息, 1=调试信息
Opt("WinTextMatchMode", 2) ;1=完全匹配, 2=快速匹配
Opt("WinTitleMatchMode", 4) ;1=开头, 2=子串, 3=完全, 4=高级
Opt("WinSearchChildren", 1) ;0=不搜索, 1=搜索子窗口
Opt("WinDetectHiddenText", 1) ;0=不检测, 1=检测
;--------------------------------------------------------------;设置脚本参数
$WinTitle_1 = '安装 - 迅闪2011客户端'
$Wintxt_1 = '下一步(&N) >'
$Wintxt_2 = '许可协议'
$Wintxt_3 = '选择目标位置'
$wintxt_4 = '安装向导完成'
$Wintxt_5 = '完成(&F)'
;--------------------------------------------------------------;窗口元素变量声明
$path = "D:\Program Files\HintSoft\GameMenu\Data\Client.ini"
$ip = "192.168.1.253"
$Exe = '120428XsClient.exe'
If ProcessExists($Exe) Then ProcessClose($Exe)
If Run($Exe) = 0 Then ShellExecute($Exe)
Do
Sleep(10);
Until WinExists($WinTitle_1)
;WinMove($Wintitle_1, "", -1000, -1000)
;--------------------------------------------------------------;程序启动,显示界面
;WinSetOnTop($Wintitle_1, "", 1);窗口置顶
;BlockInput (1);屏蔽鼠标与键盘(输入).
If WinExists($WinTitle_1, "") Then
WinActivate("$Wintitle_1", "")
WinWaitActive($WinTitle_1, $Wintxt_1, 1);
WinActivate($WinTitle_1, $Wintxt_1)
EndIf
ControlClick($WinTitle_1, $Wintxt_1, "TNewButton1");---------------;点击按钮控件: 下一步(&N) >
If WinExists($WinTitle_1, "") Then
WinActivate("$Wintitle_1", "")
WinWaitActive($WinTitle_1, $Wintxt_2, 1);
WinActivate($WinTitle_1, $Wintxt_2)
EndIf
ControlClick($WinTitle_1, $Wintxt_2, "TNewRadioButton1");---------------;点击按钮控件: 我同意此协议(&A)
ControlClick($WinTitle_1, $Wintxt_2, "TNewButton2");---------------;点击按钮控件: 下一步(&N) >
If WinExists($WinTitle_1, "") Then
WinActivate("$Wintitle_1", "")
WinWaitActive($WinTitle_1, $Wintxt_3, 1);
WinActivate($WinTitle_1, $Wintxt_3)
EndIf
ControlSetText($WinTitle_1, $Wintxt_3, "TEdit1", "D:\Program Files\Hintsoft\GameMenu");------;重置文本框控件文本
ControlClick($WinTitle_1, $Wintxt_3, "TNewButton3");---------------;点击按钮控件: 下一步(&N) >
Do
Sleep(10);
Until WinExists($WinTitle_1, $wintxt_4);
If WinExists($WinTitle_1, "") Then
WinActivate($WinTitle_1, "")
WinWaitActive($WinTitle_1, $wintxt_4, 1);
WinActivate($WinTitle_1, $wintxt_4)
ControlClick($WinTitle_1, $wintxt_4, "TNewButton3");---------------;点击按钮控件: 完成(&F) >
EndIf
BlockInput(0);启用鼠标与键盘(输入).
ProcessWait("DriversInstall.exe");---------------;一直等待此进程出现
If ProcessExists("DriversInstall.exe") Then ;判断进程是否存在
ProcessClose("DriversInstall.exe");结束进程
EndIf
IniWrite($path, "Server", "ip", $ip);向迅闪配置文件中写入服务器IP地址
MsgBox(64, "安装完成!", "迅闪游戏菜单已经安装设置完毕!", 0.5)
Opt("TrayIconHide", 0) ;不隐藏图标
Exit