From 17b64015e32959e59e19f14eeba86c6aaddfbe49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=AD=20Climent?= Date: Tue, 10 Sep 2024 16:55:28 +0200 Subject: [PATCH 1/7] make WinGet work again --- .../ExternalLibraries.WindowsPackageManager.Interop.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/WindowsPackageManager.Interop/ExternalLibraries.WindowsPackageManager.Interop.csproj b/src/WindowsPackageManager.Interop/ExternalLibraries.WindowsPackageManager.Interop.csproj index abd9a8e99..22cf6b96f 100644 --- a/src/WindowsPackageManager.Interop/ExternalLibraries.WindowsPackageManager.Interop.csproj +++ b/src/WindowsPackageManager.Interop/ExternalLibraries.WindowsPackageManager.Interop.csproj @@ -29,7 +29,7 @@ - + all runtime; build; native; contentfiles; analyzers From 06d0cd11fc1348b0389d2a642f378df7cfef6fa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=AD=20Climent?= Date: Tue, 10 Sep 2024 16:55:56 +0200 Subject: [PATCH 2/7] Enable trimming and force enable COM --- src/UniGetUI/UniGetUI.csproj | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/UniGetUI/UniGetUI.csproj b/src/UniGetUI/UniGetUI.csproj index 10962676e..5e66fb0a4 100644 --- a/src/UniGetUI/UniGetUI.csproj +++ b/src/UniGetUI/UniGetUI.csproj @@ -30,6 +30,9 @@ true None 10.0.22621.38 + + true + true From b65e1af61b7606d094fe9c270f910c48977e51f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=AD=20Climent?= Date: Tue, 10 Sep 2024 17:53:15 +0200 Subject: [PATCH 3/7] Serializers should work again --- src/UniGetUI.Core.Data/CoreData.cs | 8 ++++++++ src/UniGetUI.Core.IconStore/IconDatabase.cs | 5 ++++- .../Packages/InstallationOptions.cs | 5 +++-- src/UniGetUI/SoftwarePages/PackageBundlesPage.cs | 8 ++++++-- 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/UniGetUI.Core.Data/CoreData.cs b/src/UniGetUI.Core.Data/CoreData.cs index c5e77375d..8f6ac2bd6 100644 --- a/src/UniGetUI.Core.Data/CoreData.cs +++ b/src/UniGetUI.Core.Data/CoreData.cs @@ -1,6 +1,8 @@ using System.Diagnostics; using System.Net; using System.Runtime.InteropServices.JavaScript; +using System.Text.Json; +using System.Text.Json.Serialization.Metadata; using UniGetUI.Core.Logging; namespace UniGetUI.Core.Data @@ -312,5 +314,11 @@ private static string GetNewDataDirectoryOrMoveOld(string old_path, string new_p return new_path; } } + + public static JsonSerializerOptions SerializingOptions = new() + { + TypeInfoResolverChain = { new DefaultJsonTypeInfoResolver() }, + WriteIndented = true, + }; } } diff --git a/src/UniGetUI.Core.IconStore/IconDatabase.cs b/src/UniGetUI.Core.IconStore/IconDatabase.cs index f876f4240..880229e86 100644 --- a/src/UniGetUI.Core.IconStore/IconDatabase.cs +++ b/src/UniGetUI.Core.IconStore/IconDatabase.cs @@ -88,7 +88,10 @@ public async Task LoadIconAndScreenshotsDatabaseAsync() try { - IconScreenshotDatabase_v2 JsonData = JsonSerializer.Deserialize(await File.ReadAllTextAsync(IconsAndScreenshotsFile)); + IconScreenshotDatabase_v2 JsonData = JsonSerializer.Deserialize( + await File.ReadAllTextAsync(IconsAndScreenshotsFile), + CoreData.SerializingOptions + ); if (JsonData.icons_and_screenshots != null) { IconDatabaseData = JsonData.icons_and_screenshots; diff --git a/src/UniGetUI.PackageEngine.PackageManagerClasses/Packages/InstallationOptions.cs b/src/UniGetUI.PackageEngine.PackageManagerClasses/Packages/InstallationOptions.cs index b85e87be2..ac964c2ae 100644 --- a/src/UniGetUI.PackageEngine.PackageManagerClasses/Packages/InstallationOptions.cs +++ b/src/UniGetUI.PackageEngine.PackageManagerClasses/Packages/InstallationOptions.cs @@ -194,7 +194,7 @@ public void SaveToDisk() string fileContents = JsonSerializer.Serialize( AsSerializable(), - new JsonSerializerOptions(){ WriteIndented = true } + CoreData.SerializingOptions ); File.WriteAllText(optionsFile.FullName, fileContents); } @@ -219,7 +219,8 @@ public void LoadFromDisk() } using FileStream inputStream = optionsFile.OpenRead(); - SerializableInstallationOptions_v1? options = JsonSerializer.Deserialize(inputStream); + SerializableInstallationOptions_v1? options = JsonSerializer.Deserialize( + inputStream, CoreData.SerializingOptions); if (options == null) { diff --git a/src/UniGetUI/SoftwarePages/PackageBundlesPage.cs b/src/UniGetUI/SoftwarePages/PackageBundlesPage.cs index cac868480..af06de79e 100644 --- a/src/UniGetUI/SoftwarePages/PackageBundlesPage.cs +++ b/src/UniGetUI/SoftwarePages/PackageBundlesPage.cs @@ -8,6 +8,7 @@ using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; using Microsoft.UI.Xaml.Documents; +using UniGetUI.Core.Data; using UniGetUI.Core.Logging; using UniGetUI.Core.Tools; using UniGetUI.Interface.Enums; @@ -565,7 +566,10 @@ public static async Task CreateBundle(IEnumerable packages, Bu string ExportableData; if (formatType == BundleFormatType.JSON) - ExportableData = JsonSerializer.Serialize(exportable, new JsonSerializerOptions { WriteIndented = true }); + ExportableData = JsonSerializer.Serialize( + exportable, + CoreData.SerializingOptions); + else if (formatType == BundleFormatType.YAML) { YamlDotNet.Serialization.ISerializer serializer = new YamlDotNet.Serialization.SerializerBuilder() @@ -595,7 +599,7 @@ public async Task AddFromBundle(string content, BundleFormatType format) SerializableBundle_v1? DeserializedData; if (format is BundleFormatType.JSON) { - DeserializedData = await Task.Run(() => JsonSerializer.Deserialize(content)); + DeserializedData = await Task.Run(() => JsonSerializer.Deserialize(content, CoreData.SerializingOptions)); } else if (format is BundleFormatType.YAML) { From 56efb3ecf7b09dfbf79b90063986fbe813d33869 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=AD=20Climent?= Date: Wed, 11 Sep 2024 19:18:13 +0200 Subject: [PATCH 4/7] Create config.yml --- .github/ISSUE_TEMPLATE/config.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/config.yml diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 000000000..7c3b81ada --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: 📧 Contact me by email + url: https://marticliment.com/contact + about: Please use only if the issue cannot be posted publicly \ No newline at end of file From 3e9652890df3f6cb0fa3fe5fc1569655db752f45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=AD=20Climent?= Date: Wed, 18 Sep 2024 20:03:08 +0200 Subject: [PATCH 5/7] enabel full trimminf --- src/UniGetUI/UniGetUI.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/src/UniGetUI/UniGetUI.csproj b/src/UniGetUI/UniGetUI.csproj index fe9f01cc0..77e9b1a9e 100644 --- a/src/UniGetUI/UniGetUI.csproj +++ b/src/UniGetUI/UniGetUI.csproj @@ -32,6 +32,7 @@ 10.0.22621.41 true + full true From f6fbef600c85dfde962f13dd41d1ed3e5d1534c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=AD=20Climent?= Date: Wed, 18 Sep 2024 20:09:53 +0200 Subject: [PATCH 6/7] Update .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 9209df225..287510692 100644 --- a/.gitignore +++ b/.gitignore @@ -76,3 +76,4 @@ src/UniGetUI/choco-cli/extensions/chocolatey-visualstudio/ src/UniGetUI/choco-cli/extensions/chocolatey-dotnetfx/ *.user +/src/UniGetUI/Generated Files From 4520b959d6c3383efc48223234cb9b0060d3b9c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=AD=20Climent?= Date: Wed, 18 Sep 2024 20:19:48 +0200 Subject: [PATCH 7/7] Update IgnoredUpdatesDatabase.cs --- .../Packages/Classes/IgnoredUpdatesDatabase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/UniGetUI.PackageEngine.PackageManagerClasses/Packages/Classes/IgnoredUpdatesDatabase.cs b/src/UniGetUI.PackageEngine.PackageManagerClasses/Packages/Classes/IgnoredUpdatesDatabase.cs index b86b96225..e70e00a33 100644 --- a/src/UniGetUI.PackageEngine.PackageManagerClasses/Packages/Classes/IgnoredUpdatesDatabase.cs +++ b/src/UniGetUI.PackageEngine.PackageManagerClasses/Packages/Classes/IgnoredUpdatesDatabase.cs @@ -40,7 +40,7 @@ public static Dictionary GetDatabase() private static void SaveDatabase() { // Serialize and save to disk - string rawContents = JsonSerializer.Serialize(IgnoredPackages, options: new(){ WriteIndented = true }); + string rawContents = JsonSerializer.Serialize(IgnoredPackages, options: CoreData.SerializingOptions); File.WriteAllText(CoreData.IgnoredUpdatesDatabaseFile, rawContents); }