|
本帖最后由 howacter 于 2010-1-6 02:04 编辑
学习Autoit3不久,写了个灵格斯的自动安装脚本,碰到了一个问题,希望各位大大指教。
问题如下:灵格斯程序在安装时,若已有一个安装好的程序在运行,则在最后一步安装时
会弹出一个错误对话框,否则直接继续安装,安装完成后我想用Alt+F4键关闭主界面,
但在最后一步是总是出错。我用的灵格斯是Lingoes v2.6.3-0.
脚本如下:
Run("lingoes")
WinWaitActive("选择安装语言")
ControlSend("选择安装语言","语言","TNewStaticText1","{Enter}")
WinWaitActive("安装程序 - ","欢迎安装")
ControlSend("安装程序 - ","欢迎安装","TNewStaticText2","!n")
WinWaitActive("安装程序 - ","许可证")
ControlSend("安装程序 - ","许可证","TNewStaticText2","!a")
ControlSend("安装程序 - ","许可证","TNewStaticText2","!n")
WinWaitActive("安装程序 - ","安装文件夹")
ControlSend("安装程序 - ","安装文件夹","TNewNotebookPage2","!n")
WinWaitActive("安装程序 - ","额外任务")
ControlSend("安装程序 - ","额外任务","TNewCheckListBox1","{Tab}")
ControlSend("安装程序 - ","额外任务","TNewCheckListBox1","{Space}")
ControlSend("安装程序 - ","额外任务","TNewCheckListBox1","!n")
WinWaitActive("安装程序 - ","准备安装")
ControlSend("安装程序 - ","准备安装","TNewStaticText2","!i")
If WinWaitActive("错误","发生错误") Then
Send("!a")
Else
WinWaitActive("Lingoes 灵格斯","全文翻译")
Send("!{F4}")
EndIf |
|