首先谢谢你写的这个功能,我在试用的时候遇到以下情况:
在使用命令行模式调用更新,
当升级包的文件很多,更新时出现此提示:“更新时发生错误,请稍后重试” ,更新失败;
将文件减少,再创建升级包,更新成功。
更新的日志节选:
更新失败的log:
SimpleUpdater.exe Information: 0 : 启动外部清理进程。
SimpleUpdater.exe Information: 0 : 正在从 \\\\update-server\\TestUpdatePackage\\update_c.xml 下载升级信息
SimpleUpdater.exe Information: 0 : 服务器返回数据----->10668字节
SimpleUpdater.exe Information: 0 : 数据非正常数据, 正在执行解压缩
SimpleUpdater.exe Information: 0 : 服务器返回信息--->
....
SimpleUpdater.exe Information: 0 : 外部升级包列表:C:\Users\Tony\AppData\Local\Temp\3f2d4092-2944-4b15-b24a-f261e5148421\packages.xml
SimpleUpdater.exe Information: 0 : 外部文件保留列表:C:\Users\Tony\AppData\Local\Temp\3f2d4092-2944-4b15-b24a-f261e5148421\reservefile.xml
SimpleUpdater.exe Information: 0 : 开始下载网络更新包
SimpleUpdater.exe Information: 0 : 正在初始化 3 个WebClient
SimpleUpdater.exe Information: 0 : 包【971C0DE22DA1BDE2518DE78592E2FFBF.zip】开始下载
SimpleUpdater.exe Information: 0 : 包【2AB9C2CC3344B4685B21FC5ECE6AE658.zip】开始下载
SimpleUpdater.exe Information: 0 : 等待下载队列完成操作
SimpleUpdater.exe Information: 0 : 包【2AB9C2CC3344B4685B21FC5ECE6AE658.zip】下载操作完成:下载成功
SimpleUpdater.exe Information: 0 : 等待下载队列完成操作
SimpleUpdater.exe Information: 0 : 完成下载网络更新包
SimpleUpdater.exe Information: 0 : 包【971C0DE22DA1BDE2518DE78592E2FFBF.zip】下载操作完成:下载成功
SimpleUpdater.exe Information: 0 : 开始解压缩升级包
SimpleUpdater.exe Information: 0 : 正在解压缩 971C0DE22DA1BDE2518DE78592E2FFBF.zip
SimpleUpdater.exe Information: 0 : 完成解压缩 971C0DE22DA1BDE2518DE78592E2FFBF.zip
SimpleUpdater.exe Information: 0 : 正在解压缩 2AB9C2CC3344B4685B21FC5ECE6AE658.zip
SimpleUpdater.exe Information: 0 : 完成解压缩 2AB9C2CC3344B4685B21FC5ECE6AE658.zip
SimpleUpdater.exe Information: 0 : 完成解压缩升级包
SimpleUpdater.exe Information: 0 : 开始关闭进程
SimpleUpdater.exe Information: 0 : 添加进程PID=6004到等待关闭列表时出错:ID 为 6004 的进程当前未运行。
SimpleUpdater.exe Information: 0 : 正在执行外部进程,路径:cmd.exe,参数:/c "C:\Users\Tony\AppData\Local\Temp\3f2d4092-2944-4b15-b24a-f261e5148421\files\utilities\updb.cmd"
SimpleUpdater.exe Warning: 0 : 更新中断,发生错误:用于启动进程的环境块不能多于 65535 个字节。您的环境块的长度为 98358 个字节。请移除一些环境变量,然后再试一次。
SimpleUpdater.exe Warning: 0 : System.InvalidOperationException: 用于启动进程的环境块不能多于 65535 个字节。您的环境块的长度为 98358 个字节。请移除一些环境变量,然后再试一次。
在 System.Diagnostics.EnvironmentBlock.ToByteArray(StringDictionary sd, Boolean unicode)
在 System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
在 System.Diagnostics.Process.Start()
在 System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
在 FSLib.App.SimpleUpdater.Updater.RunExternalProgram(RunworkEventArgs e, String program, String arguments, Boolean waitingForExit, Boolean hide)
在 FSLib.App.SimpleUpdater.Updater.RunExternalProgramBefore(RunworkEventArgs e)
在 FSLib.App.SimpleUpdater.Updater.UpdateInternal(Object sender, RunworkEventArgs e)
在 FSLib.App.SimpleUpdater.Wrapper.BackgroundWorker.OnDoWork(RunworkEventArgs e)
在 FSLib.App.SimpleUpdater.Wrapper.BackgroundWorker.RunWorkAsyncInternal(Object e)
成功的log:
SimpleUpdater.exe Information: 0 : 启动外部清理进程。
SimpleUpdater.exe Information: 0 : 正在从 \\\\update-server\\TestUpdatePackage\\update_c.xml 下载升级信息
SimpleUpdater.exe Information: 0 : 服务器返回数据----->6531字节
SimpleUpdater.exe Information: 0 : 数据非正常数据, 正在执行解压缩
SimpleUpdater.exe Information: 0 : 服务器返回信息--->
....
SimpleUpdater.exe Information: 0 : 外部升级包列表:C:\Users\Tony\AppData\Local\Temp\308da8eb-8eeb-46b2-8643-1563e2cb07aa\packages.xml
SimpleUpdater.exe Information: 0 : 外部文件保留列表:C:\Users\Tony\AppData\Local\Temp\308da8eb-8eeb-46b2-8643-1563e2cb07aa\reservefile.xml
SimpleUpdater.exe Information: 0 : 开始下载网络更新包
SimpleUpdater.exe Information: 0 : 正在初始化 3 个WebClient
SimpleUpdater.exe Information: 0 : 包【971C0DE22DA1BDE2518DE78592E2FFBF.zip】开始下载
SimpleUpdater.exe Information: 0 : 包【2AB9C2CC3344B4685B21FC5ECE6AE658.zip】开始下载
SimpleUpdater.exe Information: 0 : 等待下载队列完成操作
SimpleUpdater.exe Information: 0 : 包【2AB9C2CC3344B4685B21FC5ECE6AE658.zip】下载操作完成:下载成功
SimpleUpdater.exe Information: 0 : 包【971C0DE22DA1BDE2518DE78592E2FFBF.zip】下载操作完成:下载成功
SimpleUpdater.exe Information: 0 : 等待下载队列完成操作
SimpleUpdater.exe Information: 0 : 完成下载网络更新包
SimpleUpdater.exe Information: 0 : 开始解压缩升级包
SimpleUpdater.exe Information: 0 : 正在解压缩 971C0DE22DA1BDE2518DE78592E2FFBF.zip
SimpleUpdater.exe Information: 0 : 完成解压缩 971C0DE22DA1BDE2518DE78592E2FFBF.zip
SimpleUpdater.exe Information: 0 : 正在解压缩 2AB9C2CC3344B4685B21FC5ECE6AE658.zip
SimpleUpdater.exe Information: 0 : 完成解压缩 2AB9C2CC3344B4685B21FC5ECE6AE658.zip
SimpleUpdater.exe Information: 0 : 完成解压缩升级包
SimpleUpdater.exe Information: 0 : 开始关闭进程
SimpleUpdater.exe Information: 0 : 添加进程PID=5252到等待关闭列表时出错:ID 为 5252 的进程当前未运行。
SimpleUpdater.exe Information: 0 : 正在执行外部进程,路径:cmd.exe,参数:/c "C:\Users\Tony\AppData\Local\Temp\308da8eb-8eeb-46b2-8643-1563e2cb07aa\files\utilities\updb.cmd"
SimpleUpdater.exe Information: 0 : 等待外部进程执行完毕
SimpleUpdater.exe Information: 0 : 外部进程执行完毕
SimpleUpdater.exe Information: 0 : 备份文件: D:\test\Release\utilities\..\apps.exe -> C:\Users\Tony\AppData\Local\Temp\308da8eb-8eeb-46b2-8643-1563e2cb07aa\backup\apps.exe
SimpleUpdater.exe Information: 0 : 安装文件: C:\Users\Tony\AppData\Local\Temp\308da8eb-8eeb-46b2-8643-1563e2cb07aa\files\apps.exe -> D:\test\Release\utilities\..\apps.exe
SimpleUpdater.exe Information: 0 : 安装文件: C:\Users\Tony\AppData\Local\Temp\308da8eb-8eeb-46b2-8643-1563e2cb07aa\files\Prog\A.exe -> D:\test\Release\utilities\..\Prog\A.exe
SimpleUpdater.exe Information: 0 : 正在执行外部进程,路径:cmd.exe,参数:/c "D:\test\Release\utilities\..\utilities\upda.cmd"
SimpleUpdater.exe Information: 0 : 外部进程执行完毕