From 0c0b2f7d58f270cb24312b597fea9a69f670b6a3 Mon Sep 17 00:00:00 2001 From: Juster Zhu Date: Mon, 20 Nov 2023 21:30:04 +0800 Subject: [PATCH] Add whether to roll back the configuration --- src/c#/GeneralUpdate.Core/Bootstrap/AbstractBootstrap.cs | 1 + src/c#/GeneralUpdate.Core/Domain/Entity/Packet.cs | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/c#/GeneralUpdate.Core/Bootstrap/AbstractBootstrap.cs b/src/c#/GeneralUpdate.Core/Bootstrap/AbstractBootstrap.cs index 567b8db0..d340d6bf 100644 --- a/src/c#/GeneralUpdate.Core/Bootstrap/AbstractBootstrap.cs +++ b/src/c#/GeneralUpdate.Core/Bootstrap/AbstractBootstrap.cs @@ -63,6 +63,7 @@ public virtual TBootstrap LaunchAsync() Packet.DownloadTimeOut = GetOption(UpdateOption.DownloadTimeOut); Packet.AppName = $"{Packet.AppName ?? GetOption(UpdateOption.MainApp)}{EXECUTABLE_FILE}"; Packet.TempPath = $"{FileUtil.GetTempDirectory(Packet.LastVersion)}{Path.DirectorySeparatorChar}"; + Packet.IsRestore = GetOption(UpdateOption.Restore); var manager = new DownloadManager(Packet.TempPath, Packet.Format, Packet.DownloadTimeOut); manager.MultiAllDownloadCompleted += OnMultiAllDownloadCompleted; manager.MultiDownloadCompleted += OnMultiDownloadCompleted; diff --git a/src/c#/GeneralUpdate.Core/Domain/Entity/Packet.cs b/src/c#/GeneralUpdate.Core/Domain/Entity/Packet.cs index 85b6f039..40f787fc 100644 --- a/src/c#/GeneralUpdate.Core/Domain/Entity/Packet.cs +++ b/src/c#/GeneralUpdate.Core/Domain/Entity/Packet.cs @@ -131,5 +131,10 @@ public Packet(string mainUpdateUrl, int appType, string updateUrl, string appNam /// File formats in the blacklist will skip the update. /// public List BlackFormats { get; set; } + + /// + /// Whether to enable automatic backup during the upgrade. + /// + public bool IsRestore { get; set; } } } \ No newline at end of file