autoit制作软件自动安装脚本问题
Run("setup.exe")WinWaitActive("WinRAR 自解压文件","目标文件夹")
ControlClick ("WinRAR 自解压文件","安装进度","Button2","left","1")
if winactive("确认文件替换") Then
send("!a")
EndIf
if winactive("修复 NBSGPOS(&R)") Then
send("!f")
EndIf
WinWaitActive("NBSGPOS","欢迎使用 NBSGPOS 安装向导")
ControlClick ("NBSGPOS","下一步(&N) >","Button1","left","1")
WinWaitActive("NBSGPOS","选择安装文件夹")
ControlSetText("NBSGPOS","选择安装文件夹","RichEdit20W1"," C:\Program Files\Setup ")
WinWaitActive("NBSGPOS","选择安装文件夹")
ControlClick ("NBSGPOS","下一步(&N) >","Button1","left","1")
WinWaitActive("NBSGPOS","确认安装")
ControlClick ("NBSGPOS","确认安装","Button1","left","1")
WinWaitActive("NBSGPOS","安装完成")
ControlClick ("NBSGPOS","安装完成","Button1","left","1")
执行一次解压后,再执行的话,要覆盖,这个怎么写,我上面的第一个IF不会执行(如上图)。程序全部安装后,如果安装第二次,弹出的修复窗口怎么执行?(如下图)全部程序在附件里。
本帖最后由 131738 于 2013-11-18 14:01 编辑
回复 1# fenglin1978
窗口信息工具捕捉控件 ID 然后 ControlClick() ..................
ControlClick() 次数不需引号....
IF那里的控件是这样的。就是没弄出来。 写个while循环,等待1s循环一次;循环几次就可以了 如果,出现这个窗口。点击后退出循环 谢谢 {:face (332):} 不会啊。我想选 全部选是 覆盖后继续 第一个IF解决了。我写成下面的就可以
if winactive("") Then
Send("!a")
EndIf 又有新问题了,执行
WinWaitActive("NBSGPOS","欢迎使用 NBSGPOS 安装向导")
ControlClick ("NBSGPOS","下一步(&N) >","Button1","left","1")
需要等10多秒才能进入下一步,这个什么情况?我也没写延迟语句啊。
回复 8# fenglin1978
如果你的电脑卡的话,就有可能又不“执行”了!
页:
[1]