diff --git a/README.md b/README.md index e0210879..f7a8b7e5 100644 --- a/README.md +++ b/README.md @@ -76,3 +76,5 @@ GeneralUpdate寓意为通用更新力致于成为全平台更新组件。 | iOS | 暂不支持 | | Android | 暂不支持 | | 树莓派(IoT) | 待验证 | +| 麒麟V10(飞腾S2500) | 支持 | +| 麒麟V10(x64) | 支持 | diff --git a/README_en.md b/README_en.md index 8bbdaa03..ba98d71d 100644 --- a/README_en.md +++ b/README_en.md @@ -68,3 +68,5 @@ GeneralUpdate means that the general update is committed to becoming a full-plat | iOS | Not currently supported | | Android | Not currently supported | | raspberry pie | pending verification | +| Kylin V10 (FT-S2500) | yes | +| Kylin V10 (x64) | yes | diff --git a/src/c#/.vs/ProjectEvaluation/generalupdate.metadata.v5 b/src/c#/.vs/ProjectEvaluation/generalupdate.metadata.v5 index d0155d55..ecb44387 100644 Binary files a/src/c#/.vs/ProjectEvaluation/generalupdate.metadata.v5 and b/src/c#/.vs/ProjectEvaluation/generalupdate.metadata.v5 differ diff --git a/src/c#/.vs/ProjectEvaluation/generalupdate.projects.v5 b/src/c#/.vs/ProjectEvaluation/generalupdate.projects.v5 index bdc3730b..304cd4bf 100644 Binary files a/src/c#/.vs/ProjectEvaluation/generalupdate.projects.v5 and b/src/c#/.vs/ProjectEvaluation/generalupdate.projects.v5 differ diff --git a/src/c#/GeneralUpdate.Api/Program.cs b/src/c#/GeneralUpdate.Api/Program.cs index 710c1ae6..cc66ed06 100644 --- a/src/c#/GeneralUpdate.Api/Program.cs +++ b/src/c#/GeneralUpdate.Api/Program.cs @@ -36,23 +36,23 @@ app.MapGet("/versions/{clientType}/{clientVersion}/{clientAppKey}", (int clientType, string clientVersion, string clientAppKey, IUpdateService updateService) => { var versions = new List(); - var md5 = "dd776e3a4f2028a5f61187e23089ddbd"; + var md5 = "b03d52c279faf003965c46041f2037f9";//ɺõĸ°ļMD5룬Ϊظͻ˵ʱҪ֤ͬǷ var pubTime = new DateTimeOffset(DateTime.UtcNow).ToUnixTimeSeconds(); string version = null; if (clientType == AppType.ClientApp) { //client //version = "0.0.0.0"; - version = "9.9.9.9"; + version = "9.9.9.9";//Ϊ9óΪҪ } else if (clientType == AppType.UpgradeApp) { //upgrad //version = "0.0.0.0"; - version = "9.9.9.9"; + version = "9.9.9.9"; //Ϊ9óΪҪ } - var url = $"http://127.0.0.1/1664083126.zip"; - var name = "1664081315"; + var url = $"http://192.168.50.203/testpacket.zip";//°صַ + var name = "testpacket"; versions.Add(new VersionDTO(md5, pubTime, version, url, name)); return updateService.Update(clientType, clientVersion, version, clientAppKey, GetAppSecretKey(), false, versions); }); diff --git a/src/c#/GeneralUpdate.Client/MainPage.xaml.cs b/src/c#/GeneralUpdate.Client/MainPage.xaml.cs index 454bbf46..88435558 100644 --- a/src/c#/GeneralUpdate.Client/MainPage.xaml.cs +++ b/src/c#/GeneralUpdate.Client/MainPage.xaml.cs @@ -4,9 +4,8 @@ using GeneralUpdate.Core.Domain.Entity; using GeneralUpdate.Core.Domain.Enum; using GeneralUpdate.Core.Strategys.PlatformAndroid; -using GeneralUpdate.Core.Strategys.PlatformiOS; -using GeneralUpdate.Core.Strategys.PlatformMac; using GeneralUpdate.Core.Strategys.PlatformWindows; +using GeneralUpdate.Core.Utils; using System.Text; namespace GeneralUpdate.Client @@ -25,6 +24,7 @@ public MainPage() private void OnLoaded(object sender, EventArgs e) { + var md5 = FileUtil.GetFileMD5(@"F:\temp\target\testpacket.zip"); VersionHub.Instance.Subscribe($"{baseUrl}/{hubName}", "TESTNAME", new Action(GetMessage)); } @@ -40,32 +40,15 @@ private void Upgrade() { Task.Run(async () => { - #region Config. - - //该对象用于主程序客户端与更新组件进程之间交互用的对象 - var config = new Configinfo(); - //本机的客户端程序应用地址 - config.InstallPath = @"D:\Updatetest_hub\Run_app"; - //更新公告网页 - config.UpdateLogUrl = "https://www.baidu.com/"; - //客户端当前版本号 - config.ClientVersion = "1.1.1.1"; - //客户端类型:1.主程序客户端 2.更新组件 - config.AppType = AppType.ClientApp; - //指定应用密钥,用于区分客户端应用 - config.AppSecretKey = "41A54379-C7D6-4920-8768-21A3468572E5"; - //更新组件更新包下载地址 - config.UpdateUrl = $"{baseUrl}/versions/{config.AppType}/{config.ClientVersion}/{config.AppSecretKey}"; - //更新程序exe名称 - config.AppName = "AutoUpdate.Core"; - //主程序客户端exe名称 - config.MainAppName = "AutoUpdate.ClientCore"; - //主程序信息 - var mainVersion = "1.1.1.1"; - //主程序客户端更新包下载地址 - config.MainUpdateUrl = $"{baseUrl}/versions/{AppType.ClientApp}/{mainVersion}/{config.AppSecretKey}"; - - #endregion update app. + Configinfo configinfo = null; + +#if WINDOWS + configinfo = GetWindowsConfiginfo(); +#endif + +#if ANDROID + configinfo = GetAndroidConfiginfo(); +#endif var generalClientBootstrap = new GeneralClientBootstrap(); //单个或多个更新包下载通知事件 @@ -81,17 +64,74 @@ private void Upgrade() //整个更新过程出现的任何问题都会通过这个事件通知 generalClientBootstrap.Exception += OnException; //ClientStrategy该更新策略将完成1.自动升级组件自更新 2.启动更新组件 3.配置好ClientParameter无需再像之前的版本写args数组进程通讯了。 - generalClientBootstrap.Config(baseUrl, "B8A7FADD-386C-46B0-B283-C9F963420C7C"). + //generalClientBootstrap.Config(baseUrl, "B8A7FADD-386C-46B0-B283-C9F963420C7C"). + generalClientBootstrap.Config(configinfo). Option(UpdateOption.DownloadTimeOut, 60). Option(UpdateOption.Encoding, Encoding.Default). Option(UpdateOption.Format, Format.ZIP). //注入一个func让用户决定是否跳过本次更新,如果是强制更新则不生效 - SetCustomOption(ShowCustomOption). - Strategy(); + SetCustomOption(ShowCustomOption); +#if WINDOWS + generalClientBootstrap.Strategy(); +#endif +#if ANDROID + generalClientBootstrap.Strategy(); +#endif await generalClientBootstrap.LaunchTaskAsync(); }); } + /// + /// 获取Windows平台所需的配置参数 + /// + /// + private Configinfo GetWindowsConfiginfo() + { + //该对象用于主程序客户端与更新组件进程之间交互用的对象 + var config = new Configinfo(); + //本机的客户端程序应用地址 + config.InstallPath = //@"D:\Updatetest_hub\Run_app"; + //更新公告网页 + config.UpdateLogUrl = "https://www.baidu.com/"; + //客户端当前版本号 + config.ClientVersion = "1.1.1.1"; + //客户端类型:1.主程序客户端 2.更新组件 + config.AppType = AppType.ClientApp; + //指定应用密钥,用于区分客户端应用 + config.AppSecretKey = "41A54379-C7D6-4920-8768-21A3468572E5"; + //更新组件更新包下载地址 + config.UpdateUrl = $"{baseUrl}/versions/{config.AppType}/{config.ClientVersion}/{config.AppSecretKey}"; + //更新程序exe名称 + config.AppName = "AutoUpdate.Core"; + //主程序客户端exe名称 + config.MainAppName = "AutoUpdate.ClientCore"; + //主程序信息 + var mainVersion = "1.1.1.1"; + //主程序客户端更新包下载地址 + config.MainUpdateUrl = $"{baseUrl}/versions/{AppType.ClientApp}/{mainVersion}/{config.AppSecretKey}"; + return config; + } + + /// + /// 获取Android平台所需要的参数 + /// + /// + private Configinfo GetAndroidConfiginfo() + { + var config = new Configinfo(); + config.InstallPath = System.Threading.Thread.GetDomain().BaseDirectory; + //主程序客户端当前版本号 + config.ClientVersion = VersionTracking.Default.CurrentVersion.ToString(); + config.AppType = AppType.ClientApp; + config.AppSecretKey = "41A54379-C7D6-4920-8768-21A3468572E5"; + //主程序客户端exe名称 + config.MainAppName = "GeneralUpdate.ClientCore"; + //主程序信息 + var mainVersion = "1.1.1.1"; + config.MainUpdateUrl = $"{baseUrl}/versions/{AppType.ClientApp}/{mainVersion}/{config.AppSecretKey}"; + return config; + } + /// /// 让用户决定是否跳过本次更新 /// diff --git a/src/c#/GeneralUpdate.Client/MauiProgram.cs b/src/c#/GeneralUpdate.Client/MauiProgram.cs index 886c0846..09367971 100644 --- a/src/c#/GeneralUpdate.Client/MauiProgram.cs +++ b/src/c#/GeneralUpdate.Client/MauiProgram.cs @@ -11,6 +11,9 @@ public static MauiApp CreateMauiApp() { fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold"); + }).ConfigureEssentials(essentials => + { + essentials.UseVersionTracking(); }); return builder.Build(); diff --git a/src/c#/GeneralUpdate.ClientCore/GeneralClientBootstrap.cs b/src/c#/GeneralUpdate.ClientCore/GeneralClientBootstrap.cs index 227568a3..f8ec4c29 100644 --- a/src/c#/GeneralUpdate.ClientCore/GeneralClientBootstrap.cs +++ b/src/c#/GeneralUpdate.ClientCore/GeneralClientBootstrap.cs @@ -62,7 +62,7 @@ private async Task BaseLaunch() } /// - /// Configure server address . + /// Configure server address (Recommended Windows,Linux,Mac). /// /// Remote server address. /// The updater name does not need to contain an extension. @@ -80,8 +80,8 @@ public GeneralClientBootstrap Config(string url,string appSecretKey, string appN Packet.AppName = appName; string clienVersion = GetFileVersion(Path.Combine(basePath, $"{Packet.AppName}.exe")); Packet.ClientVersion = clienVersion; - Packet.AppType = AppType.ClientApp; - Packet.UpdateUrl = $"{url}/versions/{ Packet.AppType }/{ clienVersion }/{ Packet.AppSecretKey }"; + Packet.AppType = AppType.UpgradeApp; + Packet.UpdateUrl = $"{url}/versions/{AppType.UpgradeApp}/{ clienVersion }/{ Packet.AppSecretKey }"; //main app. string mainAppName = Path.GetFileNameWithoutExtension(Process.GetCurrentProcess().MainModule.FileName); string mainVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString(); @@ -96,7 +96,7 @@ public GeneralClientBootstrap Config(string url,string appSecretKey, string appN } /// - /// Custom Configuration. + /// Custom Configuration (Recommended : All platforms). /// /// /// diff --git a/src/c#/GeneralUpdate.ClientCore/GeneralUpdate.ClientCore.csproj b/src/c#/GeneralUpdate.ClientCore/GeneralUpdate.ClientCore.csproj index e5f375e4..c7a2e0a8 100644 --- a/src/c#/GeneralUpdate.ClientCore/GeneralUpdate.ClientCore.csproj +++ b/src/c#/GeneralUpdate.ClientCore/GeneralUpdate.ClientCore.csproj @@ -4,14 +4,14 @@ netstandard2.0 2.4.7.0 2.4.7.0 - 2.4.7 + 2.8.10 juster.chu Provides functions related to upgrade and update programs. GeneralUpdate.ico GeneralUpdate128.png False False - https://github.com/WELL-E/AutoUpdater + https://github.com/JusterZhu/GeneralUpdate Copyright © 2022 Provides high-performance, low-loss, resume-breakpoint, version-by-version update, binary differential update, incremental update function, configuration file retention update and other features diff --git a/src/c#/GeneralUpdate.Core/Bootstrap/AbstractBootstrap.cs b/src/c#/GeneralUpdate.Core/Bootstrap/AbstractBootstrap.cs index 800da522..6027480b 100644 --- a/src/c#/GeneralUpdate.Core/Bootstrap/AbstractBootstrap.cs +++ b/src/c#/GeneralUpdate.Core/Bootstrap/AbstractBootstrap.cs @@ -52,7 +52,7 @@ public abstract class AbstractBootstrap #region Constructors - protected internal AbstractBootstrap() => this._options = new ConcurrentDictionary(); + protected internal AbstractBootstrap()=> this._options = new ConcurrentDictionary(); #endregion Constructors @@ -115,6 +115,11 @@ protected IStrategy InitStrategy() return _strategy; } + protected string GetPlatform() + { + return _strategy.GetPlatform(); + } + protected IStrategy ExcuteStrategy() { if(_strategy != null) _strategy.Excute(); diff --git a/src/c#/GeneralUpdate.Core/Domain/DO/OSSDownloadDO.cs b/src/c#/GeneralUpdate.Core/Domain/DO/OSSDownloadDO.cs new file mode 100644 index 00000000..880ae8da --- /dev/null +++ b/src/c#/GeneralUpdate.Core/Domain/DO/OSSDownloadDO.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace GeneralUpdate.Core.Domain.DO +{ + public class OSSDownloadDO + { + public string Path { get; set; } + + public string Url { get; set; } + + public string Name { get; set; } + } +} diff --git a/src/c#/GeneralUpdate.Core/Domain/DO/VersionConfigDO.cs b/src/c#/GeneralUpdate.Core/Domain/DO/VersionConfigDO.cs new file mode 100644 index 00000000..4b08d61e --- /dev/null +++ b/src/c#/GeneralUpdate.Core/Domain/DO/VersionConfigDO.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace GeneralUpdate.Core.Domain.DO +{ + public class VersionConfigDO + { + public string Url { get; set; } + + public string MD5 { get; set; } + + public string PacketName { get; set; } + + public string Version { get; set; } + } +} diff --git a/src/c#/GeneralUpdate.Core/Domain/DO/VersionDO.cs b/src/c#/GeneralUpdate.Core/Domain/DO/VersionDO.cs deleted file mode 100644 index ae347832..00000000 --- a/src/c#/GeneralUpdate.Core/Domain/DO/VersionDO.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace GeneralUpdate.Core.Domain.DO -{ - internal class VersionDO - { - } -} diff --git a/src/c#/GeneralUpdate.Core/Download/DownloadOSS.cs b/src/c#/GeneralUpdate.Core/Download/DownloadOSS.cs new file mode 100644 index 00000000..9a01d88a --- /dev/null +++ b/src/c#/GeneralUpdate.Core/Download/DownloadOSS.cs @@ -0,0 +1,25 @@ +using GeneralUpdate.Core.CustomAwaiter; +using GeneralUpdate.Core.Domain.DO; +using System; +using System.Collections.Generic; +using System.Text; + +namespace GeneralUpdate.Core.Download +{ + public class DownloadOSS : AbstractTask + { + private string _url, _name, _targetPath; + + public DownloadOSS(string url,string name,string targetPath) + { + _url = url; + _name = name; + _targetPath = targetPath; + } + + public void Dowload() + { + DownloadFileRange(_name,_url, _targetPath); + } + } +} diff --git a/src/c#/GeneralUpdate.Core/Exceptions/CustomArgs/ExceptionArgs.cs b/src/c#/GeneralUpdate.Core/Exceptions/CustomArgs/ExceptionArgs.cs new file mode 100644 index 00000000..45807e24 --- /dev/null +++ b/src/c#/GeneralUpdate.Core/Exceptions/CustomArgs/ExceptionArgs.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace GeneralUpdate.Core.Exceptions.CustomArgs +{ + [Serializable] + public abstract class ExceptionArgs + { + public virtual string Message { get { return String.Empty; } } + } +} diff --git a/src/c#/GeneralUpdate.Core/Exceptions/CustomArgs/PatchDirtyExceptionArgs.cs b/src/c#/GeneralUpdate.Core/Exceptions/CustomArgs/PatchDirtyExceptionArgs.cs new file mode 100644 index 00000000..b3cd5bc3 --- /dev/null +++ b/src/c#/GeneralUpdate.Core/Exceptions/CustomArgs/PatchDirtyExceptionArgs.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace GeneralUpdate.Core.Exceptions.CustomArgs +{ + [Serializable] + public sealed class PatchDirtyExceptionArgs : ExceptionArgs + { + private readonly String _patchPath; + + public PatchDirtyExceptionArgs(String patchPath) { _patchPath = patchPath; } + + public String PatchPath { get { return _patchPath; } } + + public override string Message + { + get + { + return (_patchPath == null) ? base.Message : $"Patch file path {_patchPath}"; + } + } + } +} diff --git a/src/c#/GeneralUpdate.Core/Exceptions/CustomException/GeneralUpdateException.cs b/src/c#/GeneralUpdate.Core/Exceptions/CustomException/GeneralUpdateException.cs new file mode 100644 index 00000000..2e7cb7a2 --- /dev/null +++ b/src/c#/GeneralUpdate.Core/Exceptions/CustomException/GeneralUpdateException.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.Runtime.Serialization; +using System.Security.Permissions; +using System.Text; + +namespace GeneralUpdate.Core.Exceptions.CustomException +{ + /// + /// Exception of GeneralUpdate framework. + /// + [Serializable] + public sealed class GeneralUpdateException : Exception, ISerializable + where TExceptionArgs : Exception + { + private const String c_args = "Args"; + private readonly TExceptionArgs m_args; + + public TExceptionArgs Args { get { return m_args; } } + + public GeneralUpdateException(String message = null, Exception innerException = null) : this(null, message, innerException) { } + + public GeneralUpdateException(TExceptionArgs args, String message = null, Exception innerException = null) : base(message, innerException) => m_args = args; + + [SecurityPermission(SecurityAction.LinkDemand,Flags =SecurityPermissionFlag.SerializationFormatter)] + private GeneralUpdateException(SerializationInfo info, StreamingContext context) : base(info, context) => m_args = (TExceptionArgs)info.GetValue(c_args,typeof(TExceptionArgs)); + + [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)] + public override void GetObjectData(SerializationInfo info, StreamingContext context) + { + info.AddValue(c_args, typeof(TExceptionArgs)); + base.GetObjectData(info, context); + } + + public override string Message + { + get { + String baseMsg = base.Message; + return (m_args == null)? baseMsg : $"{baseMsg}({m_args.Message})"; + } + } + + public override bool Equals(object obj) + { + GeneralUpdateException other = obj as GeneralUpdateException; + if (other == null) return false; + return Object.Equals(m_args,other.m_args) && base.Equals(obj); + } + + public override int GetHashCode()=> base.GetHashCode(); + } +} diff --git a/src/c#/GeneralUpdate.Core/Exceptions/ThrowHelper.cs b/src/c#/GeneralUpdate.Core/Exceptions/ThrowHelper.cs new file mode 100644 index 00000000..7dd53ca8 --- /dev/null +++ b/src/c#/GeneralUpdate.Core/Exceptions/ThrowHelper.cs @@ -0,0 +1,507 @@ +using System; +using System.Diagnostics.Contracts; +using System.Runtime.Serialization; + +namespace GeneralUpdate.Core.Exceptions +{ + [Pure] + public static class @ThrowHelper + { + //internal static void ThrowArgumentOutOfRangeException() + //{ + // ThrowArgumentOutOfRangeException(ExceptionArgument.index, ExceptionResource.ArgumentOutOfRange_Index); + //} + + //internal static void ThrowWrongKeyTypeArgumentException(object key, Type targetType) + //{ + // throw new ArgumentException(Environment.GetResourceString("Arg_WrongType", key, targetType), "key"); + + //} + + //internal static void ThrowWrongValueTypeArgumentException(object value, Type targetType) + //{ + // throw new ArgumentException(Environment.GetResourceString("Arg_WrongType", value, targetType), "value"); + //} + + internal static void ThrowKeyNotFoundException() + { + throw new System.Collections.Generic.KeyNotFoundException(); + } + + //internal static void ThrowArgumentException(ExceptionResource resource) + //{ + // throw new ArgumentException(Environment.GetResourceString(GetResourceName(resource))); + //} + + //internal static void ThrowArgumentException(ExceptionResource resource, ExceptionArgument argument) + //{ + // throw new ArgumentException(Environment.GetResourceString(GetResourceName(resource)), GetArgumentName(argument)); + //} + + internal static void ThrowArgumentNullException(ExceptionArgument argument) + { + throw new ArgumentNullException(GetArgumentName(argument)); + } + + internal static void ThrowArgumentOutOfRangeException(ExceptionArgument argument) + { + throw new ArgumentOutOfRangeException(GetArgumentName(argument)); + } + + //internal static void ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource) + //{ + + // if (CompatibilitySwitches.IsAppEarlierThanWindowsPhone8) + // { + // // Dev11 474369 quirk: Mango had an empty message string: + // throw new ArgumentOutOfRangeException(GetArgumentName(argument), String.Empty); + // } + // else + // { + // throw new ArgumentOutOfRangeException(GetArgumentName(argument), + // Environment.GetResourceString(GetResourceName(resource))); + // } + //} + + //internal static void ThrowInvalidOperationException(ExceptionResource resource) + //{ + // throw new InvalidOperationException(Environment.GetResourceString(GetResourceName(resource))); + //} + + //internal static void ThrowSerializationException(ExceptionResource resource) + //{ + // throw new SerializationException(Environment.GetResourceString(GetResourceName(resource))); + //} + + //internal static void ThrowSecurityException(ExceptionResource resource) + //{ + // throw new System.Security.SecurityException(Environment.GetResourceString(GetResourceName(resource))); + //} + + //internal static void ThrowNotSupportedException(ExceptionResource resource) + //{ + // throw new NotSupportedException(Environment.GetResourceString(GetResourceName(resource))); + //} + + //internal static void ThrowUnauthorizedAccessException(ExceptionResource resource) + //{ + // throw new UnauthorizedAccessException(Environment.GetResourceString(GetResourceName(resource))); + //} + + //internal static void ThrowObjectDisposedException(string objectName, ExceptionResource resource) + //{ + // throw new ObjectDisposedException(objectName, Environment.GetResourceString(GetResourceName(resource))); + //} + + // Allow nulls for reference types and Nullable, but not for value types. + internal static void IfNullAndNullsAreIllegalThenThrow(object value, ExceptionArgument argName) + { + // Note that default(T) is not equal to null for value types except when T is Nullable. + if (value == null && !(default(T) == null)) + ThrowHelper.ThrowArgumentNullException(argName); + } + + // + // This function will convert an ExceptionArgument enum value to the argument name string. + // + internal static string GetArgumentName(ExceptionArgument argument) + { + string argumentName = null; + + switch (argument) + { + case ExceptionArgument.array: + argumentName = "array"; + break; + + case ExceptionArgument.arrayIndex: + argumentName = "arrayIndex"; + break; + + case ExceptionArgument.capacity: + argumentName = "capacity"; + break; + + case ExceptionArgument.collection: + argumentName = "collection"; + break; + + case ExceptionArgument.list: + argumentName = "list"; + break; + + case ExceptionArgument.converter: + argumentName = "converter"; + break; + + case ExceptionArgument.count: + argumentName = "count"; + break; + + case ExceptionArgument.dictionary: + argumentName = "dictionary"; + break; + + case ExceptionArgument.dictionaryCreationThreshold: + argumentName = "dictionaryCreationThreshold"; + break; + + case ExceptionArgument.index: + argumentName = "index"; + break; + + case ExceptionArgument.info: + argumentName = "info"; + break; + + case ExceptionArgument.key: + argumentName = "key"; + break; + + case ExceptionArgument.match: + argumentName = "match"; + break; + + case ExceptionArgument.obj: + argumentName = "obj"; + break; + + case ExceptionArgument.queue: + argumentName = "queue"; + break; + + case ExceptionArgument.stack: + argumentName = "stack"; + break; + + case ExceptionArgument.startIndex: + argumentName = "startIndex"; + break; + + case ExceptionArgument.value: + argumentName = "value"; + break; + + case ExceptionArgument.name: + argumentName = "name"; + break; + + case ExceptionArgument.mode: + argumentName = "mode"; + break; + + case ExceptionArgument.item: + argumentName = "item"; + break; + + case ExceptionArgument.options: + argumentName = "options"; + break; + + case ExceptionArgument.view: + argumentName = "view"; + break; + + case ExceptionArgument.sourceBytesToCopy: + argumentName = "sourceBytesToCopy"; + break; + + default: + Contract.Assert(false, "The enum value is not defined, please checked ExceptionArgumentName Enum."); + return string.Empty; + } + + return argumentName; + } + + // + // This function will convert an ExceptionResource enum value to the resource string. + // + internal static string GetResourceName(ExceptionResource resource) + { + string resourceName = null; + + switch (resource) + { + case ExceptionResource.Argument_ImplementIComparable: + resourceName = "Argument_ImplementIComparable"; + break; + + case ExceptionResource.Argument_AddingDuplicate: + resourceName = "Argument_AddingDuplicate"; + break; + + case ExceptionResource.ArgumentOutOfRange_BiggerThanCollection: + resourceName = "ArgumentOutOfRange_BiggerThanCollection"; + break; + + case ExceptionResource.ArgumentOutOfRange_Count: + resourceName = "ArgumentOutOfRange_Count"; + break; + + case ExceptionResource.ArgumentOutOfRange_Index: + resourceName = "ArgumentOutOfRange_Index"; + break; + + case ExceptionResource.ArgumentOutOfRange_InvalidThreshold: + resourceName = "ArgumentOutOfRange_InvalidThreshold"; + break; + + case ExceptionResource.ArgumentOutOfRange_ListInsert: + resourceName = "ArgumentOutOfRange_ListInsert"; + break; + + case ExceptionResource.ArgumentOutOfRange_NeedNonNegNum: + resourceName = "ArgumentOutOfRange_NeedNonNegNum"; + break; + + case ExceptionResource.ArgumentOutOfRange_SmallCapacity: + resourceName = "ArgumentOutOfRange_SmallCapacity"; + break; + + case ExceptionResource.Arg_ArrayPlusOffTooSmall: + resourceName = "Arg_ArrayPlusOffTooSmall"; + break; + + case ExceptionResource.Arg_RankMultiDimNotSupported: + resourceName = "Arg_RankMultiDimNotSupported"; + break; + + case ExceptionResource.Arg_NonZeroLowerBound: + resourceName = "Arg_NonZeroLowerBound"; + break; + + case ExceptionResource.Argument_InvalidArrayType: + resourceName = "Argument_InvalidArrayType"; + break; + + case ExceptionResource.Argument_InvalidOffLen: + resourceName = "Argument_InvalidOffLen"; + break; + + case ExceptionResource.Argument_ItemNotExist: + resourceName = "Argument_ItemNotExist"; + break; + + case ExceptionResource.InvalidOperation_CannotRemoveFromStackOrQueue: + resourceName = "InvalidOperation_CannotRemoveFromStackOrQueue"; + break; + + case ExceptionResource.InvalidOperation_EmptyQueue: + resourceName = "InvalidOperation_EmptyQueue"; + break; + + case ExceptionResource.InvalidOperation_EnumOpCantHappen: + resourceName = "InvalidOperation_EnumOpCantHappen"; + break; + + case ExceptionResource.InvalidOperation_EnumFailedVersion: + resourceName = "InvalidOperation_EnumFailedVersion"; + break; + + case ExceptionResource.InvalidOperation_EmptyStack: + resourceName = "InvalidOperation_EmptyStack"; + break; + + case ExceptionResource.InvalidOperation_EnumNotStarted: + resourceName = "InvalidOperation_EnumNotStarted"; + break; + + case ExceptionResource.InvalidOperation_EnumEnded: + resourceName = "InvalidOperation_EnumEnded"; + break; + + case ExceptionResource.NotSupported_KeyCollectionSet: + resourceName = "NotSupported_KeyCollectionSet"; + break; + + case ExceptionResource.NotSupported_ReadOnlyCollection: + resourceName = "NotSupported_ReadOnlyCollection"; + break; + + case ExceptionResource.NotSupported_ValueCollectionSet: + resourceName = "NotSupported_ValueCollectionSet"; + break; + + + case ExceptionResource.NotSupported_SortedListNestedWrite: + resourceName = "NotSupported_SortedListNestedWrite"; + break; + + + case ExceptionResource.Serialization_InvalidOnDeser: + resourceName = "Serialization_InvalidOnDeser"; + break; + + case ExceptionResource.Serialization_MissingKeys: + resourceName = "Serialization_MissingKeys"; + break; + + case ExceptionResource.Serialization_NullKey: + resourceName = "Serialization_NullKey"; + break; + + case ExceptionResource.Argument_InvalidType: + resourceName = "Argument_InvalidType"; + break; + + case ExceptionResource.Argument_InvalidArgumentForComparison: + resourceName = "Argument_InvalidArgumentForComparison"; + break; + + case ExceptionResource.InvalidOperation_NoValue: + resourceName = "InvalidOperation_NoValue"; + break; + + case ExceptionResource.InvalidOperation_RegRemoveSubKey: + resourceName = "InvalidOperation_RegRemoveSubKey"; + break; + + case ExceptionResource.Arg_RegSubKeyAbsent: + resourceName = "Arg_RegSubKeyAbsent"; + break; + + case ExceptionResource.Arg_RegSubKeyValueAbsent: + resourceName = "Arg_RegSubKeyValueAbsent"; + break; + + case ExceptionResource.Arg_RegKeyDelHive: + resourceName = "Arg_RegKeyDelHive"; + break; + + case ExceptionResource.Security_RegistryPermission: + resourceName = "Security_RegistryPermission"; + break; + + case ExceptionResource.Arg_RegSetStrArrNull: + resourceName = "Arg_RegSetStrArrNull"; + break; + + case ExceptionResource.Arg_RegSetMismatchedKind: + resourceName = "Arg_RegSetMismatchedKind"; + break; + + case ExceptionResource.UnauthorizedAccess_RegistryNoWrite: + resourceName = "UnauthorizedAccess_RegistryNoWrite"; + break; + + case ExceptionResource.ObjectDisposed_RegKeyClosed: + resourceName = "ObjectDisposed_RegKeyClosed"; + break; + + case ExceptionResource.Arg_RegKeyStrLenBug: + resourceName = "Arg_RegKeyStrLenBug"; + break; + + case ExceptionResource.Argument_InvalidRegistryKeyPermissionCheck: + resourceName = "Argument_InvalidRegistryKeyPermissionCheck"; + break; + + case ExceptionResource.NotSupported_InComparableType: + resourceName = "NotSupported_InComparableType"; + break; + + case ExceptionResource.Argument_InvalidRegistryOptionsCheck: + resourceName = "Argument_InvalidRegistryOptionsCheck"; + break; + + case ExceptionResource.Argument_InvalidRegistryViewCheck: + resourceName = "Argument_InvalidRegistryViewCheck"; + break; + + default: + Contract.Assert(false, "The enum value is not defined, please checked ExceptionArgumentName Enum."); + return string.Empty; + } + + return resourceName; + } + + } + + // + // The convention for this enum is using the argument name as the enum name + // + internal enum ExceptionArgument + { + obj, + dictionary, + dictionaryCreationThreshold, + array, + info, + key, + collection, + list, + match, + converter, + queue, + stack, + capacity, + index, + startIndex, + value, + count, + arrayIndex, + name, + mode, + item, + options, + view, + sourceBytesToCopy, + } + + // + // The convention for this enum is using the resource name as the enum name + // + internal enum ExceptionResource + { + Argument_ImplementIComparable, + Argument_InvalidType, + Argument_InvalidArgumentForComparison, + Argument_InvalidRegistryKeyPermissionCheck, + ArgumentOutOfRange_NeedNonNegNum, + + Arg_ArrayPlusOffTooSmall, + Arg_NonZeroLowerBound, + Arg_RankMultiDimNotSupported, + Arg_RegKeyDelHive, + Arg_RegKeyStrLenBug, + Arg_RegSetStrArrNull, + Arg_RegSetMismatchedKind, + Arg_RegSubKeyAbsent, + Arg_RegSubKeyValueAbsent, + + Argument_AddingDuplicate, + Serialization_InvalidOnDeser, + Serialization_MissingKeys, + Serialization_NullKey, + Argument_InvalidArrayType, + NotSupported_KeyCollectionSet, + NotSupported_ValueCollectionSet, + ArgumentOutOfRange_SmallCapacity, + ArgumentOutOfRange_Index, + Argument_InvalidOffLen, + Argument_ItemNotExist, + ArgumentOutOfRange_Count, + ArgumentOutOfRange_InvalidThreshold, + ArgumentOutOfRange_ListInsert, + NotSupported_ReadOnlyCollection, + InvalidOperation_CannotRemoveFromStackOrQueue, + InvalidOperation_EmptyQueue, + InvalidOperation_EnumOpCantHappen, + InvalidOperation_EnumFailedVersion, + InvalidOperation_EmptyStack, + ArgumentOutOfRange_BiggerThanCollection, + InvalidOperation_EnumNotStarted, + InvalidOperation_EnumEnded, + NotSupported_SortedListNestedWrite, + InvalidOperation_NoValue, + InvalidOperation_RegRemoveSubKey, + Security_RegistryPermission, + UnauthorizedAccess_RegistryNoWrite, + ObjectDisposed_RegKeyClosed, + NotSupported_InComparableType, + Argument_InvalidRegistryOptionsCheck, + Argument_InvalidRegistryViewCheck + } +} \ No newline at end of file diff --git a/src/c#/GeneralUpdate.Core/GeneralUpdate.Core.csproj b/src/c#/GeneralUpdate.Core/GeneralUpdate.Core.csproj index 6004f709..07bdb7bc 100644 --- a/src/c#/GeneralUpdate.Core/GeneralUpdate.Core.csproj +++ b/src/c#/GeneralUpdate.Core/GeneralUpdate.Core.csproj @@ -3,17 +3,17 @@ netstandard2.0 Library $(AssemblyName) - 4.10.13 + 4.11.20 juster.zhu juster.zhu false GeneralUpdate.ico - Snipaste_128.png + GeneralUpdate128.png False Copyright © 2022 This section describes how to upgrade client applications. Provides high-performance, low-loss, resume-breakpoint, version-by-version update, binary differential update, incremental update function, configuration file retention update and other features. - https://github.com/WELL-E/AutoUpdater + https://github.com/JusterZhu/GeneralUpdate GeneralUpdate.Core GeneralUpdate.Core @@ -38,6 +38,12 @@ + + + True + \ + + diff --git a/src/c#/GeneralUpdate.Core/OSS/CustomOSS.cs b/src/c#/GeneralUpdate.Core/OSS/CustomOSS.cs new file mode 100644 index 00000000..f1d1e354 --- /dev/null +++ b/src/c#/GeneralUpdate.Core/OSS/CustomOSS.cs @@ -0,0 +1,60 @@ +using GeneralUpdate.Core.Domain.Entity; +using GeneralUpdate.Core.Download; +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading.Tasks; + +namespace GeneralUpdate.Core.OSS +{ + //public class CustomOSS : IOSS + //{ + // private const string Format = ".zip"; + // private const string TempPath = ".zip"; + // private const int DownloadTimeOut = 60; + // private string _targetPath; + + // public CustomOSS() + // { + // _targetPath = + // } + + // public void GetVersionInfomation(string url) + // { + + // } + + // public void GetVersions(List versions) + // { + + // } + + // private async Task Download(string url) + // { + // bool isCompleted = false; + // Exception exception = null; + // var downloadTask = new DownloadOSS(url, name); + // downloadTask.com + // await downloadTask.Launch0(); + // //var manager = new DownloadManager(TempPath, Format, DownloadTimeOut); + // //manager.MutiAllDownloadCompleted += (s,e) => + // //{ + // // isCompleted = e.IsAllDownloadCompleted; + // //} ; + // //manager.MutiDownloadError += (s, e) => + // //{ + // // exception = e.Exception; + // //}; + // //manager.Add(new DownloadTask(manager, new VersionInfo(0,null, name, null, url))); + // //manager.LaunchTaskAsync(); + // if (isCompleted) + // { + // return Task.FromResult(""); + // } + // else + // { + // throw exception; + // } + // } + //} +} diff --git a/src/c#/GeneralUpdate.Core/OSS/GeneralUpdateOSS.cs b/src/c#/GeneralUpdate.Core/OSS/GeneralUpdateOSS.cs new file mode 100644 index 00000000..6958adc2 --- /dev/null +++ b/src/c#/GeneralUpdate.Core/OSS/GeneralUpdateOSS.cs @@ -0,0 +1,48 @@ +using GeneralUpdate.Core.Domain.DO; +using GeneralUpdate.Core.Domain.Enum; +using GeneralUpdate.Core.OSS.Strategys; +using GeneralUpdate.Core.OSS.Strategys.PlatformWindows; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; + +namespace GeneralUpdate.Core.OSS +{ + public sealed class GeneralUpdateOSS + { + //public static async Task Start(string url,string platform = PlatformType.Windows) where T : IOSS, new() + //{ + // IStrategy strategy = null; + // string targetPath = ""; + // var oss = new T(); + // oss.SetParmeter(url, targetPath); + // await oss.Download(); + // if (File.Exists(targetPath)) throw new Exception($"The file was not found : {targetPath}!"); + // string configContent = File.ReadAllText(targetPath); + // var configDO = JsonConvert.DeserializeObject>(configContent); + // foreach (var config in configDO) + // { + // oss.SetParmeter(config.Url, targetPath); + // await oss.Download(); + // } + // switch (platform) + // { + // case PlatformType.Windows: + // strategy = new WindowsStrategy(); + // break; + // case PlatformType.Linux: + // break; + // case PlatformType.Mac: + // break; + // case PlatformType.Android: + // break; + // case PlatformType.iOS: + // break; + // } + // strategy.Excute(); + // strategy.StartApp(""); + //} + } +} diff --git a/src/c#/GeneralUpdate.Core/OSS/IOSS.cs b/src/c#/GeneralUpdate.Core/OSS/IOSS.cs new file mode 100644 index 00000000..10992dd8 --- /dev/null +++ b/src/c#/GeneralUpdate.Core/OSS/IOSS.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading.Tasks; + +namespace GeneralUpdate.Core.OSS +{ + public interface IOSS + { + void SetParmeter(string url,string targetPath); + + Task Download(); + } +} diff --git a/src/c#/GeneralUpdate.Core/OSS/Strategys/IStrategy.cs b/src/c#/GeneralUpdate.Core/OSS/Strategys/IStrategy.cs new file mode 100644 index 00000000..b5e2c3bd --- /dev/null +++ b/src/c#/GeneralUpdate.Core/OSS/Strategys/IStrategy.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace GeneralUpdate.Core.OSS.Strategys +{ + public interface IStrategy + { + /// + /// Execution strategy. + /// + void Excute(); + + /// + /// Create a policy. + /// + /// Abstraction for updating package information. + void Create(); + + /// + /// After the update is complete. + /// + /// + /// + bool StartApp(string appName); + + /// + /// Get the platform for the current strategy. + /// + /// + string GetPlatform(); + } +} diff --git a/src/c#/GeneralUpdate.Core/OSS/Strategys/PlatformWindows/WindowsStrategy.cs b/src/c#/GeneralUpdate.Core/OSS/Strategys/PlatformWindows/WindowsStrategy.cs new file mode 100644 index 00000000..2bd282b1 --- /dev/null +++ b/src/c#/GeneralUpdate.Core/OSS/Strategys/PlatformWindows/WindowsStrategy.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace GeneralUpdate.Core.OSS.Strategys.PlatformWindows +{ + public class WindowsStrategy// : IStrategy + { + public void Create() + { + throw new NotImplementedException(); + } + + public void Excute() + { + throw new NotImplementedException(); + } + + public string GetPlatform() + { + throw new NotImplementedException(); + } + + public bool StartApp(string appName, int appType) + { + throw new NotImplementedException(); + } + } +} diff --git a/src/c#/GeneralUpdate.Core/Pipelines/Middleware/ZipMiddleware.cs b/src/c#/GeneralUpdate.Core/Pipelines/Middleware/ZipMiddleware.cs index ad23d4bb..f96a2178 100644 --- a/src/c#/GeneralUpdate.Core/Pipelines/Middleware/ZipMiddleware.cs +++ b/src/c#/GeneralUpdate.Core/Pipelines/Middleware/ZipMiddleware.cs @@ -20,7 +20,7 @@ public async Task InvokeAsync(BaseContext context, MiddlewareStack stack) bool isUnzip = UnZip(context); if (!isUnzip) throw exception = new Exception($"Unzip file failed , Version-{ version.Version } MD5-{ version.MD5 } !"); - await ConfigFactory.Instance.Scan(context.SourcePath, context.TargetPath); + //await ConfigFactory.Instance.Scan(context.SourcePath, context.TargetPath); var node = stack.Pop(); if (node != null) await node.Next.Invoke(context, stack); } diff --git a/src/c#/GeneralUpdate.Core/Strategys/PlatformWindows/WindowsStrategy.cs b/src/c#/GeneralUpdate.Core/Strategys/PlatformWindows/WindowsStrategy.cs index 46452ec5..4415f25d 100644 --- a/src/c#/GeneralUpdate.Core/Strategys/PlatformWindows/WindowsStrategy.cs +++ b/src/c#/GeneralUpdate.Core/Strategys/PlatformWindows/WindowsStrategy.cs @@ -45,9 +45,9 @@ public override void Excute() var updateVersions = Packet.UpdateVersions.OrderBy(x => x.PubTime).ToList(); if (updateVersions != null && updateVersions.Count > 0) { - var patchPath = FileUtil.GetTempDirectory(PATCHS); foreach (var version in updateVersions) { + var patchPath = FileUtil.GetTempDirectory(PATCHS); 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(). diff --git a/src/c#/GeneralUpdate.Differential/GeneralUpdate.Differential.csproj b/src/c#/GeneralUpdate.Differential/GeneralUpdate.Differential.csproj index 540ac935..24aa83a8 100644 --- a/src/c#/GeneralUpdate.Differential/GeneralUpdate.Differential.csproj +++ b/src/c#/GeneralUpdate.Differential/GeneralUpdate.Differential.csproj @@ -3,11 +3,12 @@ netstandard2.0 GeneralUpdate.ico - Snipaste_128.png + GeneralUpdate128.png False - https://github.com/WELL-E/AutoUpdater + https://github.com/JusterZhu/GeneralUpdate The binary differential update function is provided, but the configuration file update function is reserved. juster.zhu + 1.3.1 @@ -36,6 +37,13 @@ + + + True + \ + + + diff --git a/src/c#/GeneralUpdate.PacketTool/GeneralUpdate.PacketTool.csproj b/src/c#/GeneralUpdate.PacketTool/GeneralUpdate.PacketTool.csproj index cdc79b06..a2825341 100644 --- a/src/c#/GeneralUpdate.PacketTool/GeneralUpdate.PacketTool.csproj +++ b/src/c#/GeneralUpdate.PacketTool/GeneralUpdate.PacketTool.csproj @@ -19,8 +19,8 @@ 8672523b-4bf1-4ed3-b58a-e946dd6e27b9 - 1.0 - 1 + 2.1.5 + 2 14.2 14.0 @@ -28,8 +28,17 @@ 10.0.17763.0 10.0.17763.0 6.5 + 2.1.5 + + + + + true + 38B18B6B9F9B9755BB79B6AAE2AC27DD67E6B6CE + + + $(RuntimeIdentifierOverride) - diff --git a/src/c#/GeneralUpdate.PacketTool/ViewModels/MainViewModel.cs b/src/c#/GeneralUpdate.PacketTool/ViewModels/MainViewModel.cs index 1c8848be..19bb274b 100644 --- a/src/c#/GeneralUpdate.PacketTool/ViewModels/MainViewModel.cs +++ b/src/c#/GeneralUpdate.PacketTool/ViewModels/MainViewModel.cs @@ -1,6 +1,7 @@ using CommunityToolkit.Mvvm.Input; using GeneralUpdate.AspNetCore.DTO; using GeneralUpdate.Core.Domain.Enum; +using GeneralUpdate.Core.Utils; using GeneralUpdate.Differential; using GeneralUpdate.Infrastructure.DataServices.Pick; using GeneralUpdate.Infrastructure.MVVM; @@ -178,8 +179,6 @@ private async Task BuildPacketCallback() { await DifferentialCore.Instance.Clean(SourcePath, TargetPath, PatchPath, (sender, args) =>{}, String2OperationType(CurrentFormat),String2Encoding(CurrentEncoding), PacketName); - - //await DifferentialCore.Instance.Drity(SourcePath,PatchPath); if (IsPublish) { var packetPath = Path.Combine(TargetPath,$"{PacketName}{CurrentFormat}"); @@ -188,7 +187,8 @@ await DifferentialCore.Instance.Clean(SourcePath, TargetPath, PatchPath, (sender await Shell.Current.DisplayAlert("Build options", $"The package was not found in the following path {packetPath} !", "cancel"); return; } - await _mainService.PostUpgradPakcet(Url,packetPath, String2AppType(CurrnetAppType), CurrentVersion,CurrentClientAppKey,"", async (resp) => + var md5 = FileUtil.GetFileMD5(packetPath); + await _mainService.PostUpgradPakcet(Url,packetPath, String2AppType(CurrnetAppType), CurrentVersion,CurrentClientAppKey, md5, async (resp) => { if (resp == null) { diff --git a/src/c#/GeneralUpdate.Upgrad/Program.cs b/src/c#/GeneralUpdate.Upgrad/Program.cs index d1284f5e..2fc61c9f 100644 --- a/src/c#/GeneralUpdate.Upgrad/Program.cs +++ b/src/c#/GeneralUpdate.Upgrad/Program.cs @@ -15,7 +15,6 @@ static void Main(string[] args) Thread.Sleep(5000); Task.Run(async () => { - //var arg = "eyJBcHBUeXBlIjoxLCJBcHBOYW1lIjoiR2VuZXJhbFVwZGF0ZS5DbGllbnQiLCJJbnN0YWxsUGF0aCI6IkY6XFxnaXRfcHJvamVjdFxcR2VuZXJhbFVwZGF0ZVxcc3JjXFxjI1xcR2VuZXJhbFVwZGF0ZS5DbGllbnRcXGJpblxcRGVidWdcXG5ldDYuMC13aW5kb3dzMTAuMC4xOTA0MS4wXFx3aW4xMC14NjRcXEFwcFhcXCIsIkN1cnJlbnRWZXJzaW9uIjoiMS4wLjAuMCIsIkxhc3RWZXJzaW9uIjoiOS45LjkuOSIsIkxvZ1VybCI6bnVsbCwiSXNVcGRhdGUiOmZhbHNlLCJDb21wcmVzc0VuY29kaW5nIjo3LCJDb21wcmVzc0Zvcm1hdCI6bnVsbCwiRG93bmxvYWRUaW1lT3V0IjowLCJBcHBTZWNyZXRLZXkiOiJCOEE3RkFERC0zODZDLTQ2QjAtQjI4My1DOUY5NjM0MjBDN0MiLCJVcGRhdGVWZXJzaW9ucyI6W3siUHViVGltZSI6MTY2NDA5NjUyMCwiTmFtZSI6IjE2NjQwODEzMTUiLCJNRDUiOiJkZDc3NmUzYTRmMjAyOGE1ZjYxMTg3ZTIzMDg5ZGRiZCIsIlZlcnNpb24iOiIwLjAuMC4wIiwiVXJsIjoiaHR0cDovLzEyNy4wLjAuMS8xNjY0MDgzMTI2LnppcCIsIklEIjpudWxsfV0sIklEIjpudWxsfQ=="; var bootStrap = new GeneralUpdateBootstrap(); bootStrap.MutiAllDownloadCompleted += OnMutiAllDownloadCompleted; bootStrap.MutiDownloadCompleted += OnMutiDownloadCompleted; diff --git a/src/c#/GeneralUpdate.Zip/GeneralUpdate.Zip.csproj b/src/c#/GeneralUpdate.Zip/GeneralUpdate.Zip.csproj index 921c0c4a..67d3dec2 100644 --- a/src/c#/GeneralUpdate.Zip/GeneralUpdate.Zip.csproj +++ b/src/c#/GeneralUpdate.Zip/GeneralUpdate.Zip.csproj @@ -7,9 +7,9 @@ Decompress the compressed file with progress notification. Copyright © 2022 GeneralUpdate.ico - Snipaste_128.png + GeneralUpdate128.png False - 2.2.0 + 2.3.1 https://github.com/WELL-E/AutoUpdater @@ -26,6 +26,13 @@ + + + True + \ + + + diff --git a/src/c#/TestMD5/UnitTest1.cs b/src/c#/TestMD5/UnitTest1.cs index 648e40ad..857da114 100644 --- a/src/c#/TestMD5/UnitTest1.cs +++ b/src/c#/TestMD5/UnitTest1.cs @@ -9,7 +9,7 @@ public void Test1() { try { - string path = ""; + string path = "F:\temp\target\testpacket.zip"; var md5 = FileUtil.GetFileMD5(path); if (string.IsNullOrWhiteSpace(md5)) {