Opt("WinSearchChildren", 1)
Opt("WinDetectHiddenText", 1)
Opt("WinTextMatchMode", 2)
Opt("WinTitleMatchMode", 2)
$Title= "腾讯QQ2011 安装向导"
$Exe = "QQ2011.exe"
If ProcessExists($Exe) Then ProcessClose($Exe)
If Run($Exe) = 0 Then ShellExecute($Exe)
TrayTip("提示", "最好关闭安全软件,以免影响自动安装效果"&@CRLF&"自动安装期间,请勿动键盘鼠标", 3, 1)
Do
Sleep(10);
Until WinExists($Title)
WinWait($Title, "我已阅读并同意软件许可协议和青少年上网安全指引")
WinActive($Title, "我已阅读并同意软件许可协议和青少年上网安全指引")
ControlClick($Title, "我已阅读并同意软件许可协议和青少年上网安全指引", "Button1")
ControlClick($Title, "我已阅读并同意软件许可协议和青少年上网安全指引", "Button3")
WinWaitActive($Title, "请选择自定义安装选项与快捷方式选项")
ControlClick($Title, "请选择自定义安装选项与快捷方式选项", "Button9")
ControlClick($Title, "请选择自定义安装选项与快捷方式选项", "Button12")
ControlClick($Title, "请选择自定义安装选项与快捷方式选项", "Button17")
ControlClick($Title, "请选择自定义安装选项与快捷方式选项", "Button19")
ControlClick($Title, "请选择自定义安装选项与快捷方式选项", "Button7")
ControlClick($Title, "请选择自定义安装选项与快捷方式选项", "Button2")
WinWaitActive($Title, "程序安装目录")
ControlSetText($Title, "程序安装目录", "Edit1", "D:\Tencent\QQ")
ControlClick($Title, "程序安装目录", "Button2")
WinWaitActive($Title, "软件更新方式")
ControlClick($Title, "软件更新方式", "Button2")
ControlClick($Title, "软件更新方式", "Button4")
WinWaitActive($Title, "安装完成")
ControlClick($Title, "安装完成", "Button8")
ControlClick($Title, "安装完成", "Button6")
ControlClick($Title, "安装完成", "Button9")
ControlClick($Title, "安装完成", "Button7")
ControlClick($Title, "安装完成", "Button2")
TrayTip("提示", "已经安装完成", 3, 1)
Sleep(2000)
Exit
没测试XP,你可以测试下