经测试,上面的脚本存在一定的问题:
1.如果已经在“标签模式”下事先打开一个网页,则安装结束后无法关闭网页;
2.如果不是首次安装,会出现已经安装的提示,安装将暂停;
因此,以上程序只适用于首次安装。下面是经过修改的脚本,请方家指正:
Run("福昕阅读器(FoxitReader)_3.1.4.1211.exe")
TrayTip( "正在安装","福昕阅读器(FoxitReader)_3.1.4.1211,请稍后......",1)
$T="福昕阅读器安装向导"
WinWaitActive($T,"你已经安装了福昕阅读器. 是否要继续安装?",3)
Send("!y")
WinWaitActive($T,"支持MSAA")
ControlClick($T,"支持MSAA","Button1")
WinWaitActive($T,"许可协议")
ControlClick($T,"许可协议","Button1")
WinWait($T,"选择您所需要的组件进行安装")
ControlClick($T,"选择您所需要的组件进行安装","Button2")
WinWait($T,"请选择安装路径")
ControlClick($T,"请选择安装路径","Button1");采用默认路径安装
WinWait($T,"添加桌面快捷方式")
ControlClick($T,"添加桌面快捷方式","Button3");取消”添加桌面快捷方式“
ControlClick($T,"添加桌面快捷方式","Button4");取消”添加到开始菜单项“
ControlClick($T,"添加桌面快捷方式","Button7");取消”添加到快速启动栏“
ControlClick($T,"添加桌面快捷方式","Button1")
WinWait($T,"点击“安装”按钮继续安装")
ControlClick($T,"点击“安装”按钮继续安装","Button1")
WinWait($T,"福昕阅读器安装成功")
ControlClick($T,"福昕阅读器安装成功","Button2");取消“运行福昕阅读器”
ControlClick($T,"福昕阅读器安装成功","Button1")
Sleep(6000)
While 1
Select
Case ProcessExists("IEXPLORE.EXE")
ProcessClose("IEXPLORE.EXE")
ExitLoop
Case ProcessExists("Maxthon.exe")
processClose("Maxthon.exe")
ExitLoop
Case ProcessExists("360SE.exe")
ProcessClose("360SE.exe")
ExitLoop
EndSelect
Wend |