;说明:本脚本由 《星驰周的软件安装脚本辅助工具》于2010年06月14日所生成,请尊重作者劳动,保留版权信息
Opt("MouseCoordMode", 0);相对激活窗口的坐标
Opt("WinTitleMatchMode", 2);标题的任意子串皆可匹配
Dim $rjlj = IniRead("soft.ini", "设置", "软件路径", @WorkingDir)
Dim $ruanj = $rjlj & "\ttpesetup.exe"
HotKeySet("{F11}", "tuichu");退出
Dim $bt = "千千静听 5.6正式版 安装程序 Unicode"
Dim $txt1 = "最近更新:"
Dim $txt2 = "本软件附赠其它软件的"
Dim $txt3 = "Tree1"
Dim $txt4 = "目标文件夹"
Dim $txt5 = "提示: 如果不想创建"
Dim $txt6 = "完成 千千静听 5."
Dim $dizhi = "http://ttplayer.qianqian.com/download/ttpsetup_563.exe"
Dim $daxiao = InetGetSize($dizhi)
If Not FileExists($rjlj) Then DirCreate($rjlj);如果找不到软件路径就创建
If Not FileExists($ruanj) Then;如果检查不到安装脚本即下载
;开始下载
Local $hDownload = InetGet($dizhi, $ruanj, 1, 1)
$startime = TimerInit()
While Not InetGetInfo($hDownload, 2)
Sleep(100)
$bfb = Round(InetGetInfo($hDownload, 0) * 100 / $daxiao, 0)
ToolTip("下载地址:" & $dizhi & @CRLF & "保存路径:" & $ruanj, 0, @DesktopHeight - 150, "正在下载:" & "(" & $bfb & "%) " & Round(InetGetInfo($hDownload, 0) / 1048576, 2) & " m/" & Round($daxiao / 1048576, 2) & " m " & Round(TimerDiff($startime) / 1000, 0) & "秒")
WEnd
InetClose($hDownload) ; 关闭句柄,释放资源.
ToolTip("")
ProgressOff()
EndIf
Run($ruanj);运行软件
TrayTip(" 温馨提示", "自动安装期间为避免操作失败,请勿动键盘鼠标" & @CRLF & @CRLF & "长时间无反应可按 F11 退出", 15, 4)
Sleep(1000)
WinWait($bt, $txt1)
WinActivate($bt, $txt1)
ControlClick($bt, $txt1, "Button2")
WinWait($bt, $txt2)
WinActivate($bt, $txt2)
ControlClick($bt, $txt2, "Button2")
WinWait($bt, $txt3)
WinActivate($bt, $txt3)
ControlClick($bt, $txt3, "Button2")
WinWait($bt, $txt4)
WinActivate($bt, $txt4)
$var=ControlGetFocus($bt , $txt4)
ControlSetText($bt, $txt4, $var ,"d:\Program Files\TTPlayer")
ControlClick($bt, $txt4, "Button4")
WinWait($bt, $txt5)
WinActivate($bt, $txt5)
ControlClick($bt, $txt5, "Button1")
ControlClick($bt, $txt5, "Button7")
ControlClick($bt, $txt5, "Button4")
ControlClick($bt, $txt5, "Button11")
WinWait($bt, $txt6)
WinActivate($bt, $txt6)
ControlClick($bt, $txt6, "Button1")
ControlClick($bt, $txt6, "Button3")
ControlClick($bt, $txt6, "Button4")
ControlClick($bt, $txt6, "Button17")
TrayTip(" 恭喜!", "已经安装完成,谢谢使用", 5, 4)
Sleep(2000)
;强行退出函数
Func tuichu()
Exit
EndFunc