From 4469f2d4bc0002e3a5fb457f664f178739596812 Mon Sep 17 00:00:00 2001 From: t0815 <10379828+t0815@users.noreply.github.com> Date: Sat, 14 Sep 2024 17:21:37 +0200 Subject: [PATCH] only add new fields during patching, if not already esist --- MyCBZ/App.config | 2 +- MyCBZ/Helper/FactoryDefaults.cs | 36 ++++++++++++++++++++++++++++-- MyCBZ/Properties/AssemblyInfo.cs | 4 ++-- MyCBZ/Win_CBZSettings.Designer.cs | 2 +- MyCBZ/Win_CBZSettings.settings | 2 +- Readme.md | 2 +- Win_CBZ-Setup/Win_CBZ-Setup.vdproj | 8 +++---- 7 files changed, 44 insertions(+), 12 deletions(-) diff --git a/MyCBZ/App.config b/MyCBZ/App.config index 2c0a5321..0d7ba485 100644 --- a/MyCBZ/App.config +++ b/MyCBZ/App.config @@ -153,7 +153,7 @@ - 0.21.162b + 0.21.163b diff --git a/MyCBZ/Helper/FactoryDefaults.cs b/MyCBZ/Helper/FactoryDefaults.cs index bbb56f1c..1d70d53e 100644 --- a/MyCBZ/Helper/FactoryDefaults.cs +++ b/MyCBZ/Helper/FactoryDefaults.cs @@ -350,12 +350,44 @@ public static int PatchUserSettings(int lastVersion) } else { - Win_CBZSettings.Default.CustomMetadataFields.Add(FactoryDefaults.DefaultMetaDataFieldTypes[index]); + bool doAdd = true; + for (userIndex = 0; userIndex < Win_CBZSettings.Default.CustomMetadataFields.Count; userIndex++) + { + string[] parts = Win_CBZSettings.Default.CustomMetadataFields[userIndex].Split('|'); + + if (parts[0].ToLower() == factParts[0].ToLower()) + { + doAdd = false; + break; + } + + } + + if (doAdd) + { + Win_CBZSettings.Default.CustomMetadataFields.Add(FactoryDefaults.DefaultMetaDataFieldTypes[index]); + } } } else { - Win_CBZSettings.Default.CustomMetadataFields.Add(FactoryDefaults.DefaultMetaDataFieldTypes[index]); + bool doAdd = true; + for (userIndex = 0; userIndex < Win_CBZSettings.Default.CustomMetadataFields.Count; userIndex++) + { + string[] parts = Win_CBZSettings.Default.CustomMetadataFields[userIndex].Split('|'); + + if (parts[0].ToLower() == factParts[0].ToLower()) + { + doAdd = false; + break; + } + + } + + if (doAdd) + { + Win_CBZSettings.Default.CustomMetadataFields.Add(FactoryDefaults.DefaultMetaDataFieldTypes[index]); + } } } diff --git a/MyCBZ/Properties/AssemblyInfo.cs b/MyCBZ/Properties/AssemblyInfo.cs index 207360db..540ff307 100644 --- a/MyCBZ/Properties/AssemblyInfo.cs +++ b/MyCBZ/Properties/AssemblyInfo.cs @@ -33,6 +33,6 @@ // Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, // indem Sie "*" wie unten gezeigt eingeben: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.21.162")] -[assembly: AssemblyFileVersion("0.21.162")] +[assembly: AssemblyVersion("0.21.163")] +[assembly: AssemblyFileVersion("0.21.163")] [assembly: NeutralResourcesLanguage("en")] diff --git a/MyCBZ/Win_CBZSettings.Designer.cs b/MyCBZ/Win_CBZSettings.Designer.cs index 926f3b9f..744a63ab 100644 --- a/MyCBZ/Win_CBZSettings.Designer.cs +++ b/MyCBZ/Win_CBZSettings.Designer.cs @@ -37,7 +37,7 @@ public string TempFolderPath { [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("0.21.162b")] + [global::System.Configuration.DefaultSettingValueAttribute("0.21.163b")] public string InstalledVersion { get { return ((string)(this["InstalledVersion"])); diff --git a/MyCBZ/Win_CBZSettings.settings b/MyCBZ/Win_CBZSettings.settings index ea929198..4eb8936c 100644 --- a/MyCBZ/Win_CBZSettings.settings +++ b/MyCBZ/Win_CBZSettings.settings @@ -6,7 +6,7 @@ %APPDATA%\WIN_CBZ\Temp\ - 0.21.162b + 0.21.163b <?xml version="1.0" encoding="utf-16"?> diff --git a/Readme.md b/Readme.md index 8776d519..32c8423f 100644 --- a/Readme.md +++ b/Readme.md @@ -52,7 +52,7 @@ Microsoft Visual Studio [Community] 2022 (64-Bit) ## Latest Release -v0.21.162b released! +v0.21.163b released! >[!IMPORTANT] diff --git a/Win_CBZ-Setup/Win_CBZ-Setup.vdproj b/Win_CBZ-Setup/Win_CBZ-Setup.vdproj index 8db5abc0..0c9e495f 100644 --- a/Win_CBZ-Setup/Win_CBZ-Setup.vdproj +++ b/Win_CBZ-Setup/Win_CBZ-Setup.vdproj @@ -248,15 +248,15 @@ { "Name" = "8:Microsoft Visual Studio" "ProductName" = "8:Win_CBZ" - "ProductCode" = "8:{49C8199A-CE1C-4415-8023-7F9AF6F4A601}" - "PackageCode" = "8:{EB58C305-6518-4CC0-9673-9D4086A446AC}" + "ProductCode" = "8:{6C3F644F-35CB-4BB0-8FEB-AE7CDF504BF8}" + "PackageCode" = "8:{64C2FDE2-E0D2-4048-9F34-F7F80E0CBA65}" "UpgradeCode" = "8:{66FAEF81-1CAE-4971-9E0F-796310EFEA5E}" "AspNetVersion" = "8:4.0.30319.0" "RestartWWWService" = "11:FALSE" "RemovePreviousVersions" = "11:TRUE" "DetectNewerInstalledVersion" = "11:TRUE" "InstallAllUsers" = "11:FALSE" - "ProductVersion" = "8:0.21.162" + "ProductVersion" = "8:0.21.163" "Manufacturer" = "8:Trash_s0Ft" "ARPHELPTELEPHONE" = "8:" "ARPHELPLINK" = "8:" @@ -808,7 +808,7 @@ { "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_1DAB07B3E40248E0B54293E16EE30178" { - "SourcePath" = "8:..\\MyCBZ\\obj\\x64\\Debug\\net8.0-windows7.0\\apphost.exe" + "SourcePath" = "8:..\\MyCBZ\\obj\\x64\\Release\\net8.0-windows7.0\\apphost.exe" "TargetName" = "8:" "Tag" = "8:" "Folder" = "8:_381C2AC7AD384E1488C6014F95032920"