diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 6a7b8add3c4679d0d8a508402253d0ceafed473c..0000000000000000000000000000000000000000 Binary files a/.DS_Store and /dev/null differ diff --git a/README.md b/README.md index 373eeb006bbacc2f39c63c422b5aad109f44c200..4dbdf8fc5e785f22d3d03fe0a588c5e62d80c53d 100644 --- a/README.md +++ b/README.md @@ -9,23 +9,15 @@ ### 组件介绍 ### -GeneralUpdate是基于.net standard开发的一款(c/s应用)自动升级程序。该组件将更新的核心部分抽离出来方便应用于多种项目当中目前适用于wpf,控制台应用,winfrom。 +GeneralUpdate是立志于成为全平台更新客户端的框架,提供高性能低损耗,断点续传、逐版本更新、二进制差分更新、增量更新功能、配置文件保留更新等特性。 ### 支持框架 -理论支撑:https://docs.microsoft.com/zh-cn/dotnet/standard/net-standard - -| 框架名称 | 是否支持 | -| ------------------------------------- | ---------------- | -| .NET Core 2.0 | 支持 | -| .NET 5 6 7 | 支持 | -| .NET Framework 4.6.1 | 支持 | -| Mono 5.4 | 理论支持,未验证 | -| Xamarin.iOS | 理论支持,未验证 | -| Xamarin.Mac | 理论支持,未验证 | -| Xamarin.Android | 理论支持,未验证 | -| Universal Windows Platform 10.0.16299 | 理论支持,未验证 | -| Unity 2018.1 | 理论支持,未验证 | +| 框架名称 | 是否支持 | +| -------------------- | -------- | +| .NET Core 2.0 | 支持 | +| .NET 5 6 7 | 支持 | +| .NET Framework 4.6.1 | 支持 | | UI框架名称 | 是否支持 | | ----------------- | ----------------------------- | @@ -35,48 +27,22 @@ GeneralUpdate是基于.net standard开发的一款(c/s应用)自动升级程 | Avalonia | 未验证,等待反馈 | | WinUI | 未验证,等待反馈 | | Console(控制台) | 支持 | +| winform | 支持 | ### 操作系统 | 操作系统名称 | 是否支持 | | ------------ | -------- | | Windows | 支持 | -| Linux | 未验证 | -| Mac | 未验证 | +| Linux | 支持 | +| Mac | 支持 | | iOS | 暂不支持 | | Android | 暂不支持 | -### 功能介绍 ### - -- GeneralUpdate.Core:断点续传、逐版本更新。 -- GeneralUpdate.ClientCore:断点续传、逐版本更新、更新组件自更新、便捷启动更新组件 -- GeneralUpdate.AspNetCore:服务端支持更新包下载地址、版本信息等内容。 -- GeneralUpdate.Zip:解压更新包、解压进度通知。 -- GeneralUpdate.Single:应用程序单例运行。 -- GeneralUpdate.Common:组件公共类、方法。 -- 源码"sql"目录下包含mysql数据库表内容的生成脚本。 - ### 帮助文档 ### - 讲解视频: https://www.bilibili.com/video/BV1aX4y137dd - 官方网站: http://justerzhu.cn/ -### 讨论组 ### -GeneralUpdate开源项目讨论QQ群:748744489 - -.Net技术讨论QQ群:580749909 - ### 开源地址 ### - https://github.com/WELL-E/AutoUpdater - https://gitee.com/Juster-zhu/GeneralUpdate - -### 更新流程图 ### -![](imgs/flow2.png) - -### 运行效果及更新流程展示 ### -![](imgs/run.jpg) - -## 支持作者 ### - -作者:Juster.zhu & Charles.Yu - -![](imgs/money.jpg) \ No newline at end of file diff --git a/README_en.md b/README_en.md index ae4f3ad895b5d32961bd447cbef87c4d66f30048..ae98129133bd093a3ed7535de992ddf1bfc8a8ec 100644 --- a/README_en.md +++ b/README_en.md @@ -6,23 +6,15 @@ ### Component is introduced ### -GeneralUpdate is an automatic update program (c/s application) developed based on .net standard. This component extracts the core part of the update for easy application in a variety of projects. Currently, it is suitable for wpf, console applications, and winfrom. +GeneralUpdate is a framework that aims to become a full-platform update client, providing high performance and low loss, breakpoint resuming, version-by-version update, binary differential update, incremental update function, configuration file retention update and other features. ### Support frame -theoretical support :https://docs.microsoft.com/zh-cn/dotnet/standard/net-standard - -| frame name | support | -| ------------------------------------- | --------------------------------- | -| .NET Core 2.0 | yes | -| .NET 5 6 7 | yes | -| .NET Framework 4.6.1 | yes | -| Mono 5.4 | theoretical support, not verified | -| Xamarin.iOS | theoretical support, not verified | -| Xamarin.Mac | theoretical support, not verified | -| Xamarin.Android | theoretical support, not verified | -| Universal Windows Platform 10.0.16299 | theoretical support, not verified | -| Unity 2018.1 | theoretical support, not verified | +| frame name | support | +| -------------------- | ------- | +| .NET Core 2.0 | yes | +| .NET 5 6 7 | yes | +| .NET Framework 4.6.1 | yes | | UI frame name | support | | ------------- | ----------------------------------- | @@ -32,44 +24,22 @@ theoretical support :https://docs.microsoft.com/zh-cn/dotnet/standard/net-stan | Avalonia | theoretical support, not verified | | WinUI | theoretical support, not verified | | Console | yes | +| winform | yes | ### System | System name | support | | ----------- | ------- | | Windows | yes | -| Linux | unknow | -| Mac | unknow | +| Linux | yes | +| Mac | yes | | iOS | no | | Android | no | -### Function is introduced ### - -- GeneralUpdate.Core:Breakpoint continuation, version by version update. -- GeneralUpdate.ClientCore:Breakpoint continuation, version-by-version update, update component self-update, easy to start update components. -- GeneralUpdate.AspNetCore:The server supports updating the download address and version of the package. -- GeneralUpdate.Zip:Decompress the update package and progress notification. -- GeneralUpdate.Single:Application singletons run. -- GeneralUpdate.Common:Component public classes, methods. -- Source "SQL" directory contains mysql database table content generation script. - ### Help document ### - Interpretation of the video: https://www.bilibili.com/video/BV1aX4y137dd - The official website: http://justerzhu.cn/ -### Discussion groups ### -GeneralUpdate QQ Group:748744489 - ### Open source address ### - https://github.com/WELL-E/AutoUpdater - https://gitee.com/Juster-zhu/GeneralUpdate - -### Update flow chart ### -![](imgs/flow2.png) - -### Operation effect and update process display ### -![](imgs/run.jpg) - -## Author ### - -Juster.zhu & Charles.Yu diff --git a/imgs/flow2.png b/imgs/flow2.png deleted file mode 100644 index f31ca6cc26fce687d6a7d6139d23ffcd1eac3227..0000000000000000000000000000000000000000 Binary files a/imgs/flow2.png and /dev/null differ diff --git a/imgs/hfs.jpg b/imgs/hfs.jpg deleted file mode 100644 index 1a5a9dff99577c31aef67d194f229c80545f40c6..0000000000000000000000000000000000000000 Binary files a/imgs/hfs.jpg and /dev/null differ diff --git a/imgs/money.jpg b/imgs/money.jpg deleted file mode 100644 index 57e15e66d2e4d69c69689f69195f24e8435487d4..0000000000000000000000000000000000000000 Binary files a/imgs/money.jpg and /dev/null differ diff --git a/imgs/nuget.jpg b/imgs/nuget.jpg deleted file mode 100644 index 890d4df9bf5d7c34abebf9fe041ac107020bcd86..0000000000000000000000000000000000000000 Binary files a/imgs/nuget.jpg and /dev/null differ diff --git a/imgs/run.jpg b/imgs/run.jpg deleted file mode 100644 index 27c59241a57a9d492a787ab9dec2a6056dd60411..0000000000000000000000000000000000000000 Binary files a/imgs/run.jpg and /dev/null differ diff --git a/imgs/support.jpg b/imgs/support.jpg deleted file mode 100644 index 63cc7acae6150e006ab90cca49f7013bb7ff44b7..0000000000000000000000000000000000000000 Binary files a/imgs/support.jpg and /dev/null differ diff --git a/src/.DS_Store b/src/.DS_Store deleted file mode 100644 index 6b341cc74a9a2f41fa5612d37df80d81d0fd9505..0000000000000000000000000000000000000000 Binary files a/src/.DS_Store and /dev/null differ diff --git a/src/.vs/GeneralUpdate/DesignTimeBuild/.dtbcache.v2 b/src/.vs/GeneralUpdate/DesignTimeBuild/.dtbcache.v2 index 61eee4ec08abf20b2f4428cb038c87ca93ebe6fd..a1aa46d7d5172af6a3b88386bff77b25eda2374d 100644 Binary files a/src/.vs/GeneralUpdate/DesignTimeBuild/.dtbcache.v2 and b/src/.vs/GeneralUpdate/DesignTimeBuild/.dtbcache.v2 differ diff --git a/src/.vs/GeneralUpdate/FileContentIndex/4001e6b6-9667-4f6d-8a24-4c879be812fa.vsidx b/src/.vs/GeneralUpdate/FileContentIndex/4001e6b6-9667-4f6d-8a24-4c879be812fa.vsidx deleted file mode 100644 index b5af2066521fca8d78814a8f17a8da8db4afd8e0..0000000000000000000000000000000000000000 Binary files a/src/.vs/GeneralUpdate/FileContentIndex/4001e6b6-9667-4f6d-8a24-4c879be812fa.vsidx and /dev/null differ diff --git a/src/.vs/GeneralUpdate/FileContentIndex/5831e2df-65fd-450b-8f41-959e0a88c9f6.vsidx b/src/.vs/GeneralUpdate/FileContentIndex/5831e2df-65fd-450b-8f41-959e0a88c9f6.vsidx deleted file mode 100644 index af37b2749ad133aebd737440e5f3bff985cefab0..0000000000000000000000000000000000000000 Binary files a/src/.vs/GeneralUpdate/FileContentIndex/5831e2df-65fd-450b-8f41-959e0a88c9f6.vsidx and /dev/null differ diff --git a/src/.vs/GeneralUpdate/FileContentIndex/6bcd808e-f6d1-4347-b290-4ce6319dadba.vsidx b/src/.vs/GeneralUpdate/FileContentIndex/6bcd808e-f6d1-4347-b290-4ce6319dadba.vsidx new file mode 100644 index 0000000000000000000000000000000000000000..9bccb941d966203188fdaae7a4b2d2b4fafa89af Binary files /dev/null and b/src/.vs/GeneralUpdate/FileContentIndex/6bcd808e-f6d1-4347-b290-4ce6319dadba.vsidx differ diff --git a/src/.vs/GeneralUpdate/FileContentIndex/a2796b8b-0c59-452c-9a22-d2dc55b9caf9.vsidx b/src/.vs/GeneralUpdate/FileContentIndex/a2796b8b-0c59-452c-9a22-d2dc55b9caf9.vsidx deleted file mode 100644 index c6a8d968485f47a8cb7cf70f2ddeda26e019b29c..0000000000000000000000000000000000000000 Binary files a/src/.vs/GeneralUpdate/FileContentIndex/a2796b8b-0c59-452c-9a22-d2dc55b9caf9.vsidx and /dev/null differ diff --git a/src/.vs/GeneralUpdate/FileContentIndex/ab0806e0-a9a1-469b-953d-44e24d30f284.vsidx b/src/.vs/GeneralUpdate/FileContentIndex/ab0806e0-a9a1-469b-953d-44e24d30f284.vsidx deleted file mode 100644 index 6b91e28b33ac01ed7a174e8f3d5adda56391af5e..0000000000000000000000000000000000000000 Binary files a/src/.vs/GeneralUpdate/FileContentIndex/ab0806e0-a9a1-469b-953d-44e24d30f284.vsidx and /dev/null differ diff --git a/src/.vs/GeneralUpdate/FileContentIndex/d7fe8368-8bbe-45ff-acd3-285139aaa8c8.vsidx b/src/.vs/GeneralUpdate/FileContentIndex/d7fe8368-8bbe-45ff-acd3-285139aaa8c8.vsidx new file mode 100644 index 0000000000000000000000000000000000000000..63f142ecdbf759d9ffc2c0a9afe958e572da5dbd Binary files /dev/null and b/src/.vs/GeneralUpdate/FileContentIndex/d7fe8368-8bbe-45ff-acd3-285139aaa8c8.vsidx differ diff --git a/src/.vs/GeneralUpdate/config/applicationhost.config b/src/.vs/GeneralUpdate/config/applicationhost.config deleted file mode 100644 index ae56bfb53a36d903df6e1f76dae49ce52ba9c7e7..0000000000000000000000000000000000000000 --- a/src/.vs/GeneralUpdate/config/applicationhost.config +++ /dev/null @@ -1,989 +0,0 @@ - - - - - - -
-
-
-
-
-
-
-
- - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
- -
-
-
-
-
-
- -
-
-
-
-
- -
-
-
- -
-
- -
-
- -
-
-
- - -
-
-
-
-
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/.vs/GeneralUpdate/v16/Server/sqlite3/db.lock b/src/.vs/GeneralUpdate/v16/Server/sqlite3/db.lock deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/.vs/GeneralUpdate/v16/Server/sqlite3/storage.ide b/src/.vs/GeneralUpdate/v16/Server/sqlite3/storage.ide deleted file mode 100644 index f1de8ade06ed4fd48b8dbc57b1761f3c71f3f479..0000000000000000000000000000000000000000 Binary files a/src/.vs/GeneralUpdate/v16/Server/sqlite3/storage.ide and /dev/null differ diff --git a/src/.vs/GeneralUpdate/v17/.futdcache.v1 b/src/.vs/GeneralUpdate/v17/.futdcache.v1 index 854c5033c0d6d8610d894d48f8f2e27d28aab40a..1357be55c88f8258207d43df6b2d756c440f3303 100644 Binary files a/src/.vs/GeneralUpdate/v17/.futdcache.v1 and b/src/.vs/GeneralUpdate/v17/.futdcache.v1 differ diff --git a/src/.vs/GeneralUpdate/v17/TestStore/0/000.testlog b/src/.vs/GeneralUpdate/v17/TestStore/0/000.testlog deleted file mode 100644 index c42614f70c35f3f0a033e23c75c3eed24073b1c9..0000000000000000000000000000000000000000 Binary files a/src/.vs/GeneralUpdate/v17/TestStore/0/000.testlog and /dev/null differ diff --git a/src/.vs/GeneralUpdate/v17/TestStore/0/testlog.manifest b/src/.vs/GeneralUpdate/v17/TestStore/0/testlog.manifest deleted file mode 100644 index e92ede29d76aefe079835aeae278da5341f6e15c..0000000000000000000000000000000000000000 Binary files a/src/.vs/GeneralUpdate/v17/TestStore/0/testlog.manifest and /dev/null differ diff --git a/src/.vs/ProjectEvaluation/generalupdate.metadata.v1 b/src/.vs/ProjectEvaluation/generalupdate.metadata.v1 deleted file mode 100644 index 711352220efc90e0acfef881f6b7488d797fa500..0000000000000000000000000000000000000000 Binary files a/src/.vs/ProjectEvaluation/generalupdate.metadata.v1 and /dev/null differ diff --git a/src/.vs/ProjectEvaluation/generalupdate.metadata.v2 b/src/.vs/ProjectEvaluation/generalupdate.metadata.v2 index f7a94f8e38b04057b4cb8e1e393cf9e51f797beb..5e89472998dd859b26c10f312610d36fb6993a5d 100644 Binary files a/src/.vs/ProjectEvaluation/generalupdate.metadata.v2 and b/src/.vs/ProjectEvaluation/generalupdate.metadata.v2 differ diff --git a/src/.vs/ProjectEvaluation/generalupdate.projects.v1 b/src/.vs/ProjectEvaluation/generalupdate.projects.v1 deleted file mode 100644 index 575db31806800fc6393ccfad358e3b690aa0023d..0000000000000000000000000000000000000000 Binary files a/src/.vs/ProjectEvaluation/generalupdate.projects.v1 and /dev/null differ diff --git a/src/.vs/ProjectEvaluation/generalupdate.projects.v2 b/src/.vs/ProjectEvaluation/generalupdate.projects.v2 index c2af29994882c7e2a81cb09fd4bfd7f028d3d786..f17cd7aa3fcc24c0ba820cad8f25c208f0338872 100644 Binary files a/src/.vs/ProjectEvaluation/generalupdate.projects.v2 and b/src/.vs/ProjectEvaluation/generalupdate.projects.v2 differ diff --git a/src/AutoUpdate.ClientCore/MainWindow.xaml.cs b/src/AutoUpdate.ClientCore/MainWindow.xaml.cs index 0a3ba617728335518b7eee6d35ea0462a5e130ed..56af54b8fc19d4d00f08a96e00f9630d5cdea9aa 100644 --- a/src/AutoUpdate.ClientCore/MainWindow.xaml.cs +++ b/src/AutoUpdate.ClientCore/MainWindow.xaml.cs @@ -1,7 +1,6 @@ using GeneralUpdate.ClientCore; using GeneralUpdate.ClientCore.Hubs; using GeneralUpdate.ClientCore.Strategys; -using GeneralUpdate.Common.Models; using GeneralUpdate.Core.Models; using GeneralUpdate.Core.Update; using System; @@ -25,7 +24,7 @@ namespace AutoUpdate.ClientCore public MainWindow() { InitializeComponent(); - InitVersionHub(); + //InitVersionHub(); } #region VersionHub @@ -54,7 +53,7 @@ namespace AutoUpdate.ClientCore Task.Run(async () => { //主程序信息 - var mainVersion = "1.1.1"; + var mainVersion = "1.1.1.1"; //该对象用于主程序客户端与更新组件进程之间交互用的对象 clientParameter = new ClientParameter(); @@ -66,6 +65,8 @@ namespace AutoUpdate.ClientCore #region update app. + clientParameter.ClientVersion = "1.1.1.1"; + //客户端类型:1.主程序客户端 2.更新组件 clientParameter.AppType = (int)AppType.UpdateApp; //更新组件请求验证更新的服务端地址 @@ -104,11 +105,11 @@ namespace AutoUpdate.ClientCore //整个更新过程出现的任何问题都会通过这个事件通知 generalClientBootstrap.Exception += OnException; //ClientStrategy该更新策略将完成1.自动升级组件自更新 2.启动更新组件 3.配置好ClientParameter无需再像之前的版本写args数组进程通讯了。 - //generalClientBootstrap.Config(clientParameter). - generalClientBootstrap.Config(baseUrl). + generalClientBootstrap.Config(clientParameter). + //generalClientBootstrap.Config(baseUrl). Option(UpdateOption.DownloadTimeOut, 60). - Option(UpdateOption.CompressEncoding, Encoding.Default). - Option(UpdateOption.CompressFormat, "zip"). + Option(UpdateOption.Encoding, Encoding.Default). + Option(UpdateOption.Format, "zip"). Strategy(); await generalClientBootstrap.LaunchTaskAsync(); }); diff --git a/src/AutoUpdate.Differential/App.xaml b/src/AutoUpdate.Differential/App.xaml new file mode 100644 index 0000000000000000000000000000000000000000..97c196f4e28818130c51e8d11eee0f02b947b8e6 --- /dev/null +++ b/src/AutoUpdate.Differential/App.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/src/AutoUpdate.Differential/App.xaml.cs b/src/AutoUpdate.Differential/App.xaml.cs new file mode 100644 index 0000000000000000000000000000000000000000..920ca532325520413d4ab6b6eb6dcbdcc0a70415 --- /dev/null +++ b/src/AutoUpdate.Differential/App.xaml.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Threading.Tasks; +using System.Windows; + +namespace AutoUpdate.Differential +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + } +} diff --git a/src/AutoUpdate.Differential/AssemblyInfo.cs b/src/AutoUpdate.Differential/AssemblyInfo.cs new file mode 100644 index 0000000000000000000000000000000000000000..22112342ead3cc40cbd4be95b3f91a26277f5989 --- /dev/null +++ b/src/AutoUpdate.Differential/AssemblyInfo.cs @@ -0,0 +1,10 @@ +using System.Windows; + +[assembly:ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] diff --git a/src/AutoUpdate.Differential/AutoUpdate.Differential.csproj b/src/AutoUpdate.Differential/AutoUpdate.Differential.csproj index db711a45ffb6b90ba69d7963729e9ed7429affcc..8c521b926121fa147e75872e2d17c396c3a0a185 100644 --- a/src/AutoUpdate.Differential/AutoUpdate.Differential.csproj +++ b/src/AutoUpdate.Differential/AutoUpdate.Differential.csproj @@ -1,23 +1,14 @@ - + - Exe - net6.0 - enable + WinExe + net5.0-windows enable + true - - - PreserveNewest - - - PreserveNewest - - - diff --git a/src/AutoUpdate.Differential/MainWindow.xaml b/src/AutoUpdate.Differential/MainWindow.xaml new file mode 100644 index 0000000000000000000000000000000000000000..d3afc140bdcd9774238d0cc16030b204de71dff2 --- /dev/null +++ b/src/AutoUpdate.Differential/MainWindow.xaml @@ -0,0 +1,17 @@ + + + + + + + + + + diff --git a/src/AutoUpdate.Differential/MainWindow.xaml.cs b/src/AutoUpdate.Differential/MainWindow.xaml.cs new file mode 100644 index 0000000000000000000000000000000000000000..cd8afd875e26ac046b13f15fad039fb08d01d9d0 --- /dev/null +++ b/src/AutoUpdate.Differential/MainWindow.xaml.cs @@ -0,0 +1,70 @@ +using GeneralUpdate.Differential; +using GeneralUpdate.Differential.Config; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace AutoUpdate.Differential +{ + /// + /// Interaction logic for MainWindow.xaml + /// + public partial class MainWindow : Window + { + public MainWindow() + { + InitializeComponent(); + } + + private void BtnClean_Click(object sender, RoutedEventArgs e) + { + Task.Run(async () => + { + var path1 = @"D:\TestCode\compare\source"; + var path2 = @"D:\TestCode\compare\target"; + var path3 = @"D:\TestCode\compare\patchs"; + await DifferentialCore.Instance.Clean(path1, path2, path3); + }); + } + + private void BtnDrity_Click(object sender, RoutedEventArgs e) + { + Task.Run(async () => + { + var path1 = @"D:\TestCode\compare\source"; + //var path2 = @"D:\TestCode\compare\target"; + var path3 = @"D:\TestCode\compare\patchs"; + await DifferentialCore.Instance.Drity(path1, path3); + }); + } + + private void BtnScan_Click(object sender, RoutedEventArgs e) + { + Task.Run(async () => + { + var path1 = @"D:\TestCode\compare\source"; + var path2 = @"D:\TestCode\compare\target"; + await ConfigFactory.Instance.Scan(path1, path2); + }); + } + + private void BtnDeploy_Click(object sender, RoutedEventArgs e) + { + Task.Run(async () => + { + await ConfigFactory.Instance.Deploy(); + }); + } + } +} diff --git a/src/AutoUpdate.Differential/Program.cs b/src/AutoUpdate.Differential/Program.cs deleted file mode 100644 index 69e124a22de534c4a547ef97cc497181f58543f5..0000000000000000000000000000000000000000 --- a/src/AutoUpdate.Differential/Program.cs +++ /dev/null @@ -1,25 +0,0 @@ -//Task.Run(async () => -//{ -// var path1 = @"D:\TestCode\compare\source"; -// var path2 = @"D:\TestCode\compare\target"; -// var path3 = @"D:\TestCode\compare\patchs"; -// await DifferentialCore.Instance.Clean(path1, path2, path3); -//}); - -//Task.Run(async () => -//{ -// var path1 = @"D:\TestCode\compare\source"; -// //var path2 = @"D:\TestCode\compare\target"; -// var path3 = @"D:\TestCode\compare\patchs"; -// await DifferentialCore.Instance.Drity(path1, path3); -//}); - -//Task.Run(async () => -//{ -// var path1 = @"D:\TestCode\compare\source"; -// var path2 = @"D:\TestCode\compare\target"; -// await ConfigFactory.Instance.Scan(path1, path2); -// await ConfigFactory.Instance.Deploy(); -//}); - -Console.Read(); \ No newline at end of file diff --git a/src/AutoUpdate.Differential/Properties/launchSettings.json b/src/AutoUpdate.Differential/Properties/launchSettings.json deleted file mode 100644 index 33504c948ad25129e1ebbfedc701556fecb1e037..0000000000000000000000000000000000000000 --- a/src/AutoUpdate.Differential/Properties/launchSettings.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "profiles": { - "WSL": { - "commandName": "WSL2", - "distributionName": "" - } - } -} \ No newline at end of file diff --git a/src/AutoUpdate.MD5/MainWindow.xaml.cs b/src/AutoUpdate.MD5/MainWindow.xaml.cs index 0dd268a24eb9998b0a969075f8f8000181682b7a..0ecd36226243c3deacaac5e5b749966b79abd266 100644 --- a/src/AutoUpdate.MD5/MainWindow.xaml.cs +++ b/src/AutoUpdate.MD5/MainWindow.xaml.cs @@ -25,7 +25,7 @@ namespace AutoUpdate.MD5 { OpenFileDialog openFile = new OpenFileDialog(); bool? isOpen = openFile.ShowDialog(this); - if (isOpen.Value) + if (isOpen != null && isOpen.Value) { var name = openFile.FileName; var md5 = GetFileMD5(name); diff --git a/src/AutoUpdate.MinimalService/AutoUpdate.MinimalService.csproj b/src/AutoUpdate.MinimalService/AutoUpdate.MinimalService.csproj index a1da3082fb6e4dc1e10908e7c6c6ad7ff01f6c28..127f417bd9aba115f36e4a14f17490aa40196048 100644 --- a/src/AutoUpdate.MinimalService/AutoUpdate.MinimalService.csproj +++ b/src/AutoUpdate.MinimalService/AutoUpdate.MinimalService.csproj @@ -7,7 +7,6 @@ - diff --git a/src/AutoUpdate.MinimalService/Program.cs b/src/AutoUpdate.MinimalService/Program.cs index 6bf4534575ec15df5e1d55ae11dd8ccc2a7730a6..0aaa2caccff487f38286c74829bbe04e87dd69cc 100644 --- a/src/AutoUpdate.MinimalService/Program.cs +++ b/src/AutoUpdate.MinimalService/Program.cs @@ -1,6 +1,6 @@ using GeneralUpdate.AspNetCore.Hubs; using GeneralUpdate.AspNetCore.Services; -using GeneralUpdate.Common.DTOs; +using GeneralUpdate.Core.DTOs; var builder = WebApplication.CreateBuilder(args); builder.Services.AddSingleton(); @@ -39,15 +39,15 @@ async Task> UpdateVersions(int clientType, string clientV { //TODO:Link database query information.Different version information can be returned according to the 'clientType' of request. var results = new List(); - results.Add(new UpdateVersionDTO("42e815e326616841f08851c7967dfde2", 1626711760, "9.1.3.0", - "http://192.168.50.170/Update1.zip", + results.Add(new UpdateVersionDTO("5fb75e44d7c45e3fc9d6aa47c05a0e9a", 1626711760, "9.1.3.0", + "http://192.168.50.170/patchs.zip", "updatepacket1")); - results.Add(new UpdateVersionDTO("d9a3785f08ed3dd92872bd807ebfb917", 1626711820, "9.1.4.0", - "http://192.168.50.170/Update2.zip", - "updatepacket2")); - results.Add(new UpdateVersionDTO("224da586553d60315c55e689a789b7bd", 1626711880, "9.1.5.0", - "http://192.168.50.170/Update3.zip", - "updatepacket3")); + //results.Add(new UpdateVersionDTO("d9a3785f08ed3dd92872bd807ebfb917", 1626711820, "9.1.4.0", + //"http://192.168.50.170/Update2.zip", + //"updatepacket2")); + //results.Add(new UpdateVersionDTO("224da586553d60315c55e689a789b7bd", 1626711880, "9.1.5.0", + //"http://192.168.50.170/Update3.zip", + //"updatepacket3")); return await Task.FromResult(results); } @@ -55,9 +55,9 @@ async Task> GetValidateInfos(int clientType, string clien { //TODO:Link database query information.Different version information can be returned according to the 'clientType' of request. var results = new List(); - results.Add(new UpdateVersionDTO("42e815e326616841f08851c7967dfde2", 1626711760, "9.1.3.0", null, null)); - results.Add(new UpdateVersionDTO("d9a3785f08ed3dd92872bd807ebfb917", 1626711820, "9.1.4.0", null, null)); - results.Add(new UpdateVersionDTO("224da586553d60315c55e689a789b7bd", 1626711880, "9.1.5.0", null, null)); + results.Add(new UpdateVersionDTO("5fb75e44d7c45e3fc9d6aa47c05a0e9a", 1626711760, "9.1.3.0", null, null)); + //results.Add(new UpdateVersionDTO("d9a3785f08ed3dd92872bd807ebfb917", 1626711820, "9.1.4.0", null, null)); + //results.Add(new UpdateVersionDTO("224da586553d60315c55e689a789b7bd", 1626711880, "9.1.5.0", null, null)); return await Task.FromResult(results); } diff --git a/src/AutoUpdate.WpfNet6-Sample/App.xaml b/src/AutoUpdate.WpfNet6-Sample/App.xaml index af590cfd315f622750300a6234ab9947de4049e0..a666f5f9db20ca7889e8d5e7b69bc48d2c4989b5 100644 --- a/src/AutoUpdate.WpfNet6-Sample/App.xaml +++ b/src/AutoUpdate.WpfNet6-Sample/App.xaml @@ -1,7 +1,6 @@  + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> \ No newline at end of file diff --git a/src/AutoUpdate.WpfNet6-Sample/App.xaml.cs b/src/AutoUpdate.WpfNet6-Sample/App.xaml.cs index 63c6834260f282617893516f8b2d1e48712545cb..e2599348eb0dfd58be76308577985f83533816ad 100644 --- a/src/AutoUpdate.WpfNet6-Sample/App.xaml.cs +++ b/src/AutoUpdate.WpfNet6-Sample/App.xaml.cs @@ -1,4 +1,5 @@ -using System.Windows; +using AutoUpdate.Core; +using System.Windows; namespace AutoUpdate.WpfNet6_Sample { @@ -9,7 +10,10 @@ namespace AutoUpdate.WpfNet6_Sample { protected override void OnStartup(StartupEventArgs e) { - var args = e.Args; + //var args = e.Args; + var args = "eyJBcHBUeXBlIjoxLCJBcHBOYW1lIjoiQXV0b1VwZGF0ZS5DbGllbnRDb3JlIiwiTWFpbkFwcE5hbWUiOm51bGwsIkluc3RhbGxQYXRoIjoiRDpcXFVwZGF0ZXRlc3RfaHViXFxSdW5fYXBwIiwiQ2xpZW50VmVyc2lvbiI6IjEuMS4xIiwiTGFzdFZlcnNpb24iOiI5LjEuMy4wIiwiVXBkYXRlTG9nVXJsIjpudWxsLCJJc1VwZGF0ZSI6ZmFsc2UsIlVwZGF0ZVVybCI6bnVsbCwiVmFsaWRhdGVVcmwiOm51bGwsIk1haW5VcGRhdGVVcmwiOiJodHRwOi8vMTI3LjAuMC4xOjUwMDEvdmVyc2lvbnMvMS8xLjEuMS4xIiwiTWFpblZhbGlkYXRlVXJsIjoiaHR0cDovLzEyNy4wLjAuMTo1MDAxL3ZhbGlkYXRlLzEvMS4xLjEuMSIsIkNvbXByZXNzRW5jb2RpbmciOjcsIkNvbXByZXNzRm9ybWF0IjoiLnppcCIsIkRvd25sb2FkVGltZU91dCI6NjAsIlVwZGF0ZVZlcnNpb25zIjpbeyJQdWJUaW1lIjoxNjI2NzExNzYwLCJOYW1lIjpudWxsLCJNRDUiOiI1ZmI3NWU0NGQ3YzQ1ZTNmYzlkNmFhNDdjMDVhMGU5YSIsIlZlcnNpb24iOiI5LjEuMy4wIiwiVXJsIjpudWxsLCJJc1VuWmlwIjpmYWxzZX1dfQ=="; + MainWindow window = new MainWindow(args); + window.ShowDialog(); base.OnStartup(e); } } diff --git a/src/AutoUpdate.WpfNet6-Sample/AutoUpdate.Core.csproj b/src/AutoUpdate.WpfNet6-Sample/AutoUpdate.Core.csproj index 3a4b79e8d0e1f24cac7dd84e604229a36bfd0441..f0b5b967c5390b80237d58fb2cfca9b04cbec5a1 100644 --- a/src/AutoUpdate.WpfNet6-Sample/AutoUpdate.Core.csproj +++ b/src/AutoUpdate.WpfNet6-Sample/AutoUpdate.Core.csproj @@ -27,7 +27,6 @@ - diff --git a/src/AutoUpdate.WpfNet6-Sample/TestView.xaml.cs b/src/AutoUpdate.WpfNet6-Sample/TestView.xaml.cs index f9c95f06308e34e14d346c9966ef0c64bf180522..83aa50cf57cd39d013c038bd0f3dcdbf843c3812 100644 --- a/src/AutoUpdate.WpfNet6-Sample/TestView.xaml.cs +++ b/src/AutoUpdate.WpfNet6-Sample/TestView.xaml.cs @@ -14,11 +14,6 @@ namespace AutoUpdate.WpfNet6_Sample private void BtnTest_Click(object sender, RoutedEventArgs e) { - //var setup = Config.Stage(new TestClass()). - // Stage(new TestClass2()); - //PipelineBuilder.Create(setup); - //await ConfigFactory.Instance.Scan(); - //var context = new BaseContext(); //context.TargetPath = "123"; //context.SourcePath = "123"; diff --git a/src/AutoUpdate.WpfNet6-Sample/ViewModels/MainViewModel.cs b/src/AutoUpdate.WpfNet6-Sample/ViewModels/MainViewModel.cs index bdde40897fab9ca866c947fcc6c50d21d40414b1..ad299ed3657fc56a9c331ca576237184002d358e 100644 --- a/src/AutoUpdate.WpfNet6-Sample/ViewModels/MainViewModel.cs +++ b/src/AutoUpdate.WpfNet6-Sample/ViewModels/MainViewModel.cs @@ -26,9 +26,9 @@ namespace AutoUpdate.Core.ViewModels bootStrap.MutiDownloadStatistics += OnMutiDownloadStatistics; bootStrap.Exception += OnException; bootStrap.Strategy(). - Option(UpdateOption.CompressEncoding, Encoding.Default). + Option(UpdateOption.Encoding, Encoding.Default). Option(UpdateOption.DownloadTimeOut, 60). - Option(UpdateOption.CompressFormat, "zip"). + Option(UpdateOption.Format, "zip"). RemoteAddressBase64(args); await bootStrap.LaunchTaskAsync(); }); diff --git a/src/AutoUpdate.ZIP/MainWindow.xaml.cs b/src/AutoUpdate.ZIP/MainWindow.xaml.cs index 92ab8b11a609e896859443fe0ab16708d67dfa8b..89b621730b50a1f6ceaeb36f1f59ba84f01873b9 100644 --- a/src/AutoUpdate.ZIP/MainWindow.xaml.cs +++ b/src/AutoUpdate.ZIP/MainWindow.xaml.cs @@ -1,6 +1,6 @@ -using GeneralUpdate.Common.Models; -using GeneralUpdate.Zip; +using GeneralUpdate.Zip; using GeneralUpdate.Zip.Events; +using GeneralUpdate.Zip.Factory; using System; using System.Diagnostics; using System.Windows; diff --git a/src/GeneralUpdate.AspNetCore/.DS_Store b/src/GeneralUpdate.AspNetCore/.DS_Store deleted file mode 100644 index 6fa6aeedf55c40dee0918c64f6d820055a06af50..0000000000000000000000000000000000000000 Binary files a/src/GeneralUpdate.AspNetCore/.DS_Store and /dev/null differ diff --git a/src/GeneralUpdate.AspNetCore/GeneralUpdate.AspNetCore.csproj b/src/GeneralUpdate.AspNetCore/GeneralUpdate.AspNetCore.csproj index 89ee4e60c8c20f41d3e98319bc03487d3345d2d6..fb37e5e8fb98039df3e869778b4efb7e9f59898a 100644 --- a/src/GeneralUpdate.AspNetCore/GeneralUpdate.AspNetCore.csproj +++ b/src/GeneralUpdate.AspNetCore/GeneralUpdate.AspNetCore.csproj @@ -4,13 +4,27 @@ netstandard2.0 + + + + + + + + + + + + + - + + diff --git a/src/GeneralUpdate.AspNetCore/Hubs/VersionHub.cs b/src/GeneralUpdate.AspNetCore/Hubs/VersionHub.cs index ba6311f535d495d7188550fd99e04d937dbc0b73..dad5c4fe174b48f7802dd9c87946605c748f9785 100644 --- a/src/GeneralUpdate.AspNetCore/Hubs/VersionHub.cs +++ b/src/GeneralUpdate.AspNetCore/Hubs/VersionHub.cs @@ -1,4 +1,4 @@ -using GeneralUpdate.Common.Utils; +using GeneralUpdate.Core.Utils; using Microsoft.AspNetCore.SignalR; using System; using System.Threading.Tasks; diff --git a/src/GeneralUpdate.AspNetCore/Services/GeneralUpdateService.cs b/src/GeneralUpdate.AspNetCore/Services/GeneralUpdateService.cs index bb05b8ed72cdb8b6a18bca2ce6cf40e48318ce39..33a86533a372c0d9f90c5cabf0d02e68b830d5be 100644 --- a/src/GeneralUpdate.AspNetCore/Services/GeneralUpdateService.cs +++ b/src/GeneralUpdate.AspNetCore/Services/GeneralUpdateService.cs @@ -1,5 +1,5 @@ using GeneralUpdate.AspNetCore.Models; -using GeneralUpdate.Common.DTOs; +using GeneralUpdate.Core.DTOs; using Microsoft.AspNetCore.Http; using Newtonsoft.Json; using System; diff --git a/src/GeneralUpdate.AspNetCore/Services/IUpdateService.cs b/src/GeneralUpdate.AspNetCore/Services/IUpdateService.cs index 24e49498f88f64329818213162eeef7ec3d7d025..3328164e8a907758856d9d64683cb8d5ac413e25 100644 --- a/src/GeneralUpdate.AspNetCore/Services/IUpdateService.cs +++ b/src/GeneralUpdate.AspNetCore/Services/IUpdateService.cs @@ -1,4 +1,4 @@ -using GeneralUpdate.Common.DTOs; +using GeneralUpdate.Core.DTOs; using Microsoft.AspNetCore.Http; using System; using System.Collections.Generic; diff --git a/src/GeneralUpdate.ClientCore/GeneralClientBootstrap.cs b/src/GeneralUpdate.ClientCore/GeneralClientBootstrap.cs index 5236d32d38cee8ac8c318aa30a11119da487d453..9238346cb879c24c6130088def91bbe80d3dd393 100644 --- a/src/GeneralUpdate.ClientCore/GeneralClientBootstrap.cs +++ b/src/GeneralUpdate.ClientCore/GeneralClientBootstrap.cs @@ -1,9 +1,8 @@ -using GeneralUpdate.Common.DTOs; -using GeneralUpdate.Common.Models; -using GeneralUpdate.Common.Utils; using GeneralUpdate.Core.Bootstrap; +using GeneralUpdate.Core.DTOs; using GeneralUpdate.Core.Models; using GeneralUpdate.Core.Strategys; +using GeneralUpdate.Core.Utils; using System; using System.Diagnostics; using System.IO; diff --git a/src/GeneralUpdate.ClientCore/GeneralUpdate.ClientCore.csproj b/src/GeneralUpdate.ClientCore/GeneralUpdate.ClientCore.csproj index cef00eb73284a1a323bd4e2add591fe8f6cbd4f9..e6a65251521507dae825b1a51b18609c965b7677 100644 --- a/src/GeneralUpdate.ClientCore/GeneralUpdate.ClientCore.csproj +++ b/src/GeneralUpdate.ClientCore/GeneralUpdate.ClientCore.csproj @@ -22,34 +22,42 @@ - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -57,6 +65,11 @@ + + + + + @@ -82,6 +95,7 @@ + @@ -96,7 +110,6 @@ - @@ -104,12 +117,20 @@ - - + + + + + + + + + + diff --git a/src/GeneralUpdate.ClientCore/Hubs/VersionHub.cs b/src/GeneralUpdate.ClientCore/Hubs/VersionHub.cs index ec6bb0dec08e203980a9052f0b2b14b47eaf5251..20cbc1a10d03e6759867b75cb5a7eb0e8376e0c0 100644 --- a/src/GeneralUpdate.ClientCore/Hubs/VersionHub.cs +++ b/src/GeneralUpdate.ClientCore/Hubs/VersionHub.cs @@ -1,4 +1,4 @@ -using GeneralUpdate.Common.Utils; +using GeneralUpdate.Core.Utils; using Microsoft.AspNetCore.SignalR.Client; using System; using System.Threading.Tasks; diff --git a/src/GeneralUpdate.ClientCore/Models/UpdateConfig.cs b/src/GeneralUpdate.ClientCore/Models/UpdateConfig.cs deleted file mode 100644 index 7a10c74a3a27b87cc57d5e5f47ac5941e8647414..0000000000000000000000000000000000000000 --- a/src/GeneralUpdate.ClientCore/Models/UpdateConfig.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace GeneralUpdate.ClientCore.Models -{ - public class UpdateConfig - { - /// - /// 是否更新完成 - /// - public bool IsDone { get; set; } - - /// - /// 更新完成日期 - /// - public string DoneDate { get; set; } - } -} \ No newline at end of file diff --git a/src/GeneralUpdate.ClientCore/Strategys/ClientStrategy.cs b/src/GeneralUpdate.ClientCore/Strategys/ClientStrategy.cs index bac9af374ba9cae1fd1d4b91665a8e95b3f606a0..d8f5b4ae2b6c4cf3c760344784bfacc19453d600 100644 --- a/src/GeneralUpdate.ClientCore/Strategys/ClientStrategy.cs +++ b/src/GeneralUpdate.ClientCore/Strategys/ClientStrategy.cs @@ -1,6 +1,6 @@ -using GeneralUpdate.Common.DTOs; -using GeneralUpdate.Common.Models; -using GeneralUpdate.Common.Utils; +using GeneralUpdate.Core.DTOs; +using GeneralUpdate.Core.Models; +using GeneralUpdate.Core.Utils; using GeneralUpdate.Core.Strategys; using GeneralUpdate.Core.Update; using System; @@ -47,7 +47,7 @@ namespace GeneralUpdate.ClientCore.Strategys clientParameter.MainUpdateUrl = Packet.MainUpdateUrl; clientParameter.AppName = Packet.MainAppName; clientParameter.AppType = 1; - clientParameter.CompressEncoding = ConvertUtil.ToEncodingType(Packet.CompressEncoding); + clientParameter.CompressEncoding = ConvertUtil.ToEncodingType(Packet.Encoding); clientParameter.CompressFormat = Packet.Format; clientParameter.DownloadTimeOut = Packet.DownloadTimeOut; clientParameter.UpdateVersions = ConvertUtil.ToUpdateVersions(body.UpdateVersions); diff --git a/src/GeneralUpdate.Common/GeneralUpdate.Common.csproj b/src/GeneralUpdate.Common/GeneralUpdate.Common.csproj deleted file mode 100644 index e7402ced35bbd22465d770142789d6bef38c5e40..0000000000000000000000000000000000000000 --- a/src/GeneralUpdate.Common/GeneralUpdate.Common.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - netstandard2.0 - - - - - - - diff --git a/src/GeneralUpdate.Core/.vs/GeneralUpdate.Core/v16/Server/sqlite3/db.lock b/src/GeneralUpdate.Core/.vs/GeneralUpdate.Core/v16/Server/sqlite3/db.lock deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/GeneralUpdate.Core/.vs/GeneralUpdate.Core/v16/Server/sqlite3/storage.ide b/src/GeneralUpdate.Core/.vs/GeneralUpdate.Core/v16/Server/sqlite3/storage.ide deleted file mode 100644 index bebd6f152d77a5b5448533c791d1ba85788acd87..0000000000000000000000000000000000000000 Binary files a/src/GeneralUpdate.Core/.vs/GeneralUpdate.Core/v16/Server/sqlite3/storage.ide and /dev/null differ diff --git a/src/GeneralUpdate.Core/Bootstrap/AbstractBootstrap.cs b/src/GeneralUpdate.Core/Bootstrap/AbstractBootstrap.cs index ce64719d4b328019adff7e2a43a9e30743a4bd0c..13c908bd62f81c69844aafea06e341e11346bba5 100644 --- a/src/GeneralUpdate.Core/Bootstrap/AbstractBootstrap.cs +++ b/src/GeneralUpdate.Core/Bootstrap/AbstractBootstrap.cs @@ -1,10 +1,9 @@ -using GeneralUpdate.Common.DTOs; -using GeneralUpdate.Common.Models; -using GeneralUpdate.Common.Utils; -using GeneralUpdate.Core.Download; +using GeneralUpdate.Core.Download; +using GeneralUpdate.Core.DTOs; using GeneralUpdate.Core.Models; using GeneralUpdate.Core.Strategys; using GeneralUpdate.Core.Update; +using GeneralUpdate.Core.Utils; using System; using System.Collections.Concurrent; using System.Diagnostics.Contracts; @@ -93,9 +92,9 @@ namespace GeneralUpdate.Core.Bootstrap new MutiDownloadProgressChangedEventArgs(null, ProgressType.Check, $"Check update failed :{ updateResp.Message }.")); } if (Packet.UpdateVersions == null || Packet.UpdateVersions.Count == 0) throw new Exception("Request to update content failed!"); - var pacektFormat = GetOption(UpdateOption.CompressFormat) ?? DefaultFormat; + var pacektFormat = GetOption(UpdateOption.Format) ?? DefaultFormat; Packet.Format = $".{pacektFormat}"; - Packet.CompressEncoding = GetOption(UpdateOption.CompressEncoding) ?? Encoding.Default; + Packet.Encoding = GetOption(UpdateOption.Encoding) ?? Encoding.Default; Packet.DownloadTimeOut = GetOption(UpdateOption.DownloadTimeOut); Packet.AppName = Packet.AppName ?? GetOption(UpdateOption.MainApp); Packet.TempPath = $"{ FileUtil.GetTempDirectory(Packet.LastVersion) }\\"; diff --git a/src/GeneralUpdate.Common/CustomAwaiter/IAwaitable.cs b/src/GeneralUpdate.Core/CustomAwaiter/IAwaitable.cs similarity index 68% rename from src/GeneralUpdate.Common/CustomAwaiter/IAwaitable.cs rename to src/GeneralUpdate.Core/CustomAwaiter/IAwaitable.cs index 319ad5ffc3c57794e323e515f87cbe9093f66280..25081aa2c1df8de1b86cce260ae181265879a6bd 100644 --- a/src/GeneralUpdate.Common/CustomAwaiter/IAwaitable.cs +++ b/src/GeneralUpdate.Core/CustomAwaiter/IAwaitable.cs @@ -1,4 +1,8 @@ -namespace GeneralUpdate.Common.CustomAwaiter +using System; +using System.Collections.Generic; +using System.Text; + +namespace GeneralUpdate.Core.CustomAwaiter { public interface IAwaitable where TAwaiter : IAwaiter { @@ -9,4 +13,4 @@ { TAwaiter GetAwaiter(); } -} \ No newline at end of file +} diff --git a/src/GeneralUpdate.Common/CustomAwaiter/IAwaiter.cs b/src/GeneralUpdate.Core/CustomAwaiter/IAwaiter.cs similarity index 63% rename from src/GeneralUpdate.Common/CustomAwaiter/IAwaiter.cs rename to src/GeneralUpdate.Core/CustomAwaiter/IAwaiter.cs index c9f18aaf19a1bcd1bd2f750f9ba753226944f60b..bf917d05ba584aae9909390abfbb8cf419a48c96 100644 --- a/src/GeneralUpdate.Common/CustomAwaiter/IAwaiter.cs +++ b/src/GeneralUpdate.Core/CustomAwaiter/IAwaiter.cs @@ -1,6 +1,9 @@ -using System.Runtime.CompilerServices; +using System; +using System.Collections.Generic; +using System.Runtime.CompilerServices; +using System.Text; -namespace GeneralUpdate.Common.CustomAwaiter +namespace GeneralUpdate.Core.CustomAwaiter { public interface IAwaiter : INotifyCompletion { @@ -15,4 +18,4 @@ namespace GeneralUpdate.Common.CustomAwaiter TResult GetResult(); } -} \ No newline at end of file +} diff --git a/src/GeneralUpdate.Common/CustomAwaiter/ICriticalAwaiter.cs b/src/GeneralUpdate.Core/CustomAwaiter/ICriticalAwaiter.cs similarity index 56% rename from src/GeneralUpdate.Common/CustomAwaiter/ICriticalAwaiter.cs rename to src/GeneralUpdate.Core/CustomAwaiter/ICriticalAwaiter.cs index 1302c4e33e2326c39ad4976ece3c56c87321132a..b4d36916083e87ce35603a0b130305c158eccaa5 100644 --- a/src/GeneralUpdate.Common/CustomAwaiter/ICriticalAwaiter.cs +++ b/src/GeneralUpdate.Core/CustomAwaiter/ICriticalAwaiter.cs @@ -1,6 +1,9 @@ -using System.Runtime.CompilerServices; +using System; +using System.Collections.Generic; +using System.Runtime.CompilerServices; +using System.Text; -namespace GeneralUpdate.Common.CustomAwaiter +namespace GeneralUpdate.Core.CustomAwaiter { public interface ICriticalAwaiter : IAwaiter, ICriticalNotifyCompletion { @@ -9,4 +12,4 @@ namespace GeneralUpdate.Common.CustomAwaiter public interface ICriticalAwaiter : IAwaiter, ICriticalNotifyCompletion { } -} \ No newline at end of file +} diff --git a/src/GeneralUpdate.Common/DTOs/BaseRequestDTO.cs b/src/GeneralUpdate.Core/DTOs/BaseRequestDTO.cs similarity index 82% rename from src/GeneralUpdate.Common/DTOs/BaseRequestDTO.cs rename to src/GeneralUpdate.Core/DTOs/BaseRequestDTO.cs index bb372ac9f2a2739c707073fad37830b7ef744e26..129355111bb966261d5fa78d84f5e9472e96bf27 100644 --- a/src/GeneralUpdate.Common/DTOs/BaseRequestDTO.cs +++ b/src/GeneralUpdate.Core/DTOs/BaseRequestDTO.cs @@ -1,4 +1,4 @@ -namespace GeneralUpdate.Common.DTOs +namespace GeneralUpdate.Core.DTOs { public class BaseRequestDTO : IRequest { diff --git a/src/GeneralUpdate.Common/DTOs/BaseResponseDTO.cs b/src/GeneralUpdate.Core/DTOs/BaseResponseDTO.cs similarity index 82% rename from src/GeneralUpdate.Common/DTOs/BaseResponseDTO.cs rename to src/GeneralUpdate.Core/DTOs/BaseResponseDTO.cs index d95edad5d0c5651e1a039a41aaf2f455d014dab4..7732ed044d947e25f384f0693eb0f981a8be54a9 100644 --- a/src/GeneralUpdate.Common/DTOs/BaseResponseDTO.cs +++ b/src/GeneralUpdate.Core/DTOs/BaseResponseDTO.cs @@ -1,4 +1,4 @@ -namespace GeneralUpdate.Common.DTOs +namespace GeneralUpdate.Core.DTOs { public class BaseResponseDTO : IResponse { diff --git a/src/GeneralUpdate.Common/DTOs/IRequest.cs b/src/GeneralUpdate.Core/DTOs/IRequest.cs similarity index 53% rename from src/GeneralUpdate.Common/DTOs/IRequest.cs rename to src/GeneralUpdate.Core/DTOs/IRequest.cs index 7767356fc1fb007ddfe97e25e4b79741018eb3e0..65ae65c567e6a373b52959e6a021ef60aa1e62e5 100644 --- a/src/GeneralUpdate.Common/DTOs/IRequest.cs +++ b/src/GeneralUpdate.Core/DTOs/IRequest.cs @@ -1,4 +1,4 @@ -namespace GeneralUpdate.Common.DTOs +namespace GeneralUpdate.Core.DTOs { public interface IRequest { diff --git a/src/GeneralUpdate.Common/DTOs/IResponse.cs b/src/GeneralUpdate.Core/DTOs/IResponse.cs similarity index 54% rename from src/GeneralUpdate.Common/DTOs/IResponse.cs rename to src/GeneralUpdate.Core/DTOs/IResponse.cs index 32d34aaea99b1fea1c9c43426203809d9012ecd1..d9793b5abe28f4e6077c160d81a5e90b8c966f71 100644 --- a/src/GeneralUpdate.Common/DTOs/IResponse.cs +++ b/src/GeneralUpdate.Core/DTOs/IResponse.cs @@ -1,4 +1,4 @@ -namespace GeneralUpdate.Common.DTOs +namespace GeneralUpdate.Core.DTOs { public interface IResponse { diff --git a/src/GeneralUpdate.Common/DTOs/UpdateValidateReqDTO.cs b/src/GeneralUpdate.Core/DTOs/UpdateValidateReqDTO.cs similarity index 66% rename from src/GeneralUpdate.Common/DTOs/UpdateValidateReqDTO.cs rename to src/GeneralUpdate.Core/DTOs/UpdateValidateReqDTO.cs index 7851de10c6ab2752991097966415dfd54c6b165a..801f72674c330aba644977d3ad9da5f0020bec45 100644 --- a/src/GeneralUpdate.Common/DTOs/UpdateValidateReqDTO.cs +++ b/src/GeneralUpdate.Core/DTOs/UpdateValidateReqDTO.cs @@ -1,4 +1,4 @@ -namespace GeneralUpdate.Common.DTOs +namespace GeneralUpdate.Core.DTOs { public class UpdateValidateReqDTO : BaseRequestDTO { diff --git a/src/GeneralUpdate.Common/DTOs/UpdateValidateRespDTO.cs b/src/GeneralUpdate.Core/DTOs/UpdateValidateRespDTO.cs similarity index 93% rename from src/GeneralUpdate.Common/DTOs/UpdateValidateRespDTO.cs rename to src/GeneralUpdate.Core/DTOs/UpdateValidateRespDTO.cs index 7e2a2d8ff5167fed191af4898849687989d388af..4fa2f5c953ffcd00de0c14739475b5a95c6453e4 100644 --- a/src/GeneralUpdate.Common/DTOs/UpdateValidateRespDTO.cs +++ b/src/GeneralUpdate.Core/DTOs/UpdateValidateRespDTO.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace GeneralUpdate.Common.DTOs +namespace GeneralUpdate.Core.DTOs { public class UpdateValidateRespDTO : BaseResponseDTO { diff --git a/src/GeneralUpdate.Common/DTOs/UpdateVersionDTO.cs b/src/GeneralUpdate.Core/DTOs/UpdateVersionDTO.cs similarity index 92% rename from src/GeneralUpdate.Common/DTOs/UpdateVersionDTO.cs rename to src/GeneralUpdate.Core/DTOs/UpdateVersionDTO.cs index 91279d95c5fe796b56b920692d0638bb11fd3dd9..802dcf7c24170731ddf1b06440968b905b431205 100644 --- a/src/GeneralUpdate.Common/DTOs/UpdateVersionDTO.cs +++ b/src/GeneralUpdate.Core/DTOs/UpdateVersionDTO.cs @@ -1,4 +1,4 @@ -namespace GeneralUpdate.Common.DTOs +namespace GeneralUpdate.Core.DTOs { public class UpdateVersionDTO { diff --git a/src/GeneralUpdate.Common/DTOs/UpdateVersionsReqDTO.cs b/src/GeneralUpdate.Core/DTOs/UpdateVersionsReqDTO.cs similarity index 57% rename from src/GeneralUpdate.Common/DTOs/UpdateVersionsReqDTO.cs rename to src/GeneralUpdate.Core/DTOs/UpdateVersionsReqDTO.cs index cffb1dfcaabd8b53c556d151238903a1825fbd2a..98ae8b4b3e00c9c5f45d40bed0fff15176b68bf9 100644 --- a/src/GeneralUpdate.Common/DTOs/UpdateVersionsReqDTO.cs +++ b/src/GeneralUpdate.Core/DTOs/UpdateVersionsReqDTO.cs @@ -1,4 +1,4 @@ -namespace GeneralUpdate.Common.DTOs +namespace GeneralUpdate.Core.DTOs { public class UpdateVersionsReqDTO { diff --git a/src/GeneralUpdate.Common/DTOs/UpdateVersionsRespDTO.cs b/src/GeneralUpdate.Core/DTOs/UpdateVersionsRespDTO.cs similarity index 86% rename from src/GeneralUpdate.Common/DTOs/UpdateVersionsRespDTO.cs rename to src/GeneralUpdate.Core/DTOs/UpdateVersionsRespDTO.cs index 413cba616182ecb8b34cf1a9f8a44f19b4f25ea4..a804239bc62863c38eb9ec9830beba37c33a4fe3 100644 --- a/src/GeneralUpdate.Common/DTOs/UpdateVersionsRespDTO.cs +++ b/src/GeneralUpdate.Core/DTOs/UpdateVersionsRespDTO.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace GeneralUpdate.Common.DTOs +namespace GeneralUpdate.Core.DTOs { public class UpdateVersionsRespDTO : BaseResponseDTO { } diff --git a/src/GeneralUpdate.Core/Download/DownloadTask.cs b/src/GeneralUpdate.Core/Download/DownloadTask.cs index 3327bf87855c173fb6eecbce6b4820acc22f6379..edeb4b03ddb765b9816aa77f7a78039fdb027408 100644 --- a/src/GeneralUpdate.Core/Download/DownloadTask.cs +++ b/src/GeneralUpdate.Core/Download/DownloadTask.cs @@ -1,4 +1,4 @@ -using GeneralUpdate.Common.CustomAwaiter; +using GeneralUpdate.Core.CustomAwaiter; using GeneralUpdate.Core.Update; using System; using System.Globalization; diff --git a/src/GeneralUpdate.Core/GeneralUpdate.Core.csproj b/src/GeneralUpdate.Core/GeneralUpdate.Core.csproj index 1fc7f4ce97aef1da00a5df64f24e22e8658f7832..183931e566e2557fafa696fa71a60eff7d4b265e 100644 --- a/src/GeneralUpdate.Core/GeneralUpdate.Core.csproj +++ b/src/GeneralUpdate.Core/GeneralUpdate.Core.csproj @@ -32,7 +32,6 @@ - diff --git a/src/GeneralUpdate.Core/GeneralUpdateBootstrap.cs b/src/GeneralUpdate.Core/GeneralUpdateBootstrap.cs index e69b52f112b4f7f0a3ce6d0bbc11a9af32acf72e..77aa67a908f398107c1882b160dafd7878a4689d 100644 --- a/src/GeneralUpdate.Core/GeneralUpdateBootstrap.cs +++ b/src/GeneralUpdate.Core/GeneralUpdateBootstrap.cs @@ -1,5 +1,5 @@ -using GeneralUpdate.Common.Models; -using GeneralUpdate.Common.Utils; +using GeneralUpdate.Core.Models; +using GeneralUpdate.Core.Utils; using GeneralUpdate.Core.Bootstrap; using GeneralUpdate.Core.Strategys; using System; @@ -45,7 +45,7 @@ namespace GeneralUpdate.Core Packet.UpdateUrl = ClientParameter.UpdateUrl; Packet.UpdateLogUrl = ClientParameter.UpdateLogUrl; Packet.UpdateVersions = ClientParameter.UpdateVersions; - Packet.CompressEncoding = ConvertUtil.ToEncoding(ClientParameter.CompressEncoding); + Packet.Encoding = ConvertUtil.ToEncoding(ClientParameter.CompressEncoding); Packet.Format = ClientParameter.CompressFormat; Packet.DownloadTimeOut = ClientParameter.DownloadTimeOut; Packet.MainUpdateUrl = ClientParameter.MainUpdateUrl; diff --git a/src/GeneralUpdate.Common/Models/ClientParameter.cs b/src/GeneralUpdate.Core/Models/ClientParameter.cs similarity index 98% rename from src/GeneralUpdate.Common/Models/ClientParameter.cs rename to src/GeneralUpdate.Core/Models/ClientParameter.cs index eb1edc79d17fcaf9041f8d245ddd08a4d1fe1e87..2f007c5b1d64558ac26fe7884294ddb3a28376f0 100644 --- a/src/GeneralUpdate.Common/Models/ClientParameter.cs +++ b/src/GeneralUpdate.Core/Models/ClientParameter.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -namespace GeneralUpdate.Common.Models +namespace GeneralUpdate.Core.Models { [Serializable] public class ClientParameter diff --git a/src/GeneralUpdate.Core/Models/FileBase.cs b/src/GeneralUpdate.Core/Models/FileBase.cs index ff8487b2378c6d2a78b24b17c0859f49aeb0166b..eef08a880b395c2335c13f0e75f7b37a1006da69 100644 --- a/src/GeneralUpdate.Core/Models/FileBase.cs +++ b/src/GeneralUpdate.Core/Models/FileBase.cs @@ -54,10 +54,5 @@ namespace GeneralUpdate.Core.Models /// 下载文件临时存储路径(用于更新文件逻辑) /// public string TempPath { get; set; } - - /// - /// 文件当前路径(用于增量文件逻辑) - /// - public string Path { get; set; } } } \ No newline at end of file diff --git a/src/GeneralUpdate.Core/Models/UpdatePacket.cs b/src/GeneralUpdate.Core/Models/UpdatePacket.cs index bef5158232764b5e8570b88aa1e265f0f4224a5e..97f90db9b704fd229b2aaadcb704064a6fffd5d3 100644 --- a/src/GeneralUpdate.Core/Models/UpdatePacket.cs +++ b/src/GeneralUpdate.Core/Models/UpdatePacket.cs @@ -1,5 +1,4 @@ -using GeneralUpdate.Common.Models; -using System.Collections.Generic; +using System.Collections.Generic; using System.Text; namespace GeneralUpdate.Core.Models @@ -71,7 +70,7 @@ namespace GeneralUpdate.Core.Models /// public List UpdateVersions { get; set; } - public Encoding CompressEncoding { get; set; } + public Encoding Encoding { get; set; } public int DownloadTimeOut { get; set; } } diff --git a/src/GeneralUpdate.Core/Pipelines/Context/BaseContext.cs b/src/GeneralUpdate.Core/Pipelines/Context/BaseContext.cs index 9ee31755b3d50441bceb74ff0899b80d73615974..405945feb11c83893dcb027232dbc7799197aec4 100644 --- a/src/GeneralUpdate.Core/Pipelines/Context/BaseContext.cs +++ b/src/GeneralUpdate.Core/Pipelines/Context/BaseContext.cs @@ -1,4 +1,4 @@ -using GeneralUpdate.Common.Models; +using GeneralUpdate.Core.Models; using GeneralUpdate.Core.Update; using System; using System.Text; diff --git a/src/GeneralUpdate.Core/Pipelines/Middleware/ConfigMiddleware.cs b/src/GeneralUpdate.Core/Pipelines/Middleware/ConfigMiddleware.cs index 02fcbda46464c56b9e28ce26c07fee68742e32e7..40eba8c3fa900a97d2f11647b25e9f823de3ed4b 100644 --- a/src/GeneralUpdate.Core/Pipelines/Middleware/ConfigMiddleware.cs +++ b/src/GeneralUpdate.Core/Pipelines/Middleware/ConfigMiddleware.cs @@ -19,7 +19,7 @@ namespace GeneralUpdate.Core.Pipelines.Middleware } catch (Exception ex) { - var exception = new Exception($"An exception occurred while updating the configuration file : { ex.Message } !", ex.InnerException); + var exception = new Exception($"{ ex.Message } !", ex.InnerException); context.OnExceptionEventAction(this, exception); throw exception; } diff --git a/src/GeneralUpdate.Core/Pipelines/Middleware/MD5Middleware.cs b/src/GeneralUpdate.Core/Pipelines/Middleware/MD5Middleware.cs index cd2136df873fbed29832354a6765a45fec2ea2e9..d83de5ab383e37ac4e25e4775df1748d924828b2 100644 --- a/src/GeneralUpdate.Core/Pipelines/Middleware/MD5Middleware.cs +++ b/src/GeneralUpdate.Core/Pipelines/Middleware/MD5Middleware.cs @@ -1,4 +1,4 @@ -using GeneralUpdate.Common.Utils; +using GeneralUpdate.Core.Utils; using GeneralUpdate.Core.Pipelines.Context; using GeneralUpdate.Core.Update; using System; @@ -20,9 +20,9 @@ namespace GeneralUpdate.Core.Pipelines.Middleware var node = stack.Pop(); if (node != null) await node.Next.Invoke(context, stack); } - catch + catch(Exception ex) { - context.OnExceptionEventAction(this, exception); + context.OnExceptionEventAction(this, exception ?? ex); throw exception; } } diff --git a/src/GeneralUpdate.Core/Pipelines/Middleware/PatchMiddleware.cs b/src/GeneralUpdate.Core/Pipelines/Middleware/PatchMiddleware.cs index bca5398a9282d2f0472b6d384749aabbebfd98d2..03e12b496852d8b139d28a78fbb4eac4632d404a 100644 --- a/src/GeneralUpdate.Core/Pipelines/Middleware/PatchMiddleware.cs +++ b/src/GeneralUpdate.Core/Pipelines/Middleware/PatchMiddleware.cs @@ -19,7 +19,7 @@ namespace GeneralUpdate.Core.Pipelines.Middleware } catch (Exception ex) { - var exception = new Exception($"An exception occurred while updating the patch file : { ex.Message } !", ex.InnerException); + var exception = new Exception($"{ ex.Message } !", ex.InnerException); context.OnExceptionEventAction(this, exception); throw exception; } diff --git a/src/GeneralUpdate.Core/Pipelines/Middleware/ZipMiddleware.cs b/src/GeneralUpdate.Core/Pipelines/Middleware/ZipMiddleware.cs index cc9880180406624b6d1e97e326030d92c84798d1..c86082c723fdf845a870099a3eb0af17cfb67385 100644 --- a/src/GeneralUpdate.Core/Pipelines/Middleware/ZipMiddleware.cs +++ b/src/GeneralUpdate.Core/Pipelines/Middleware/ZipMiddleware.cs @@ -1,8 +1,8 @@ -using GeneralUpdate.Common.Models; -using GeneralUpdate.Core.Pipelines.Context; +using GeneralUpdate.Core.Pipelines.Context; using GeneralUpdate.Core.Update; using GeneralUpdate.Differential.Config; using GeneralUpdate.Zip; +using GeneralUpdate.Zip.Factory; using System; using System.Threading.Tasks; @@ -18,14 +18,15 @@ namespace GeneralUpdate.Core.Pipelines.Middleware context.OnProgressEventAction(this, ProgressType.Updatefile, "In the unzipped file ..."); var version = context.Version; bool isUnzip = UnZip(context); - if (!isUnzip) throw exception = new Exception($"Unzip file failed ! Version-{ version.Version } MD5-{ version.MD5 } ."); + if (!isUnzip) throw exception = new Exception($"Unzip file failed , Version-{ version.Version } MD5-{ version.MD5 } !"); await ConfigFactory.Instance.Scan(context.SourcePath, context.TargetPath); var node = stack.Pop(); if (node != null) await node.Next.Invoke(context, stack); } - catch + catch(Exception ex) { + exception = exception ?? ex; context.OnExceptionEventAction(this, exception); throw exception; } @@ -44,12 +45,9 @@ namespace GeneralUpdate.Core.Pipelines.Middleware { bool isComplated = false; var generalZipfactory = new GeneralZipFactory(); - generalZipfactory.UnZipProgress += (sender, e) => - { - context.OnProgressEventAction(this, ProgressType.Updatefile, "Updatting file..."); - }; + generalZipfactory.UnZipProgress += (sender, e) => context.OnProgressEventAction(this, ProgressType.Updatefile, "Updatting file..."); generalZipfactory.Completed += (sender, e) => isComplated = true; - generalZipfactory.CreatefOperate(MatchType(context.Format), context.ZipfilePath, context.SourcePath, false, context.Encoding). + generalZipfactory.CreatefOperate(MatchType(context.Format), context.ZipfilePath, context.TargetPath, false, context.Encoding). UnZip(); return isComplated; } diff --git a/src/GeneralUpdate.Core/Pipelines/Pipeline/IPipelineBuilder.cs b/src/GeneralUpdate.Core/Pipelines/Pipeline/IPipelineBuilder.cs index f39761704e6ec89ee8ace34ecfb629133dd8269f..fee59bdc8f7bb245b1614c5a593d5131e2bf590b 100644 --- a/src/GeneralUpdate.Core/Pipelines/Pipeline/IPipelineBuilder.cs +++ b/src/GeneralUpdate.Core/Pipelines/Pipeline/IPipelineBuilder.cs @@ -1,4 +1,5 @@ using GeneralUpdate.Core.Pipelines.Middleware; +using System.Threading.Tasks; namespace GeneralUpdate.Core.Pipelines.Pipeline { @@ -6,6 +7,6 @@ namespace GeneralUpdate.Core.Pipelines.Pipeline { IPipelineBuilder Use(IMiddleware middleware); - IPipelineBuilder Launch(); + Task Launch(); } } \ No newline at end of file diff --git a/src/GeneralUpdate.Core/Pipelines/PipelineBuilder.cs b/src/GeneralUpdate.Core/Pipelines/PipelineBuilder.cs index 0a0fb66e457f080d0ef4116be44865db3037bc3b..59ab97999975dd0370622c66d4a13956de7dc438 100644 --- a/src/GeneralUpdate.Core/Pipelines/PipelineBuilder.cs +++ b/src/GeneralUpdate.Core/Pipelines/PipelineBuilder.cs @@ -3,6 +3,7 @@ using GeneralUpdate.Core.Pipelines.Middleware; using GeneralUpdate.Core.Pipelines.Pipeline; using System; using System.Collections.Generic; +using System.Threading.Tasks; namespace GeneralUpdate.Core.Pipelines { @@ -25,11 +26,11 @@ namespace GeneralUpdate.Core.Pipelines return this; } - public IPipelineBuilder Launch() + public async Task Launch() { if (nodes == null || nodes.Count == 0) throw new ArgumentNullException(nameof(nodes)); _components = new MiddlewareStack(nodes); - _components.Pop().Next.Invoke(_context, _components); + await _components.Pop().Next.Invoke(_context, _components); return this; } } diff --git a/src/GeneralUpdate.Core/Strategys/Strategy.cs b/src/GeneralUpdate.Core/Strategys/Strategy.cs index cf47d2631004a8e7d8494949fda806c10523e08f..911010b36ef34c2c0560f3f650016c280e4d35ce 100644 --- a/src/GeneralUpdate.Core/Strategys/Strategy.cs +++ b/src/GeneralUpdate.Core/Strategys/Strategy.cs @@ -1,13 +1,14 @@ -using GeneralUpdate.Common.Models; -using GeneralUpdate.Common.Utils; -using GeneralUpdate.Core.Models; +using GeneralUpdate.Core.Models; using GeneralUpdate.Core.Update; -using GeneralUpdate.Zip; using System; -using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; +using GeneralUpdate.Core.Pipelines; +using GeneralUpdate.Core.Pipelines.Context; +using GeneralUpdate.Core.Pipelines.Middleware; +using GeneralUpdate.Core.Utils; +using System.Threading.Tasks; namespace GeneralUpdate.Core.Strategys { @@ -15,12 +16,14 @@ namespace GeneralUpdate.Core.Strategys { #region Private Members + private const string PATCHS = "patchs"; + private const string DIFF_FORMAT = ".patch"; + private BaseContext _context; + protected UpdatePacket Packet { get; set; } protected Action ProgressEventAction { get; set; } protected Action ExceptionEventAction { get; set; } - - private OperationType _operationType; - + #endregion Private Members #region Public Methods @@ -31,38 +34,29 @@ namespace GeneralUpdate.Core.Strategys Packet = (UpdatePacket)file; ProgressEventAction = progressEventAction; ExceptionEventAction = exceptionEventAction; - _operationType = Packet.Format.Equals(".zip") ? OperationType.GZip : OperationType.G7z; } public override void Excute() { try { - var updateVersions = Packet.UpdateVersions; - updateVersions = updateVersions.OrderBy(x => x.PubTime).ToList(); - foreach (var version in updateVersions) + Task.Run(async () => { - var zipFilePath = $"{Packet.TempPath}{ version.Name }{ Packet.Format }"; - var isVerify = VerifyFileMd5(zipFilePath, version.MD5); - if (!isVerify) + var updateVersions = Packet.UpdateVersions.OrderBy(x => x.PubTime).ToList(); + var patchPath = FileUtil.GetTempDirectory(PATCHS); + foreach (var version in updateVersions) { - var eventArgs = new MutiDownloadProgressChangedEventArgs(version, ProgressType.Fail, "Verify MD5 error!"); - ProgressEventAction(this, eventArgs); - throw new Exception($"The update package MD5 code is inconsistent ! Version-{ version.Version } MD5-{ version.MD5 } ."); + var zipFilePath = $"{Packet.TempPath}{ version.Name }{ Packet.Format }"; + var pipelineBuilder = new PipelineBuilder(new BaseContext(ProgressEventAction, ExceptionEventAction, version, zipFilePath, patchPath, Packet.InstallPath, Packet.Format, Packet.Encoding)). + UseMiddleware(). + UseMiddleware(). + UseMiddleware(). + UseMiddleware(); + await pipelineBuilder.Launch(); } - if (UnZip(version, zipFilePath, Packet.InstallPath)) - { - version.IsUnZip = true; - var versionArgs = new UpdateVersion(version.MD5, version.PubTime, version.Version, null, version.Name); - var message = version.IsUnZip ? "Update completed." : "Update failed!"; - var type = version.IsUnZip ? ProgressType.Done : ProgressType.Fail; - var eventArgs = new MutiDownloadProgressChangedEventArgs(versionArgs, type, message); - ProgressEventAction(this, eventArgs); - } - } - CheckAllIsUnZip(updateVersions); - Dirty(); - StartApp(Packet.AppName); + Dirty(); + StartApp(Packet.AppName); + }); } catch (Exception ex) { @@ -100,53 +94,6 @@ namespace GeneralUpdate.Core.Strategys private void Error(Exception ex) { if (ExceptionEventAction != null) ExceptionEventAction(this, new ExceptionEventArgs(ex)); } - protected void CheckAllIsUnZip(List versions) - { - foreach (var version in versions) - { - if (!version.IsUnZip) throw new Exception($"Failed to decompress the compressed package! Version-{ version.Version } MD5-{ version.MD5 } ."); - } - } - - /// - /// UnZip - /// - /// - /// - /// - /// - protected bool UnZip(UpdateVersion versionInfo, string zipfilepath, string unzippath) - { - try - { - bool isComplated = false; - var generalZipFactory = new GeneralZipFactory(); - generalZipFactory.UnZipProgress += (sender, e) => - { - if (ProgressEventAction == null) return; - var version = new UpdateVersion(versionInfo.MD5, versionInfo.PubTime, versionInfo.Version, null, versionInfo.Name); - var eventArgs = new MutiDownloadProgressChangedEventArgs(version, ProgressType.Updatefile, "Updatting file..."); - ProgressEventAction(this, eventArgs); - }; - generalZipFactory.Completed += (sender, e) => isComplated = true; - generalZipFactory.CreatefOperate(_operationType, zipfilepath, unzippath, false, Packet.CompressEncoding). - UnZip(); - return isComplated; - } - catch (Exception ex) - { - if (ExceptionEventAction != null) ExceptionEventAction(this, new ExceptionEventArgs(ex)); - return false; - } - } - - protected bool VerifyFileMd5(string fileName, string md5) - { - var packetMD5 = FileUtil.GetFileMD5(fileName); - if (md5.ToUpper().Equals(packetMD5.ToUpper())) return true; - return false; - } - private bool Dirty() { try diff --git a/src/GeneralUpdate.Core/Update/UpdateOption.cs b/src/GeneralUpdate.Core/Update/UpdateOption.cs index 52de130ae3c15f8151b97667c232790874f0b95f..2cbd7d64c5a3c90aa5fb902d398c26727359956e 100644 --- a/src/GeneralUpdate.Core/Update/UpdateOption.cs +++ b/src/GeneralUpdate.Core/Update/UpdateOption.cs @@ -20,12 +20,12 @@ namespace GeneralUpdate.Core.Update /// /// Update the file format of the package. /// - public static readonly UpdateOption CompressFormat = ValueOf("COMPRESSFORMAT"); + public static readonly UpdateOption Format = ValueOf("COMPRESSFORMAT"); /// /// Compress encoding. /// - public static readonly UpdateOption CompressEncoding = ValueOf("COMPRESSENCODING"); + public static readonly UpdateOption Encoding = ValueOf("COMPRESSENCODING"); /// /// Main program name. diff --git a/src/GeneralUpdate.Common/Utils/ConvertUtil.cs b/src/GeneralUpdate.Core/Utils/ConvertUtil.cs similarity index 95% rename from src/GeneralUpdate.Common/Utils/ConvertUtil.cs rename to src/GeneralUpdate.Core/Utils/ConvertUtil.cs index 443be7a2e5666718b2ff5cfa0745c5404edae8d7..97954197fe8f512d6ac927aa2241a77c3900f8ae 100644 --- a/src/GeneralUpdate.Common/Utils/ConvertUtil.cs +++ b/src/GeneralUpdate.Core/Utils/ConvertUtil.cs @@ -1,10 +1,10 @@ -using GeneralUpdate.Common.DTOs; -using GeneralUpdate.Common.Models; +using GeneralUpdate.Core.DTOs; +using GeneralUpdate.Core.Models; using System.Collections.Generic; using System.Linq; using System.Text; -namespace GeneralUpdate.Common.Utils +namespace GeneralUpdate.Core.Utils { public class ConvertUtil { diff --git a/src/GeneralUpdate.Common/Utils/DataValidateUtil.cs b/src/GeneralUpdate.Core/Utils/DataValidateUtil.cs similarity index 91% rename from src/GeneralUpdate.Common/Utils/DataValidateUtil.cs rename to src/GeneralUpdate.Core/Utils/DataValidateUtil.cs index 65174267eff35974e2136f8ce215fbd7bebbfce0..5c0005b484b5a63de08ded6cba9d3ff3aa771d6b 100644 --- a/src/GeneralUpdate.Common/Utils/DataValidateUtil.cs +++ b/src/GeneralUpdate.Core/Utils/DataValidateUtil.cs @@ -1,6 +1,6 @@ using System.Text.RegularExpressions; -namespace GeneralUpdate.Common.Utils +namespace GeneralUpdate.Core.Utils { public class DataValidateUtil { diff --git a/src/GeneralUpdate.Common/Utils/FileUtil.cs b/src/GeneralUpdate.Core/Utils/FileUtil.cs similarity index 98% rename from src/GeneralUpdate.Common/Utils/FileUtil.cs rename to src/GeneralUpdate.Core/Utils/FileUtil.cs index 781929d3667f6b34dd1066292ed7820851833706..be79edf9ade6ad0dc9418e0836cbefab153c6a79 100644 --- a/src/GeneralUpdate.Common/Utils/FileUtil.cs +++ b/src/GeneralUpdate.Core/Utils/FileUtil.cs @@ -5,7 +5,7 @@ using System.Linq; using System.Security.Cryptography; using System.Text; -namespace GeneralUpdate.Common.Utils +namespace GeneralUpdate.Core.Utils { public static class FileUtil { @@ -68,9 +68,9 @@ namespace GeneralUpdate.Common.Utils Directory.Delete(sourceDirName, true); } - public static string GetTempDirectory(string version) + public static string GetTempDirectory(string name) { - var path2 = $"generalupdate_{ DateTime.Now.ToString("yyyy-MM-dd") }_{version}"; + var path2 = $"generalupdate_{ DateTime.Now.ToString("yyyy-MM-dd") }_{name}"; var tempDir = Path.Combine(Path.GetTempPath(), path2); if (!Directory.Exists(tempDir)) { diff --git a/src/GeneralUpdate.Common/Utils/HttpUtil.cs b/src/GeneralUpdate.Core/Utils/HttpUtil.cs similarity index 98% rename from src/GeneralUpdate.Common/Utils/HttpUtil.cs rename to src/GeneralUpdate.Core/Utils/HttpUtil.cs index 76d6e43647d96101840e2fa49c0fe73990a490ad..e91ba210e0af0e0044c8b0bd17c8130e443bf994 100644 --- a/src/GeneralUpdate.Common/Utils/HttpUtil.cs +++ b/src/GeneralUpdate.Core/Utils/HttpUtil.cs @@ -6,7 +6,7 @@ using System.Security.Cryptography.X509Certificates; using System.Text; using System.Threading.Tasks; -namespace GeneralUpdate.Common.Utils +namespace GeneralUpdate.Core.Utils { public class HttpUtil { diff --git a/src/GeneralUpdate.Common/Utils/SerializeUtil.cs b/src/GeneralUpdate.Core/Utils/SerializeUtil.cs similarity index 95% rename from src/GeneralUpdate.Common/Utils/SerializeUtil.cs rename to src/GeneralUpdate.Core/Utils/SerializeUtil.cs index 048bebf97b4643d0ddd31ac0de3612e8b35b173d..acfc794372fd66e8bd3844362c57604c0245af0e 100644 --- a/src/GeneralUpdate.Common/Utils/SerializeUtil.cs +++ b/src/GeneralUpdate.Core/Utils/SerializeUtil.cs @@ -2,7 +2,7 @@ using System; using System.Text; -namespace GeneralUpdate.Common.Utils +namespace GeneralUpdate.Core.Utils { public class SerializeUtil { diff --git a/src/GeneralUpdate.Differential/Binary/BinaryHandle.cs b/src/GeneralUpdate.Differential/Binary/BinaryHandle.cs index 1aae98074fd183b06858bb96dea14079ca417eff..e137d57a42083160de5058129afe92ed02aa89ae 100644 --- a/src/GeneralUpdate.Differential/Binary/BinaryHandle.cs +++ b/src/GeneralUpdate.Differential/Binary/BinaryHandle.cs @@ -342,6 +342,9 @@ namespace GeneralUpdate.Differential.Binary } } } + + File.Delete(_oldfilePath); + File.Move(_newfilePath, _oldfilePath); }); } diff --git a/src/GeneralUpdate.Differential/Common/Filefilter.cs b/src/GeneralUpdate.Differential/Common/Filefilter.cs index 9296741b0480db56d4ca5cc145801d59997699ac..95bc459b18b467d03b4dfd609e9740cac8320df0 100644 --- a/src/GeneralUpdate.Differential/Common/Filefilter.cs +++ b/src/GeneralUpdate.Differential/Common/Filefilter.cs @@ -8,6 +8,6 @@ namespace GeneralUpdate.Differential.Common public static readonly List Temp = new List() { ".json" }; - public static readonly List Diff = new List() { ".patch", ".7z", ".zip", ".json" }; + public static readonly List Diff = new List() { ".patch", ".7z", ".zip", ".rar" , ".tar", ".db", ".xml", ".ini", ".json", ".config" }; } } \ No newline at end of file diff --git a/src/GeneralUpdate.Differential/Config/ConfigFactory.cs b/src/GeneralUpdate.Differential/Config/ConfigFactory.cs index d28deeebdd39b03043f61d5f89ca8cd9d3857492..038dde3aa995432215e135cf7f080d6947c7c477 100644 --- a/src/GeneralUpdate.Differential/Config/ConfigFactory.cs +++ b/src/GeneralUpdate.Differential/Config/ConfigFactory.cs @@ -1,4 +1,4 @@ -using GeneralUpdate.Common.Utils; +using GeneralUpdate.Core.Utils; using GeneralUpdate.Differential.Common; using GeneralUpdate.Differential.Config.Cache; using GeneralUpdate.Differential.Config.Handles; @@ -97,8 +97,10 @@ namespace GeneralUpdate.Differential.Config { try { + _disposed = false; _appPath = appPath ?? Environment.CurrentDirectory; _scanPath = scanPath ?? Environment.CurrentDirectory; + if (!Directory.Exists(_appPath) || !Directory.Exists(_scanPath)) return; List files = new List(); Find(_scanPath, ref files, Filefilter.Temp); if (files.Count == 0) return; @@ -108,10 +110,6 @@ namespace GeneralUpdate.Differential.Config { throw new Exception($"Scan config files error : { ex.Message } .", ex.InnerException); } - finally - { - _disposed = false; - } } /// @@ -129,13 +127,11 @@ namespace GeneralUpdate.Differential.Config _configCache.Dispose(); _configCache = null; } - if (_files != null) { _files.Clear(); _files = null; } - _disposed = true; } catch (Exception ex) diff --git a/src/GeneralUpdate.Differential/Config/Handles/DBHandle.cs b/src/GeneralUpdate.Differential/Config/Handles/DBHandle.cs index 7fd327fa3d5b6c1b6e0d94e9eb5753118a0ddd5f..9cbc13de1c6519cd2260e1e4b8fc937bb9b11972 100644 --- a/src/GeneralUpdate.Differential/Config/Handles/DBHandle.cs +++ b/src/GeneralUpdate.Differential/Config/Handles/DBHandle.cs @@ -1,4 +1,4 @@ -using GeneralUpdate.Common.CustomAwaiter; +using GeneralUpdate.Core.CustomAwaiter; using System; using System.Threading.Tasks; diff --git a/src/GeneralUpdate.Differential/Config/Handles/IniHandle.cs b/src/GeneralUpdate.Differential/Config/Handles/IniHandle.cs index dfd5fab4a89b51fef98322ba8437068099e0c83b..9a06abaee13a632625f3cecc6063da425ee1474b 100644 --- a/src/GeneralUpdate.Differential/Config/Handles/IniHandle.cs +++ b/src/GeneralUpdate.Differential/Config/Handles/IniHandle.cs @@ -1,4 +1,4 @@ -using GeneralUpdate.Common.CustomAwaiter; +using GeneralUpdate.Core.CustomAwaiter; using System; using System.Threading.Tasks; diff --git a/src/GeneralUpdate.Differential/Config/Handles/JsonHandle.cs b/src/GeneralUpdate.Differential/Config/Handles/JsonHandle.cs index 02df827628c969e98c9c29bf169c1c32481036d5..8a5a9dfe2a21f033ddeaccd37fc2026e82992373 100644 --- a/src/GeneralUpdate.Differential/Config/Handles/JsonHandle.cs +++ b/src/GeneralUpdate.Differential/Config/Handles/JsonHandle.cs @@ -1,4 +1,4 @@ -using GeneralUpdate.Common.CustomAwaiter; +using GeneralUpdate.Core.CustomAwaiter; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System; diff --git a/src/GeneralUpdate.Differential/Config/Handles/XmlHandle.cs b/src/GeneralUpdate.Differential/Config/Handles/XmlHandle.cs index 34ec732148da85722e6ef2b9c743e1cbe4ba6bce..e4f9267fcbab434f8b8bdd0b9b20c204cd9d0490 100644 --- a/src/GeneralUpdate.Differential/Config/Handles/XmlHandle.cs +++ b/src/GeneralUpdate.Differential/Config/Handles/XmlHandle.cs @@ -1,4 +1,4 @@ -using GeneralUpdate.Common.CustomAwaiter; +using GeneralUpdate.Core.CustomAwaiter; using System; using System.Threading.Tasks; diff --git a/src/GeneralUpdate.Differential/DifferentialCore.cs b/src/GeneralUpdate.Differential/DifferentialCore.cs index 860cfff94cef0e63403c8793ee3b37a849f55e0b..739f30373a6038b3c515299f303c3849f3000003 100644 --- a/src/GeneralUpdate.Differential/DifferentialCore.cs +++ b/src/GeneralUpdate.Differential/DifferentialCore.cs @@ -1,9 +1,9 @@ -using GeneralUpdate.Common.Models; -using GeneralUpdate.Common.Utils; +using GeneralUpdate.Core.Utils; using GeneralUpdate.Differential.Binary; using GeneralUpdate.Differential.Common; using GeneralUpdate.Zip; using GeneralUpdate.Zip.Events; +using GeneralUpdate.Zip.Factory; using System; using System.IO; using System.Linq; @@ -19,7 +19,9 @@ namespace GeneralUpdate.Differential /// /// Differential file format . /// - private const string DIFF_FORMAT = ".patch"; + private const string PATCH_FORMAT = ".patch"; + + private const string PATCHS = "patchs"; private static readonly object _lockObj = new object(); private static DifferentialCore _instance; @@ -73,7 +75,7 @@ namespace GeneralUpdate.Differential { try { - if (string.IsNullOrWhiteSpace(patchPath)) patchPath = Path.Combine(Environment.CurrentDirectory, "patchs"); + if (string.IsNullOrWhiteSpace(patchPath)) patchPath = Path.Combine(Environment.CurrentDirectory, PATCHS); if (!Directory.Exists(patchPath)) Directory.CreateDirectory(patchPath); //Take the left tree as the center to match the files that are not in the right tree . @@ -84,11 +86,12 @@ namespace GeneralUpdate.Differential { var oldfile = Path.Combine(appPath, file.Name); var newfile = file.FullName; - if (File.Exists(oldfile) && File.Exists(newfile)) + var extensionName = Path.GetExtension(file.FullName); + if (File.Exists(oldfile) && File.Exists(newfile) && !Filefilter.Diff.Contains(extensionName)) { //Generate the difference file to the difference directory . await new BinaryHandle().Clean(Path.Combine(appPath, file.Name), file.FullName, - Path.Combine(patchPath, $"{ Path.GetFileNameWithoutExtension(file.Name) }{ DIFF_FORMAT }")); + Path.Combine(patchPath, $"{ Path.GetFileNameWithoutExtension(file.Name) }{ PATCH_FORMAT }")); } else { @@ -98,7 +101,8 @@ namespace GeneralUpdate.Differential _compressProgressCallback = compressProgressCallback; var factory = new GeneralZipFactory(); if (_compressProgressCallback != null) factory.CompressProgress += OnCompressProgress; - factory.CreatefOperate(type, patchPath, patchPath, false, encoding).CreatZip(); + //The update package exists in the 'target path' directory. + factory.CreatefOperate(type, patchPath, targetPath, true, encoding).CreatZip(); } catch (Exception ex) { @@ -115,6 +119,7 @@ namespace GeneralUpdate.Differential /// public async Task Drity(string appPath, string patchPath) { + if (!Directory.Exists(appPath) || !Directory.Exists(patchPath)) return; try { if (string.IsNullOrWhiteSpace(patchPath) || string.IsNullOrWhiteSpace(appPath)) @@ -124,11 +129,17 @@ namespace GeneralUpdate.Differential var oldFiles = FileUtil.GetAllFiles(appPath); foreach (var oldFile in oldFiles) { + //Only the difference file (.patch) can be updated here. var findFile = patchFiles.FirstOrDefault(f => Path.GetFileNameWithoutExtension(f.Name).Equals(Path.GetFileNameWithoutExtension(oldFile.Name))); - if (findFile != null) await DrityPatch(oldFile.FullName, findFile.FullName); + if (findFile != null) + { + var extensionName = Path.GetExtension(findFile.FullName); + if (!extensionName.Equals(PATCH_FORMAT)) continue; + await DrityPatch(oldFile.FullName, findFile.FullName); + } } - DrityNew(appPath, patchPath); - if (Directory.Exists(patchPath)) Directory.Delete(patchPath, true); + //Update does not include files or copies configuration files. + await DrityUnkonw(appPath, patchPath); } catch (Exception ex) { @@ -150,8 +161,6 @@ namespace GeneralUpdate.Differential if (!File.Exists(appPath) || !File.Exists(patchPath)) return; var newPath = Path.Combine(Path.GetDirectoryName(appPath), $"{ Path.GetRandomFileName() }_{ Path.GetFileName(appPath) }"); await new BinaryHandle().Drity(appPath, newPath, patchPath); - File.Delete(appPath); - File.Move(newPath, appPath); } catch (Exception ex) { @@ -164,7 +173,7 @@ namespace GeneralUpdate.Differential /// /// Client application directory . /// - private void DrityNew(string appPath, string patchPath) + private Task DrityUnkonw(string appPath, string patchPath) { try { @@ -175,6 +184,8 @@ namespace GeneralUpdate.Differential if (Filefilter.Diff.Contains(extensionName)) continue; File.Copy(file.FullName, Path.Combine(appPath, file.Name), true); } + if (Directory.Exists(patchPath)) Directory.Delete(patchPath, true); + return Task.CompletedTask; } catch (Exception ex) { diff --git a/src/GeneralUpdate.Differential/GeneralUpdate.Differential.csproj b/src/GeneralUpdate.Differential/GeneralUpdate.Differential.csproj index 5ef1e13f678067065467be9b2f2e51f6b673cf5c..75906870611de8cb6a5f49f4ffe974ddd5aff8f7 100644 --- a/src/GeneralUpdate.Differential/GeneralUpdate.Differential.csproj +++ b/src/GeneralUpdate.Differential/GeneralUpdate.Differential.csproj @@ -5,12 +5,24 @@ + + + + + + + + + - + + + + diff --git a/src/GeneralUpdate.Zip/Factory/IFactory.cs b/src/GeneralUpdate.Zip/Factory/IFactory.cs index 283f4a9419068c528faf0b68ac3b789a615a5797..41c6ca0f706da79b1bc0bfa58a4521e46703eb7c 100644 --- a/src/GeneralUpdate.Zip/Factory/IFactory.cs +++ b/src/GeneralUpdate.Zip/Factory/IFactory.cs @@ -1,5 +1,4 @@ -using GeneralUpdate.Common.Models; -using System.Text; +using System.Text; namespace GeneralUpdate.Zip.Factory { diff --git a/src/GeneralUpdate.Common/Models/OperationType.cs b/src/GeneralUpdate.Zip/Factory/OperationType.cs similarity index 69% rename from src/GeneralUpdate.Common/Models/OperationType.cs rename to src/GeneralUpdate.Zip/Factory/OperationType.cs index 4a120b32b090225dcefed293cb13654a73de87d7..871c62b06d7f558e3ed2f47dd8a4134d14b8a49a 100644 --- a/src/GeneralUpdate.Common/Models/OperationType.cs +++ b/src/GeneralUpdate.Zip/Factory/OperationType.cs @@ -1,4 +1,4 @@ -namespace GeneralUpdate.Common.Models +namespace GeneralUpdate.Zip.Factory { public enum OperationType { diff --git a/src/GeneralUpdate.Zip/GZip/GeneralZip.cs b/src/GeneralUpdate.Zip/GZip/GeneralZip.cs index a3072cb3b83ce07cb39e2dc8770d7d429c1d82a9..08e48c2ffb71986814f9d5c234537267fc655720 100644 --- a/src/GeneralUpdate.Zip/GZip/GeneralZip.cs +++ b/src/GeneralUpdate.Zip/GZip/GeneralZip.cs @@ -1,6 +1,5 @@ using GeneralUpdate.Zip.Events; using GeneralUpdate.Zip.Factory; -using System; using System.Collections.Generic; using System.IO; using System.IO.Compression; @@ -99,7 +98,7 @@ namespace GeneralUpdate.Zip.GZip return false; return true; } - catch (Exception ex) + catch { return false; } diff --git a/src/GeneralUpdate.Zip/GeneralUpdate.Zip.csproj b/src/GeneralUpdate.Zip/GeneralUpdate.Zip.csproj index 53a7a979f4d95fb779868219935827c959de62c9..250e23ad13fded9c48a841c95cf048c75d36f71e 100644 --- a/src/GeneralUpdate.Zip/GeneralUpdate.Zip.csproj +++ b/src/GeneralUpdate.Zip/GeneralUpdate.Zip.csproj @@ -24,8 +24,4 @@ - - - - diff --git a/src/GeneralUpdate.Zip/GeneralZipFactory.cs b/src/GeneralUpdate.Zip/GeneralZipFactory.cs index b542e7ffe82e608694a83e1e84c263974c221085..d30eeb600bca87b55770f933905ef6cd39466ed5 100644 --- a/src/GeneralUpdate.Zip/GeneralZipFactory.cs +++ b/src/GeneralUpdate.Zip/GeneralZipFactory.cs @@ -1,5 +1,4 @@ -using GeneralUpdate.Common.Models; -using GeneralUpdate.Zip.Events; +using GeneralUpdate.Zip.Events; using GeneralUpdate.Zip.Factory; using GeneralUpdate.Zip.G7z; using GeneralUpdate.Zip.GZip; diff --git a/src/GeneralUpdate.sln b/src/GeneralUpdate.sln index dfa983874f7cc3b5691bdb54f24de926793a9266..16e45f11cbc0023e0cda90618b16f29d5ef57815 100644 --- a/src/GeneralUpdate.sln +++ b/src/GeneralUpdate.sln @@ -17,8 +17,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GeneralUpdate.AspNetCore", EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GeneralUpdate.ClientCore", "GeneralUpdate.ClientCore\GeneralUpdate.ClientCore.csproj", "{BAEFF926-6B2C-46F1-BB73-AA2AB1355565}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GeneralUpdate.Common", "GeneralUpdate.Common\GeneralUpdate.Common.csproj", "{7ABB2DDF-7033-4584-8180-25F5340E26C0}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoUpdate.Test", "AutoUpdate.Test\AutoUpdate.Test.csproj", "{9FE9DC65-F45E-43C1-A62A-02ADD096EB1C}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoUpdate.MinimalService", "AutoUpdate.MinimalService\AutoUpdate.MinimalService.csproj", "{43695C1B-35CA-466A-B443-B83F6951E50F}" @@ -31,9 +29,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoUpdate.MD5", "AutoUpdat EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoUpdate.ClientCore", "AutoUpdate.ClientCore\AutoUpdate.ClientCore.csproj", "{D18CADC0-FB28-4B88-BCA2-D531C1F9691A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GeneralUpdate.Differential", "GeneralUpdate.Differential\GeneralUpdate.Differential.csproj", "{40BDA496-7614-4213-92D0-3B1B187675D3}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GeneralUpdate.Differential", "GeneralUpdate.Differential\GeneralUpdate.Differential.csproj", "{40BDA496-7614-4213-92D0-3B1B187675D3}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoUpdate.Differential", "AutoUpdate.Differential\AutoUpdate.Differential.csproj", "{DD41B7C0-1742-4BC7-98AC-0D83BE9D95CB}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoUpdate.Differential", "AutoUpdate.Differential\AutoUpdate.Differential.csproj", "{F5982920-F5A9-4949-90D0-0035FFFAF622}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -61,10 +59,6 @@ Global {BAEFF926-6B2C-46F1-BB73-AA2AB1355565}.Debug|Any CPU.Build.0 = Debug|Any CPU {BAEFF926-6B2C-46F1-BB73-AA2AB1355565}.Release|Any CPU.ActiveCfg = Release|Any CPU {BAEFF926-6B2C-46F1-BB73-AA2AB1355565}.Release|Any CPU.Build.0 = Release|Any CPU - {7ABB2DDF-7033-4584-8180-25F5340E26C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7ABB2DDF-7033-4584-8180-25F5340E26C0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7ABB2DDF-7033-4584-8180-25F5340E26C0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7ABB2DDF-7033-4584-8180-25F5340E26C0}.Release|Any CPU.Build.0 = Release|Any CPU {9FE9DC65-F45E-43C1-A62A-02ADD096EB1C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9FE9DC65-F45E-43C1-A62A-02ADD096EB1C}.Debug|Any CPU.Build.0 = Debug|Any CPU {9FE9DC65-F45E-43C1-A62A-02ADD096EB1C}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -93,10 +87,10 @@ Global {40BDA496-7614-4213-92D0-3B1B187675D3}.Debug|Any CPU.Build.0 = Debug|Any CPU {40BDA496-7614-4213-92D0-3B1B187675D3}.Release|Any CPU.ActiveCfg = Release|Any CPU {40BDA496-7614-4213-92D0-3B1B187675D3}.Release|Any CPU.Build.0 = Release|Any CPU - {DD41B7C0-1742-4BC7-98AC-0D83BE9D95CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DD41B7C0-1742-4BC7-98AC-0D83BE9D95CB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DD41B7C0-1742-4BC7-98AC-0D83BE9D95CB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DD41B7C0-1742-4BC7-98AC-0D83BE9D95CB}.Release|Any CPU.Build.0 = Release|Any CPU + {F5982920-F5A9-4949-90D0-0035FFFAF622}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F5982920-F5A9-4949-90D0-0035FFFAF622}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F5982920-F5A9-4949-90D0-0035FFFAF622}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F5982920-F5A9-4949-90D0-0035FFFAF622}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -107,7 +101,6 @@ Global {D94882E1-55A7-4787-B049-265F52DC576E} = {91F059E6-7AD3-4FB7-9604-30A7849C6EFF} {7D529953-3846-485F-AC71-3EEACB9161EC} = {91F059E6-7AD3-4FB7-9604-30A7849C6EFF} {BAEFF926-6B2C-46F1-BB73-AA2AB1355565} = {91F059E6-7AD3-4FB7-9604-30A7849C6EFF} - {7ABB2DDF-7033-4584-8180-25F5340E26C0} = {91F059E6-7AD3-4FB7-9604-30A7849C6EFF} {9FE9DC65-F45E-43C1-A62A-02ADD096EB1C} = {5836AD39-6293-4CFE-AD7D-298C167973DB} {43695C1B-35CA-466A-B443-B83F6951E50F} = {5836AD39-6293-4CFE-AD7D-298C167973DB} {879B20F4-22BF-46CA-A5F5-62A9DCF29CFD} = {5836AD39-6293-4CFE-AD7D-298C167973DB} @@ -115,7 +108,7 @@ Global {F074C9E4-2EE4-492B-BA43-55D0FE1E0579} = {5836AD39-6293-4CFE-AD7D-298C167973DB} {D18CADC0-FB28-4B88-BCA2-D531C1F9691A} = {5836AD39-6293-4CFE-AD7D-298C167973DB} {40BDA496-7614-4213-92D0-3B1B187675D3} = {91F059E6-7AD3-4FB7-9604-30A7849C6EFF} - {DD41B7C0-1742-4BC7-98AC-0D83BE9D95CB} = {5836AD39-6293-4CFE-AD7D-298C167973DB} + {F5982920-F5A9-4949-90D0-0035FFFAF622} = {5836AD39-6293-4CFE-AD7D-298C167973DB} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {A7B2D0AD-E000-4749-BAC0-FF21B9872805}