回复 3# szhzps
运行后弹出错误,如图
将那行注释掉后正常运行并成功安装,我是用win7系统32位旗舰版测测的
#Region ;**** 参数创建于 ACNWrapper_GUI ****
#PRE_Icon=D:\Program Files\Baofeng\StormPlayer.exe
#PRE_Outfile=暴风影音5全自动安装脚本x.exe
#PRE_Compile_Both=y
#PRE_UseX64=y
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
HotKeySet("{F11}", "tuichu");退出
Opt("MouseCoordMode", 0);相对激活窗口的坐标
Opt("WinTitleMatchMode", 2);标题的任意子串皆可匹配
Local Const $Reg_Firewall = "HKLM\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\AuthorizedApplications\List"
Local Const $Reg_Uninstall = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\storm2"
Local $TargetPath = @ProgramFilesDir & "\StormII\"
Local $KeyValue = RegRead($Reg_Uninstall, "UninstallString")
Local $Str_Tmp1 = StringSplit($KeyValue, "\")
Local $Str_Tmp2 = StringTrimRight($KeyValue, StringLen($Str_Tmp1[$Str_Tmp1[0]]) + 1)
If $Str_Tmp2 <> "" Then $TargetPath = $Str_Tmp2
RegWrite($Reg_Firewall, $TargetPath & "\box\Stline.exe", "REG_SZ", $TargetPath & "\box\Stline.exe:*:Disabled:暴风盒子")
RegWrite($Reg_Firewall, $TargetPath & "\Storm.exe", "REG_SZ", $TargetPath & "\Storm.exe:*:Disabled:暴风影音")
RegWrite($Reg_Firewall, $TargetPath & "\Stormtray.exe", "REG_SZ", $TargetPath & "\Stormtray.exe:*:Disabled:暴风影音的伺服托盘程序,用于快速访问进入电脑的新媒体文件以及打开暴风影音软件")
RegWrite($Reg_Firewall, $TargetPath & "\StormUpdate.dll", "REG_SZ", $TargetPath & "\StormUpdate.dll:*:Disabled:暴风影音媒体控制中心")
RegWrite($Reg_Firewall, $TargetPath & "\stormliv.exe", "REG_SZ", $TargetPath & "\stormliv.exe:*:Enabled:暴风影音媒体控制中心")
RegWrite($Reg_Firewall, $TargetPath & "\stormpop.exe", "REG_SZ", $TargetPath & "\stormpop.exe:*:Disabled:暴风影音资源组件")
;Disable xp firewall
ProcessClose("storm.exe")
ProcessClose("stormtray.exe")
ProcessClose("stline.exe")
ProcessClose("StormUpdate.exe")
ProcessClose("stormpop.exe")
ProcessClose("BugReport.exe")
;Kill process
Dim $InetgetCUT,$Inetget2,$str,$setup,$pathexe
Dim $rjlj = IniRead("soft.ini","设置","程序路径",@WorkingDir)
Dim $Exe = ""
Dim $path = "d:\softfiles\"
Dim $ruanj = $rjlj & $Exe
Dim $zcmc="暴风影音5",$reg="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
Dim $bt = "安装 暴风影音5 正式版"
Dim $txt1="是"
Dim $dizhi = "http://dl.baofeng.com/baofeng5/Baofeng5-5.09.0215.exe"
Dim $daxiao = InetGetSize($dizhi)
;If Not FileExists($rjlj) Then DirCreate($rjlj);如果找不到软件路径就创建
;If Not FileExists($ruanj) Then;如果检查不到安装文件脚本即下载
;检测文件夹是否存在
If Not FileExists($path) Then
DirCreate ($path)
endif
;取文件名
$INETGET2 = StringStripWS ($dizhi,4)
;MsgBox(0,"完成提示框","检测到的文件名:" & $INETGET2)
IF $exe = " " or $exe = "" then ;如果"本地文件路径"为空格或为空,那么从远程路径里面取文件名
$setup = ""
$InetgetCUT = $Inetget2
while 1 ;;;这个循环就是从远程路径里面取文件名了,从最后一个字符一直向前循环,遇到"/"字符时跳出循环
$str = StringRight ($InetgetCUT,1)
;MsgBox(0,"完成提示框","检测到的文件名:" & $str)
Select
Case $str = ""
;RETURN ;注释掉该行
Case $str = "/"
EXITLOOP
Case Else
$InetgetCUT = StringTrimRight ($InetgetCUT,1)
$setup = $str & $setup
; MsgBox(0,"完成提示框","检测到的文件名:" & $setup)
EndSelect
wend
;ELSE
$exe = $SETUP ;;否则把"本地文件路径"中的内容放入$SETUP
ENDIF
;开始下载
;MsgBox(0,"完成提示框","开始下载,请稍假")
$pathexe = $path & $exe
;检测文件是否存在,存在就跳过,否则下载
If Not FileExists($pathexe) Then
;下载过程
$load = InetGet ($dizhi,$pathexe,1,1)
MsgBox(0,"完成提示框","文件名:" & $pathexe)
ProgressOn("炫狐软件在线安装器", "正在为你下载,请稍后.....")
While 1
If InetGetInfo($load, 2) = True Then ExitLoop
InetGetInfo($load, 1)
$rou = Round(InetGetInfo($load, 0) / InetGetInfo($load, 1), 2) * 100
ProgressSet($rou, "已下载:" & $rou & "%" & " "&"保存路径:" & $path)
Sleep(100)
WEnd
ProgressSet(100, "下载完成")
ProgressOff()
endif
$star = TimerInit()
TrayTip("温馨提示","自动安装期间为避免操作失败,请勿动键盘鼠标" & @CRLF & @CRLF & "长时间无反应可按 F11 退出", 20)
Sleep(1000)
If ProcessExists($Exe) Then ProcessClose($Exe)
If Run($pathexe) = 0 Then ShellExecute($pathexe)
Do
Sleep(10);
Until WinExists($zcmc)
;处理重复安装问题,自动
If WinExists($bt,$txt1)Then
WinWaitActive($bt,$txt1)
ControlClick($bt,$txt1, "Button1")
EndIf
;许可协议
WinWait("安装 暴风影音5 正式版","许可协议")
WinActivate("安装 暴风影音5 正式版","许可协议")
WinWaitActive("安装 暴风影音5 正式版","许可协议")
Send("{Space}")
;程序安装目录
WinWait("安装 暴风影音5 正式版","程序安装目录")
WinActivate("安装 暴风影音5 正式版","程序安装目录")
WinWaitActive("安装 暴风影音5 正式版","程序安装目录")
;Send("{del}")
Send("d:\Program Files\Baofeng\")
Send("{TAB}")
Send("{TAB}")
Send("{Space}")
Send("{TAB}")
Send("{Space}")
Send("{TAB}")
Send("{Space}")
Send("!N")
;选择解码器
If WinExists("安装 暴风影音5 正式版","解码器") Then
WinWaitActive("安装 暴风影音5 正式版","解码器")
ControlClick("安装 暴风影音5 正式版", "解码器", "Button2")
EndIf
;安装完成
WinWait("安装 暴风影音5 正式版","完成")
WinActivate("安装 暴风影音5 正式版","完成")
WinWaitActive("安装 暴风影音5 正式版","完成")
Sleep(5000)
While WinActive("安装 暴风影音5 正式版")<>0
WinWaitActive("安装 暴风影音5 正式版", "",20 )
ControlClick("安装 暴风影音5 正式版", "完成", "Button2")
WEnd
;关闭完装后启动进程
While 1
Select
Case ProcessExists("stormPlayer.exe")
ProcessClose("stormPlayer.exe")
ExitLoop
Case ProcessExists("BaofengPlatform.exe")
ProcessClose("BaofengPlatform.exe")
ExitLoop
EndSelect
Wend
;删除桌面多余快捷方式
FileDelete(@DesktopDir & "\暴风影视库.lnk")
;FileDelete(@StartMenuCommonDir & "\程序\暴风影音\暴风游戏.lnk")
;创建桌面快捷方式
;FileCreateShortcut ("C:\\Lotus\\Notes\\Notes.exe",@DesktopDir&"\\Notes.lnk","C:\\Lotus\\Notes\\")
;FileCreateShortcut ("D:\Program Files\Baofeng\StormPlayer.exe",@DesktopDir & "\暴风5.lnk","d:\Program Files\Baofeng")
;安装用时
TrayTip($ruanj&"安装完成!","共计耗时:" & Int(TimerDiff($star) / 1000) & "秒.谢谢使用!", 20)
Sleep(500)
;强行结束
Func tuichu()
Exit
EndFunc
|