From 71f6d7830d18fe7d653c44f5f691c4ee8034e13b Mon Sep 17 00:00:00 2001 From: slothdpal <16717792+SlothDpal@users.noreply.github.com> Date: Mon, 22 Sep 2025 21:42:13 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BF=D0=B5=D1=80=D0=B5=D0=BD=D0=BE=D1=81=20?= =?UTF-8?q?=D0=BD=D0=B0=D1=81=D1=82=D1=80=D0=BE=D0=B5=D0=BA=20=D0=B8=D0=B7?= =?UTF-8?q?=20=D1=81=D1=82=D0=B0=D1=80=D0=BE=20=D1=81=D0=B1=D0=BE=D1=80?= =?UTF-8?q?=D0=BA=D0=B8=20=D0=B2=20=D0=BD=D0=BE=D0=B2=D1=83=D1=8E=20=D1=87?= =?UTF-8?q?=D0=B5=D1=80=D0=B5=D0=B7=20settings.upgrade?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.config | 3 +++ Form1.cs | 20 +++++++++++++++++++- Process Auto Relaunch.csproj | 5 +---- Properties/AssemblyInfo.cs | 6 +++--- Properties/Settings.Designer.cs | 16 ++++++++++++++-- Properties/Settings.settings | 3 +++ 6 files changed, 43 insertions(+), 10 deletions(-) diff --git a/App.config b/App.config index 379efdc..1da09fe 100644 --- a/App.config +++ b/App.config @@ -47,6 +47,9 @@ True + + True + diff --git a/Form1.cs b/Form1.cs index 1d9b0e8..a29e69d 100644 --- a/Form1.cs +++ b/Form1.cs @@ -15,7 +15,7 @@ using RelaunchProcess; using System.Timers; using System.Threading.Tasks; using System.Runtime.CompilerServices; - +using System.Configuration; namespace Process_Auto_Relaunch { @@ -47,6 +47,24 @@ namespace Process_Auto_Relaunch public Form1() { InitializeComponent(); + if (Settings.Default.upgradeSettings) + { + Debug.WriteLine("Обновление настроек."); + try + { + Settings.Default.Upgrade(); + } + catch (ConfigurationErrorsException ex) + { + Debug.WriteLine($"Ошибка обновления настроек: {ex.Message}"); + Settings.Default.Reset(); + } + finally + { + Settings.Default.upgradeSettings = false; + Settings.Default.Save(); + } + } this.updateLogDelegate = this.UpdateStatus; this.updateLogDelegate += this.SendDiscordMessage; this.updateLogDelegate += this.HistoryLog; diff --git a/Process Auto Relaunch.csproj b/Process Auto Relaunch.csproj index d9789f4..4bd7346 100644 --- a/Process Auto Relaunch.csproj +++ b/Process Auto Relaunch.csproj @@ -82,14 +82,11 @@ true - - False - .\CSharpDiscordWebhook.dll - packages\Newtonsoft.Json.13.0.4\lib\net45\Newtonsoft.Json.dll + diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index a125594..fe55b4e 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -29,7 +29,7 @@ using System.Runtime.InteropServices; // Номер сборки // Редакция // -[assembly: AssemblyVersion("1.6.0.0")] -[assembly: AssemblyFileVersion("1.6.0.0")] +[assembly: AssemblyVersion("1.6.0.21")] +[assembly: AssemblyFileVersion("1.6.0.21")] -[assembly: AssemblyInformationalVersion("1.6.0.0")] \ No newline at end of file +[assembly: AssemblyInformationalVersion("1.6.0.21")] \ No newline at end of file diff --git a/Properties/Settings.Designer.cs b/Properties/Settings.Designer.cs index 7be96f2..b9a3b21 100644 --- a/Properties/Settings.Designer.cs +++ b/Properties/Settings.Designer.cs @@ -1,4 +1,4 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // Этот код создан программой. // Исполняемая версия:4.0.30319.42000 @@ -12,7 +12,7 @@ namespace RelaunchProcess.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.10.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.14.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); @@ -179,5 +179,17 @@ namespace RelaunchProcess.Properties { this["closeFreezeProcess"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool upgradeSettings { + get { + return ((bool)(this["upgradeSettings"])); + } + set { + this["upgradeSettings"] = value; + } + } } } diff --git a/Properties/Settings.settings b/Properties/Settings.settings index aa69502..71525a6 100644 --- a/Properties/Settings.settings +++ b/Properties/Settings.settings @@ -41,5 +41,8 @@ True + + True + \ No newline at end of file