|
本帖最后由 sanye000001 于 2010-10-25 15:19 编辑
近日,本人写了一个卡巴斯基自动安装程序,代码如下,可是到了安装向导的欢迎界面时,不管用mouseclick还是controlclick命令,对这个界面的控件都不起作用,请指点。
WinWaitActive("卡巴斯基反病毒软件 7.0","欢迎使用卡巴斯基反病毒软件")
controlclick("卡巴斯基反病毒软件 7.0","欢迎使用卡巴斯基反病毒软件","Button1")
winwaitactive("卡巴斯基反病毒软件 7.0","最终用户授权许可协议")
controlclick("卡巴斯基反病毒软件 7.0","最终用户授权许可协议","Button2")
sleep(3000)
ControlClick("卡巴斯基反病毒软件 7.0","最终用户授权许可协议","Button5")
WinWaitActive("卡巴斯基反病毒软件 7.0","请选择最适合您需求的安装类型")
ControlClick("卡巴斯基反病毒软件 7.0","请选择最适合您需求的安装类型","Button2")
controlsettext("卡巴斯基反病毒软件 7.0","选择目的文件夹","RichEdit20W1","f:\测试安装autoit\杀毒软件\卡巴斯基7.0")
ControlClick("卡巴斯基反病毒软件 7.0","选择目的文件夹","Button4")
WinWaitActive("卡巴斯基反病毒软件 7.0","选择您想安装的功能")
controlclick("卡巴斯基反病毒软件 7.0","选择您想安装的功能","Button5")
WinWaitActive("卡巴斯基反病毒软件 7.0","在安装前启动自我保护")
ControlCommand("卡巴斯基反病毒软件 7.0","在安装前启动自我保护","Button1","check",'')
ControlClick("卡巴斯基反病毒软件 7.0","在安装前启动自我保护","Button3")
sleep(80000)
WinWaitActive("卡巴斯基反病毒软件 7.0","安装成功完成")
ControlClick("卡巴斯基反病毒软件 7.0","安装成功完成","Button2")
sleep(10000)
WinWaitActive("安装向导:卡巴斯基反病毒软件","稍后激活(&L)")
controlclick("安装向导:卡巴斯基反病毒软件","稍后激活(&L)","AVP.Button7") ;这步开始,所有的命令都不起作用了
ControlClick("安装向导:卡巴斯基反病毒软件","稍后激活(&L)","AVP.Button48")
winwaitactive("安装向导:卡巴斯基反病毒软件","基本保护")
controlclick("安装向导:卡巴斯基反病毒软件","基本保护","AVP.Button12")
controlclick("安装向导:卡巴斯基反病毒软件","基本保护","AVP.Button48")
WinWaitActive("安装向导:卡巴斯基反病毒软件","更新模式")
controlclick("安装向导:卡巴斯基反病毒软件","更新模式","AVP.Button18")
ControlClick("安装向导:卡巴斯基反病毒软件","更新模式","AVP.Button48")
WinWaitActive("安装向导:卡巴斯基反病毒软件","扫描启动对象")
ControlClick("安装向导:卡巴斯基反病毒软件","扫描启动对象","AVP.Button48")
WinWaitActive("安装向导:卡巴斯基反病毒软件","启用密码保护")
ControlClick("安装向导:卡巴斯基反病毒软件","启用密码保护","AVP.Button48")
sleep(10000)
WinWaitActive("安装向导:卡巴斯基反病毒软件","重启计算机(&R)")
ControlCommand("安装向导:卡巴斯基反病毒软件","重启计算机(&R)","AVP.Button43","uncheck",'')
ControlClick("安装向导:卡巴斯基反病毒软件","重启计算机(&R)","AVP.Button48")
winclose("安装向导:卡巴斯基反病毒软件") |
|