121044246 发表于 2010-9-14 23:29:19

PPS网络电视

$title= "PPS影音"
WinWait($title,"PPS影音 安装向导")
ControlClick($title,"PPS影音 安装向导","下一步(&N) >")

WinWait($title,"选择附加任务")
ControlClick($title,"选择附加任务","创建快速启动快捷方式")
sleep(100)
ControlClick($title,"选择附加任务","开机自动运行PPS影音")
sleep(100)
ControlClick($title,"选择附加任务","安装PPS影讯屏保")
sleep(100)
ControlClick($title,"选择附加任务","下一步(&N) >")

WinWait($title,"选择文件关联")
ControlCommand ($title,"选择文件关联","ComboBox1","SetCurrentSelection","2")
sleep(100)
ControlClick($title,"选择文件关联","Button2")

WinWait("安装","免费的Google工具栏",1)
ControlClick("安装","免费的","安装 Google 工具栏")
sleep(100)
ControlClick("安装","免费的","下一步(&N) >")

WinWait($title,"选择推荐软件",1)
If WinExists($title,"选择推荐软件")=1 Then
WinWait($title,"选择推荐软件")
ControlClick($title,"选择推荐软件","全不选")
sleep(100)
ControlClick($title,"选择推荐软件","安装(&I)")
WinWait($title,"完成(&F)")
ProcessClose ("PPS网络电视.exe")
Exit
Else
WinWait($title,"完成(&F)")
ProcessClose ("PPS网络电视.exe")
EndIf

121044246 发表于 2010-9-17 20:22:52

回复 2# tjz257


    用不用延时其实都是可行的。。用延时就是怕有些旧机器反应不过来照成脚本出错

4216730 发表于 2010-9-18 01:49:09

不用RUN先让安装程序运行吗

121044246 发表于 2010-9-18 02:32:57

本帖最后由 121044246 于 2010-9-18 22:08 编辑

回复 4# 4216730


    要的.这个你可以自己添加一下就好了..

我自己用的是这样写的,你可以参考一下

在安装程序的目录在创建一个文件夹,文件夹名称可以随便取,我是把脚本都放Auto_install里面$title= "PPS影音"
$path=StringLeft(@ScriptDir, StringInStr(@ScriptDir, "\", 0, -1));取得上级目录路径,
$soft=$path&"PPS网络电视.exe";安装程序的路径,
If FileExists($soft) = 0 Then Exit
;========检测是否安装此软件,已安装则自动退出脚本==============
For $i =1 To 1000
$read=RegEnumKey("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall",$i)
If $read = "PPStream" Then
Exit
EndIf       
Next
ShellExecute($soft)
WinWait($title,"PPS影音 安装向导")
ControlClick($title,"PPS影音 安装向导","下一步(&N) >")

WinWait($title,"选择附加任务")
ControlClick($title,"选择附加任务","创建快速启动快捷方式")
sleep(100)
ControlClick($title,"选择附加任务","开机自动运行PPS影音")
sleep(100)
ControlClick($title,"选择附加任务","安装PPS影讯屏保")
sleep(100)
ControlClick($title,"选择附加任务","下一步(&N) >")

WinWait($title,"选择文件关联")
ControlCommand ($title,"选择文件关联","ComboBox1","SetCurrentSelection","2")
sleep(100)
ControlClick($title,"选择文件关联","Button2")

WinWait("安装","免费的Google工具栏",1)
ControlClick("安装","免费的","安装 Google 工具栏")
sleep(100)
ControlClick("安装","免费的","下一步(&N) >")

WinWait($title,"选择推荐软件",1)
If WinExists($title,"选择推荐软件")=1 Then
WinWait($title,"选择推荐软件")
ControlClick($title,"选择推荐软件","全不选")
sleep(100)
ControlClick($title,"选择推荐软件","安装(&I)")
WinWait($title,"完成(&F)")
ProcessClose ("PPS网络电视.exe")
Exit
Else
WinWait($title,"完成(&F)")
ProcessClose ("PPS网络电视.exe")
EndIf

4216730 发表于 2010-9-18 03:59:42

学习了你的第二 三行的写法
如果第二行不减1,第三行就不用"\",不是更方便点吗

121044246 发表于 2010-9-18 10:40:35

本帖最后由 121044246 于 2010-9-18 22:08 编辑

回复 6# 4216730


呵呵,你没说我一直都没注意这个..真的是画蛇添足了...
其实还有一个办法就是写把路径写入INI,然后读取INI的路径也可以

adddddddd 发表于 2010-9-22 19:05:20

楼主辛苦了,我觉得这东东太强了

5i5wei 发表于 2010-12-12 22:03:53

{:face (356):}路过支持下
页: [1]
查看完整版本: PPS网络电视