GeneralUpdate.Core
2.1.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package GeneralUpdate.Core --version 2.1.0
NuGet\Install-Package GeneralUpdate.Core -Version 2.1.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="GeneralUpdate.Core" Version="2.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add GeneralUpdate.Core --version 2.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: GeneralUpdate.Core, 2.1.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install GeneralUpdate.Core as a Cake Addin
#addin nuget:?package=GeneralUpdate.Core&version=2.1.0
// Install GeneralUpdate.Core as a Cake Tool
#tool nuget:?package=GeneralUpdate.Core&version=2.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
GeneralUpdate
- GeneralUpdate是基于.net framwork开发的一款(c/s应用)自动升级程序。
- 将更新的核心部分抽离出来方便应用于多种项目当中目前适用于wpf,控制台应用,winfrom。相比以前更方便的是不需要在过分关注源码可直接通过nuget直接使用。
- 如果有任何使用问题可以在Github的issues上进行提问我会每周统一找时间解决并解答bug或者问题。或者联系文章末尾的联系方式会有人解答。
如何使用:
Gitee(码云)地址:https://gitee.com/Juster-zhu/GeneralUpdate
Nuget地址:https://www.nuget.org/packages/GeneralUpdate.Core/
GitHub地址: https://github.com/WELL-E/AutoUpdater GeneralUpdate版本在 Branch:Autoupdate2。
#region Launch1
args = new string[6] {
"0.0.0.0",
"1.1.1.1",
"https://github.com/WELL-E",
"http://192.168.50.225:7000/update.zip",
@"E:\PlatformPath",
"509f0ede227de4a662763a4abe3d8470",
};
GeneralUpdateBootstrap bootstrap = new GeneralUpdateBootstrap();//自动更新引导类
bootstrap.DownloadStatistics += OnDownloadStatistics;//下载进度通知事件
bootstrap.ProgressChanged += OnProgressChanged;//更新进度通知事件
bootstrap.Strategy<DefultStrategy>().//注册策略,可自定义更新流程
Option(UpdateOption.Format, "zip").//指定更新包的格式,目前只支持zip
Option(UpdateOption.MainApp, "your application name").//指定更新完成后需要启动的主程序名称不需要加.exe直接写名称即可
RemoteAddress(args).//这里的参数保留了之前的参数数组集合
Launch();//启动更新
#endregion
#region Launch2
/*
* Launch2
* 新增了第二种启动方式
* 流程:
* 1.指定更新地址,https://api.com/GeneralUpdate?version=1.0.0.1 在webapi中传入客户端当前版本号
* 2.如果需要更新api回返回给你所有的更新信息(详情内容参考 /Models/UpdateInfo.cs)
* 3.拿到更新信息之后则开始http请求更新包
* 4.下载
* 5.解压
* 6.更新本地文件
* 7.关闭更新程序
* 8.启动配置好主程序
* 更新程序必须跟主程序放在同级目录下
*/
//GeneralUpdateBootstrap bootstrap2 = new GeneralUpdateBootstrap();
//bootstrap2.DownloadStatistics += OnDownloadStatistics;
//bootstrap2.ProgressChanged += OnProgressChanged;
//bootstrap2.Strategy<DefultStrategy>().
// Option(UpdateOption.Format, "zip").
// Option(UpdateOption.MainApp, "").
// RemoteAddress(@"https://api.com/GeneralUpdate?version=1.0.0.1").//指定更新地址
// Launch();
#endregion
private static void OnProgressChanged(object sender, ProgressChangedEventArgs e)
{
if (e.Type == ProgressType.Updatefile)
{
var str = $"当前更新第:{e.ProgressValue}个,更新文件总数:{e.TotalSize}";
Console.WriteLine(str);
}
if (e.Type == ProgressType.Done)
{
Console.WriteLine("更新完成");
}
}
private static void OnDownloadStatistics(object sender, DownloadStatisticsEventArgs e)
{
Console.WriteLine($"下载速度:{e.Speed},剩余时间:{e.Remaining.Minute}:{e.Remaining.Second}");
}
开发作者: JusterZhu & WELL-E
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net452 is compatible. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
- 7z.Libs (>= 19.0.1)
- Newtonsoft.Json (>= 8.0.3)
- SevenZipSharp.Net45 (>= 1.0.19)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
4.14.21 | 333 | 7/20/2023 |
4.14.20 | 156 | 6/23/2023 |
4.11.20 | 633 | 11/6/2022 |
4.11.19 | 379 | 10/24/2022 |
4.11.18 | 386 | 10/10/2022 |
4.10.13 | 695 | 3/24/2022 |
4.10.12 | 411 | 3/23/2022 |
3.6.10 | 628 | 9/1/2021 |
3.6.9 | 315 | 8/28/2021 |
3.6.8 | 320 | 8/14/2021 |
3.2.1 | 911 | 3/17/2021 |
2.1.0 | 1,168 | 8/29/2020 |
2.0.0 | 524 | 5/3/2020 |
Based on.Net framework,an automatic upgrade program for c/s application is developed. Thecore part of the update can be easily used in many projects.