GeneralUpdate 2021.08.14更新公告
GeneralUpdate是基于.net standard2.0開發(fā)的一款(c/s應(yīng)用)自動(dòng)升級程序。該組件將更新的核心部分抽離出來方便應(yīng)用于多種項(xiàng)目當(dāng)中目前適用于wpf,控制臺(tái)應(yīng)用,winfrom。
1.Notice
預(yù)計(jì)會(huì)使用Blazor開發(fā)GeneralUpdate官網(wǎng),介紹組件結(jié)構(gòu)、更新流程、快速啟動(dòng)、參數(shù)等內(nèi)容。
- 1.主程序啟動(dòng)時(shí)檢測升級程序是否需要更新2.需要更新則把升級程序版本號上傳并逐版本更新3.升級程序更完成后或不需要更新,則進(jìn)行判斷主程序是否需要更新如果需要更新則啟動(dòng)升級程序4.請求主程序更新版本5.請求到主版本多個(gè)更新包并逐版本更新6.更新完成后關(guān)閉升級程序啟動(dòng)主程序
以上更新、下載過程均支持?jǐn)帱c(diǎn)續(xù)傳和逐版本更新。
逐版本下載功能是根據(jù)版本發(fā)布時(shí)間進(jìn)行排序的發(fā)布時(shí)間越早的版本越先更新(具體信息見源碼中的sql腳本字段內(nèi)容)。
逐版本下載的更新包最大測試過1G更新內(nèi)容。
2.Nuget
(New)https://www.nuget.org/packages/GeneralUpdate.Common/
(New)https://www.nuget.org/packages/GeneralUpdate.ClientCore/
(New)https://www.nuget.org/packages/GeneralUpdate.AspNetCore/
https://www.nuget.org/packages/GeneralUpdate.Zip/
https://www.nuget.org/packages/GeneralUpdate.Single/
(Update)https://www.nuget.org/packages/GeneralUpdate.Core/
3.Issues & Git 、Gitee
歡迎在以下地址提出issues提出時(shí)盡可能的描述清楚異常發(fā)生的原因或缺陷詳情,check周期為每周的周五。
https://gitee.com/Juster-zhu/GeneralUpdate
https://github.com/WELL-E/AutoUpdater/tree/autoupdate2
https://github.com/WELL-E/AutoUpdater/issues
https://gitee.com/Juster-zhu/GeneralUpdate/issues
4.New
GeneralUpdate.Core添加逐版本更新功能
GeneralUpdate.Core新增事件ExceptionEvent、MutiDownloadStatisticsEvent、MutiDownloadErrorEvent、MutiDownloadCompletedEvent、MutiDownloadProgressEvent、MutiAllDownloadCompletedEvent。
GeneralUpdate.Core新增RemoteAddressBase64方法。
新增ClientParameter類,用于組件之間進(jìn)程通訊傳遞參數(shù)。
新增組件GeneralUpdate.AspNetCore,具有根據(jù)升級類型返回更新版本信息的功能并支持管道依賴注入使用,但需要自己編寫查庫的方法。
新增組件GeneralUpdate.ClientCore,
(1)具有更新升級組件版本功能(更新程序更新自己)
(2)支持升級組件的逐版本更新(多更新包同時(shí)下載)
(3)便捷啟動(dòng)升級程序,擺脫之前的繁瑣進(jìn)程啟動(dòng)和傳參。
新增組件GeneralUpdate.Common 該庫整合了組件內(nèi)使用的所有公共類和輔助方法(該組件為必須組件,該組件更新頻率非常低不推薦打包在更新包中)。
新增mysql腳本,用于創(chuàng)建GeneralUpdate.AspNetCore服務(wù)端使用的update_version表。
5.Remove
移除GeneralUpdate.Core中所有的通知事件替換為MutixxxxEvent.
移除GeneralUpdate.Core中GeneralUpdateBootstrap啟動(dòng)中通過進(jìn)程傳遞參數(shù)的方法RemoteAddress方法。
移除更新失敗版本回滾功能,該功能導(dǎo)致在C盤回滾更新時(shí)因權(quán)限不夠發(fā)生致命異常問題,該功能考慮后續(xù)開放。
6.Fix
修復(fù)https ssl訪問失敗問題。
修復(fù)其他.net框架版本注冊事件begininvoke通知異常問題。
修改多處類名單詞拼寫錯(cuò)誤問題。
對若干Model類刪除了不必要字段。
7.Quick Start
(1) Example GeneralUpdate.ClientCore
//Clinet version.var mainVersion = "1.1.1";var mianType = 1;//Updater versionclientParameter = new ClientParameter();clientParameter.ClientVersion = "1.1.1";clientParameter.ClientType = 2;clientParameter.AppName = "AutoUpdate.ConsoleApp";clientParameter.MainAppName = "AutoUpdate.Test";clientParameter.InstallPath = @"D:\update_test";clientParameter.UpdateLogUrl = "https://www.baidu.com/";clientParameter.ValidateUrl = $"https://127.0.0.1:5001/api/update/getUpdateValidate/{ clientParameter.ClientType }/{ clientParameter.ClientVersion }";clientParameter.UpdateUrl = $"https://127.0.0.1:5001/api/update/getUpdateVersions/{ clientParameter.ClientType }/{ clientParameter.ClientVersion }";clientParameter.MainValidateUrl = $"https://127.0.0.1:5001/api/update/getUpdateValidate/{ mianType }/{ mainVersion }";clientParameter.MainUpdateUrl = $"https://127.0.0.1:5001/api/update/getUpdateVersions/{ mianType }/{ mainVersion }";generalClientBootstrap = new GeneralClientBootstrap();generalClientBootstrap.MutiDownloadProgressChanged += OnMutiDownloadProgressChanged;generalClientBootstrap.MutiDownloadStatistics += OnMutiDownloadStatistics;generalClientBootstrap.MutiDownloadCompleted += OnMutiDownloadCompleted;generalClientBootstrap.MutiAllDownloadCompleted += OnMutiAllDownloadCompleted;generalClientBootstrap.MutiDownloadError += OnMutiDownloadError;generalClientBootstrap.Exception += OnException;generalClientBootstrap.Config(clientParameter).Strategy<ClientStrategy>();await generalClientBootstrap.LaunchTaskAsync();(2) Example GeneralUpdate.Core
static void Main(string[] args){var resultBase64 = args[0];var bootstrap = new GeneralUpdateBootstrap();bootstrap.Exception += OnException;bootstrap.MutiDownloadError += OnMutiDownloadError;bootstrap.MutiDownloadCompleted += OnMutiDownloadCompleted;bootstrap.MutiDownloadStatistics += OnMutiDownloadStatistics;bootstrap.MutiDownloadProgressChanged += OnMutiDownloadProgressChanged;bootstrap.MutiAllDownloadCompleted += OnMutiAllDownloadCompleted;bootstrap.Strategy<DefaultStrategy>().Option(UpdateOption.DownloadTimeOut, 60).RemoteAddressBase64(resultBase64).LaunchAsync();}(3) Example GeneralUpdate.AspNetCore
Startup.cspublic void ConfigureServices(IServiceCollection services){services.AddControllers();services.AddSingleton<IUpdateService, GeneralUpdateService>();}UpdateController.csprivate readonly ILogger<UpdateController> _logger;private readonly IUpdateService _updateService;public UpdateController(ILogger<UpdateController> logger, IUpdateService updateService){_logger = logger;_updateService = updateService;}/// <summary>/// https://localhost:5001/api/update/getUpdateVersions/1/1.1.1/// </summary>/// <param name="clientType"> 1:ClientApp 2:UpdateApp</param>/// <param name="clientVersion"></param>/// <returns></returns>[HttpGet("getUpdateVersions/{clientType}/{clientVersion}")]public async Task<IActionResult> GetUpdateVersions(int clientType, string clientVersion){_logger.LogInformation("Client request 'GetUpdateVersions'.");var resultJson = await _updateService.UpdateVersionsTaskAsync(clientType, clientVersion, UpdateVersions);return Ok(resultJson);}/// <summary>/// https://localhost:5001/api/update/getUpdateValidate/1/1.1.1/// </summary>/// <param name="clientType"> 1:ClientApp 2:UpdateApp</param>/// <param name="clientVersion"></param>/// <returns></returns>[HttpGet("getUpdateValidate/{clientType}/{clientVersion}")]public async Task<IActionResult> GetUpdateValidate(int clientType, string clientVersion){_logger.LogInformation("Client request 'GetUpdateValidate'.");var lastVersion = GetLastVersion();var resultJson = await _updateService.UpdateValidateTaskAsync(clientType, clientVersion, lastVersion, true, GetValidateInfos);return Ok(resultJson);}8.Recruit
(1)招募志同道合的小伙伴一起參加GeneralUpdate組件開源。
(2)招募設(shè)計(jì)師,為GeneralUpdate組件設(shè)計(jì)logo。該招募為付費(fèi)招募價(jià)格、耗時(shí)由設(shè)計(jì)者定。
以上有意向的小伙伴可以通過郵件聯(lián)系zhuzhen723723@outlook.com
設(shè)計(jì)需求如下
需求一:
使用場景,博客、微信公眾號、微信、QQ的頭像。尺寸:200X200 或 300 X 300 文件格式:jpg 元素:宇航員、宇宙、飛船一類。寓意:在編程的技術(shù)里探索。參考內(nèi)容:https://www.douban.com/note/688440600/
需求二:
使用場景:自動(dòng)更新軟件圖標(biāo)。文件格式、尺寸:(icon 4545)、(jpg 300300) 元素:不限、更新。寓意:現(xiàn)代化、極簡、自動(dòng)、更新。軟件名稱:GeneralUpdate
總結(jié)
以上是生活随笔為你收集整理的GeneralUpdate 2021.08.14更新公告的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 架构 | 聊聊我心中的架构设计观
- 下一篇: FastGithub让Github畅通无