我做了个CAD软件的自助安装包,放在服务器上,供其他用户远程执行安装。
这代码在XP上运行正常;在WIN7上运行ControlSetText无效,其他的正常。
我有试过把 runas 改成 run运行正常(我在测试机上是管理员)。
请各位前辈帮忙指点下,谢谢。]#RequireAdmin
RunAs("admin", "sec", "pasword", 0, "pcad2016prochs-release.exe", "\\fz-fs\sf\02_选装软件\ProgeCAD_2016")
WinWaitActive("欢迎","欢迎来到")
ControlClick("欢迎","欢迎来到","Button2")
WinWaitActive("许可协议","我接受许可协议中的条款")
ControlClick("许可协议","我接受许可协议中的条款","Button5")
ControlClick("许可协议","我接受许可协议中的条款","Button2")
WinWaitActive("选择目标文件夹","C:\Program Files")
ControlSetText("选择目标文件夹","C:\Program Files","Edit1","D:\Program Files\ProgeCAD")
ControlClick("选择目标文件夹","D:\Program Files","Button2")
WinWaitActive("选择选项","选择下面的选项")
ControlClick("选择选项","选择下面的选项","Button2")
WinWaitActive("准备安装","准备安装程序")
ControlClick("准备安装","准备安装程序","Button2")
WinWaitActive("完成","安装向导完成")
ControlClick("完成","安装向导完成","Button2")
|