iccfish / fslib.app.simpleupdater Goto Github PK
View Code? Open in Web Editor NEWA simple automatic update library for .net. 一个炒鸡简单但是足够好用的自动更新库。
Home Page: https://www.fishlee.net/
License: GNU Lesser General Public License v3.0
A simple automatic update library for .net. 一个炒鸡简单但是足够好用的自动更新库。
Home Page: https://www.fishlee.net/
License: GNU Lesser General Public License v3.0
升级包创建工具中,基本信息标签页里,更新前执行若有一次保存过后,重新打开项目后,会留下这个节点未清除,然后报错系统找不到指定的文件,除非重新选择一次未选择就会去除
没有使用说明吗
支持命令行参数变更新程序目录、老版本目录、升级包目录,以及是否保存变更
现在用单线程压缩,速度有点慢
当服务端使用了自签名SSL证书时,升级包zip包无法下载,因为自签名证书不受信任,建议忽略证书错误,或者增加个配置项。
相关代码示例如下:
///
在网络请求之前调用一次即可,全局生效。
例如可以在Updater 类 void UpdateInternal(object sender, RunworkEventArgs e)中第一行补上调用代码。
相关错误日志如下:
DateTime=2022-06-08T07:13:09.9898762Z
AutoUpdater.exe Information: 0 : 正在初始化 3 个WebClient
DateTime=2022-06-08T07:13:09.9918763Z
AutoUpdater.exe Information: 0 : 包【8DE45295C3779350F5D016F69CE54A79.zip】开始下载
DateTime=2022-06-08T07:13:10.0088773Z
AutoUpdater.exe Information: 0 : 包【0D8F45BE38A74ED2B2CF2F3147E0F7C2.zip】开始下载
DateTime=2022-06-08T07:13:10.2888933Z
AutoUpdater.exe Information: 0 : 包【07B2107DBA38E1B7550CBD400FA2C66D.zip】开始下载
DateTime=2022-06-08T07:13:10.2978938Z
AutoUpdater.exe Warning: 0 : 包【0D8F45BE38A74ED2B2CF2F3147E0F7C2.zip】下载失败:基础连接已经关闭: 未能为 SSL/TLS 安全通道建立信任关系。
DateTime=2022-06-08T07:13:10.5729096Z
AutoUpdater.exe Warning: 0 : 包【8DE45295C3779350F5D016F69CE54A79.zip】下载失败:基础连接已经关闭: 未能为 SSL/TLS 安全通道建立信任关系。
DateTime=2022-06-08T07:13:10.5729096Z
AutoUpdater.exe Warning: 0 : 包【07B2107DBA38E1B7550CBD400FA2C66D.zip】下载失败:基础连接已经关闭: 未能为 SSL/TLS 安全通道建立信任关系。
日志显示为服务器返回结果不正确,而不是网络错误。
没事了,是我自己的原因
您好,请问支持msi吗
作者你好,最近在项目中使用出现了这种,导致直接一直WaitOne等待着,线程一直阻塞着
xxx.exe Information: 0 : 正在从 http://xxx/xxx/xxx/update_c.xml?0.327457970160739 下载升级信息
DateTime=2019-07-30T15:58:20.0003233Z
求助,谢谢
If need rollback, only explicit deleted files are restored
添加接口,允许在生成后远程上传到指定服务器上,通过HTTP接口或FTP接口。
FTP上传
WEB上传
RequestCheckComponentFlagEventArgs.cs line:15
是否支持NET6.0
请问是否支持应用版本回退,从高版本回退到低版本,例如目标程序从V1.0升级到V1.1,然后因为某些原因需要回退到V1.0状态
一个项目绑定更新文件保存后,再点击打开另外一个已保存的项目的时候,绑定文件没变化,还是第一个项目保存的绑定文件
当前版本低于最低版本时,抛出的Exception信息不正确,最低版本和已安装版本位置写反了。
代码文件:SimpleUpdater/FSLib.App.SimpleUpdater/Defination/VersionTooLowException.cs
第28行
新功能:在升级文件下载完成之后才提示启动新进程更新。
RT,会识别成 vshost.exe 的版本号,而不是项目启动项的版本号。
程序在启动的时候,检测是否更新,有更新会强制更新,程序启动后有一个手动检测更新,
有更新会使用命令行的形式调用.exe进行更新。
由于两段逻辑是一样,于是将检测的逻辑单独封装成如下代码
但是 .net core的项目发布成单文件的项目,程序启动会报单文件那个错误,而手动检测不会。
是否可以将源码中那个单文件的异常直接关闭?
var updater = FSLib.App.SimpleUpdater.Updater.CreateUpdaterInstance(Config.UpdaterURI);
updater.DownloadUpdateInfoFinished += (e, a) =>
{
updater.Context.EnableEmbedDialog = false;
updater.Context.ForceUpdate = false;
updater.Context.MustUpdate = false;
updater.Context.UpdateInfo.ForceUpdate = false;
updater.Context.UpdateInfo.MustUpdate = false;
};
updater.UpdateError += (e, a) => { };
updater.UpdatesAvailable += (e, a) =>
{
var message = "将升级 {0} (版本 {1}) 到 版本 {2},请等待升级完成。";
var buttons = MessageBoxButtons.OKCancel;
if (!ManualCheckUpdate)
{
message = "将升级 {0} (版本 {1}) 到 版本 {2},请等待升级完成。\r\n\r\n如果无法升级,软件将无法使用。";
buttons = MessageBoxButtons.OK;
}
var dialog = MessageBox.Show(
string.Format(
message,
updater.Context.UpdateInfo.AppName,
updater.Context.CurrentVersion,
updater.Context.UpdateInfo.AppVersion),
"信息",
buttons,
MessageBoxIcon.Information);
if (dialog == DialogResult.OK)
{
StartExternalUpdater();
}
};
使用命令行模式更新会卡在计算下载文件信息界面,无法继续
是否打算支持Croe3.0?
我用txt记录更新日志,绑定文件后默认读取出来是乱码
能不能在自动更新那个界面,自动更新四个字,背景色能放出来,让我们自己改颜色吗?
命令行打开的项目无法保存
也就客户的软件在初始版本 直接升级到 最新版。请问这个支持吗?
Costura会将SimpleUpdater.dll一起打包,启动后会报路径的形式不合法,
需要在FodyWeavers.xml中的Costura节点添加将SimpleUpdater.dll排除后才能正常使用
<Costura> <ExcludeAssemblies> SimpleUpdater </ExcludeAssemblies> </Costura>
请问 点击立即升级,界面无响应 有什么解决方法么?
用最简单的整合方式做的
var updater = App.SimpleUpdater.Updater.CheckUpdateSimple(UpdateUrl, "update_c.xml");
但是会弹出3个提示升级的窗口出来
有关调用实时(JIT)调试而不是此对话框的详细信息,
请参见此消息的结尾。
************** 异常文本 **************
System.ComponentModel.Win32Exception (0x80004005): 系统找不到指定的文件。
在 System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
在 System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
在 FSLib.App.SimpleUpdater.Updater.CleanTemp()
在 FSLib.App.SimpleUpdater.Updater.OnUpdateCancelled()
在 FSLib.App.SimpleUpdater.Updater.CopyAndStartUpdater(String[] ownerProcessList)
在 FSLib.App.SimpleUpdater.Updater.StartExternalUpdater(String[] ownerProcess)
在 FSLib.App.SimpleUpdater.Dialogs.UpdateFound.btnUpdate_Click(Object sender, EventArgs e)
在 System.Windows.Forms.Control.OnClick(EventArgs e)
在 System.Windows.Forms.Button.OnClick(EventArgs e)
在 System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
在 System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
在 System.Windows.Forms.Control.WndProc(Message& m)
在 System.Windows.Forms.ButtonBase.WndProc(Message& m)
在 System.Windows.Forms.Button.WndProc(Message& m)
在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** JIT 调试 **************
要启用实时(JIT)调试,
该应用程序或计算机的 .config 文件(machine.config)的 system.windows.forms 节中必须设置
jitDebugging 值。
编译应用程序时还必须启用
调试。
例如:
启用 JIT 调试后,任何未经处理的异常
都将被发送到在此计算机上注册的 JIT 调试程序,
而不是由此对话框处理。
增加项目同步模式:自动生成要删除的列表,保证完全同步
引发的异常:“System.ObjectDisposedException”(位于 System.Data.SQLite.dll 中)
程序“[14120] PreAudit.exe”已退出,返回值为 -1 (0xffffffff)。
下载完文件,开始解压替换时候卡死
除了自动获得或手动设置版本外,允许从指定的配置文件读取版本号。
当在IIS8.5上使用绝对路径来保存升级包时,有很大几率会失败,服务器返回400错误,指出请求无效。
从nuget获取的4.3版本
使用如下地址 https://www.nuget.org/packages/fishlee.net.simpleupdater/4.3.0?_src=template
自动更新包生成工具4.3.0.0
打包配置
<?xml version="1.0"?>
<AuProject xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<UpdateInfo>
<AppName>Test</AppName>
<AppVersion>4.3.0.0</AppVersion>
<ExecuteTimeout>0</ExecuteTimeout>
<TreatErrorAsNotUpdated>false</TreatErrorAsNotUpdated>
<PromptUserBeforeAutomaticUpgrade>true</PromptUserBeforeAutomaticUpgrade>
<AutoCloseSucceedWindow>true</AutoCloseSucceedWindow>
<DeleteMethod>None</DeleteMethod>
<PackageSize>0</PackageSize>
<ForceUpdate>false</ForceUpdate>
<Packages />
<HideBeforeExecuteWindow>false</HideBeforeExecuteWindow>
<HideAfterExecuteWindow>false</HideAfterExecuteWindow>
<MustUpdate>false</MustUpdate>
<AutoExitCurrentProcess>false</AutoExitCurrentProcess>
<AutoEndProcessesWithinAppDir>true</AutoEndProcessesWithinAppDir>
<AutoKillProcesses>false</AutoKillProcesses>
<RequreAdminstrorPrivilege>false</RequreAdminstrorPrivilege>
</UpdateInfo>
<DefaultFileVerificationLevel>Size Hash</DefaultFileVerificationLevel>
<DefaultUpdateMethod>VersionCompare</DefaultUpdateMethod>
<Files />
<ApplicationDirectory>Test</ApplicationDirectory>
<DestinationDirectory>Update</DestinationDirectory>
<CreateCompatiblePackage>false</CreateCompatiblePackage>
<CompressPackage>true</CompressPackage>
<EnableIncreaseUpdate>true</EnableIncreaseUpdate>
<VersionUpdateSrc>Test\Test.exe</VersionUpdateSrc>
<PackageExtension>zip</PackageExtension>
<UseRandomPackageNaming>true</UseRandomPackageNaming>
<CleanBeforeBuild>true</CleanBeforeBuild>
<ComponentFlags />
</AuProject>
举例
版本1: filea fileb filec
版本2: filea filed
更新版本2后,本地有了 filea fileb filec filed
想要的效果是 本地只有 filea filed
多服务器模式如果不传递AppDirectory和AppVersion参数将会导致抛出异常:ApplicationDirectory can not be null or empty.
使用无锁的日志,避免对日志文件的锁定占用。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.