From b98eec54b9018f02fbd7fe598a8cb97b8b2ee85a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=AD=20Climent?= Date: Sun, 27 Apr 2025 15:52:31 +0200 Subject: [PATCH 1/3] Ditch nancy, use ASP.NET Core for background api --- src/UniGetUI.Core.Data/Licenses.cs | 6 +- .../BackgroundApi.cs | 440 ++++++++---------- .../UniGetUI.Interface.BackgroundApi.csproj | 9 +- src/UniGetUI/App.xaml.cs | 71 +-- 4 files changed, 237 insertions(+), 289 deletions(-) diff --git a/src/UniGetUI.Core.Data/Licenses.cs b/src/UniGetUI.Core.Data/Licenses.cs index f705627cad..b8ddcb667f 100644 --- a/src/UniGetUI.Core.Data/Licenses.cs +++ b/src/UniGetUI.Core.Data/Licenses.cs @@ -10,7 +10,7 @@ public static class LicenseData {"Community Toolkit", "MIT"}, {"H.NotifyIcon", "MIT"}, {"Windows App Sdk", "MIT"}, - {"NancyFx", "MIT"}, + //{"NancyFx", "MIT"}, {"PhotoSauce.MagicScaler", "MIT"}, {"YamlDotNet", "MIT"}, {"WinUIEx", "MIT"}, @@ -45,7 +45,7 @@ public static class LicenseData {"Community Toolkit", new Uri("https://github.com/CommunityToolkit/Windows/blob/main/License.md")}, {"H.NotifyIcon", new Uri("https://github.com/HavenDV/H.NotifyIcon/blob/master/LICENSE.md")}, {"Windows App Sdk", new Uri("https://github.com/microsoft/WindowsAppSDK/blob/main/LICENSE")}, - {"NancyFx", new Uri("https://github.com/NancyFx/Nancy/blob/master/license.txt")}, + //{"NancyFx", new Uri("https://github.com/NancyFx/Nancy/blob/master/license.txt")}, {"PhotoSauce.MagicScaler", new Uri("https://github.com/saucecontrol/PhotoSauce/blob/master/license")}, {"YamlDotNet", new Uri("https://github.com/aaubry/YamlDotNet/blob/master/LICENSE.txt") }, {"WinUIEx", new Uri("https://github.com/dotMorten/WinUIEx/blob/main/LICENSE") }, @@ -80,7 +80,7 @@ public static class LicenseData {"Community Toolkit", new Uri("https://github.com/CommunityToolkit/Windows/")}, {"H.NotifyIcon", new Uri("https://github.com/HavenDV/H.NotifyIcon/")}, {"Windows App Sdk", new Uri("https://github.com/microsoft/WindowsAppSDK/")}, - {"NancyFx", new Uri("https://github.com/NancyFx/Nancy/")}, + //{"NancyFx", new Uri("https://github.com/NancyFx/Nancy/")}, {"PhotoSauce.MagicScaler", new Uri("https://github.com/saucecontrol/PhotoSauce/")}, {"YamlDotNet", new Uri("https://github.com/aaubry/YamlDotNet/") }, {"WinUIEx", new Uri("https://github.com/dotMorten/WinUIEx/") }, diff --git a/src/UniGetUI.Interface.BackgroundApi/BackgroundApi.cs b/src/UniGetUI.Interface.BackgroundApi/BackgroundApi.cs index 0c51e8d94a..ed672c37dc 100644 --- a/src/UniGetUI.Interface.BackgroundApi/BackgroundApi.cs +++ b/src/UniGetUI.Interface.BackgroundApi/BackgroundApi.cs @@ -1,7 +1,9 @@ +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.Hosting; using System.Text; -using System.Web; -using Nancy; -using Nancy.Hosting.Self; +using Microsoft.Extensions.DependencyInjection; using UniGetUI.Core.Data; using UniGetUI.Core.IconEngine; using UniGetUI.Core.Logging; @@ -27,317 +29,255 @@ public class BackgroundApiRunner public event EventHandler? OnUpgradeAllForManager; public event EventHandler? OnUpgradePackage; - private bool __running; + private IHost? _host; + private bool _running; public BackgroundApiRunner() { - BackgroundApi.OnOpenWindow += (s, e) => OnOpenWindow?.Invoke(s, e); - BackgroundApi.OnOpenUpdatesPage += (s, e) => OnOpenUpdatesPage?.Invoke(s, e); - BackgroundApi.OnShowSharedPackage += (s, e) => OnShowSharedPackage?.Invoke(s, e); - BackgroundApi.OnUpgradeAll += (s, e) => OnUpgradeAll?.Invoke(s, e); - BackgroundApi.OnUpgradeAllForManager += (s, e) => OnUpgradeAllForManager?.Invoke(s, e); - BackgroundApi.OnUpgradePackage += (s, e) => OnUpgradePackage?.Invoke(s, e); } - public static bool AuthenticateToken(string token) + public static bool AuthenticateToken(string? token) { return token == ApiTokenHolder.Token; } - /// - /// Run the background api and wait for it for being stopped with the Stop() method - /// public async Task Start() { - try - { - - if (Settings.Get("DisableWidgetsApi")) - { - Logger.Warn("Widgets API is disabled"); - return; - } - ApiTokenHolder.Token = CoreTools.RandomString(64); + if (Settings.Get("DisableWidgetsApi")) + { + Logger.Warn("Widgets API is disabled"); + return; + } - __running = true; - NancyHost host; - try - { - host = new NancyHost(new HostConfiguration { RewriteLocalhost = false, }, new Uri("http://localhost:7058/")); - host.Start(); - } - catch - { - host = new NancyHost(new Uri("http://localhost:7058/")); - host.Start(); - } + ApiTokenHolder.Token = CoreTools.RandomString(64); + Settings.SetValue("CurrentSessionToken", ApiTokenHolder.Token); + Logger.Info("Randomly-generated background API auth token: " + ApiTokenHolder.Token); - Settings.SetValue("CurrentSessionToken", ApiTokenHolder.Token); - Logger.Info("Randomly-generated background API auth token for the current session: " + ApiTokenHolder.Token); + _running = true; - Logger.Info("Api running on http://localhost:7058"); + var builder = Host.CreateDefaultBuilder(); + builder.ConfigureServices(services => services.AddCors()); + builder.ConfigureWebHostDefaults(webBuilder => + { + webBuilder.UseKestrel(); + webBuilder.Configure(app => + { + // Enable CORS + app.UseCors(policy => policy + .AllowAnyOrigin() + .AllowAnyMethod() + .AllowAnyHeader() + ); + + app.UseRouting(); + app.UseEndpoints(endpoints => + { + // Share endpoints + endpoints.MapGet("/v2/show-package", V2_ShowPackage); + endpoints.MapGet("/is-running", API_IsRunning); + // Widgets v1 API + endpoints.MapGet("/widgets/v1/get_wingetui_version", WIDGETS_V1_GetUniGetUIVersion); + endpoints.MapGet("/widgets/v1/get_updates", WIDGETS_V1_GetUpdates); + endpoints.MapGet("/widgets/v1/open_wingetui", WIDGETS_V1_OpenUniGetUI); + endpoints.MapGet("/widgets/v1/view_on_wingetui", WIDGETS_V1_ViewOnUniGetUI); + endpoints.MapGet("/widgets/v1/update_package", WIDGETS_V1_UpdatePackage); + endpoints.MapGet("/widgets/v1/update_all_packages", WIDGETS_V1_UpdateAllPackages); + endpoints.MapGet("/widgets/v1/update_all_packages_for_source", + WIDGETS_V1_UpdateAllPackagesForSource); + // Widgets v2 API + endpoints.MapGet("/widgets/v2/get_icon_for_package", WIDGETS_V2_GetIconForPackage); + }); + }); + webBuilder.UseUrls("http://localhost:7058"); + }); + _host = builder.Build(); + await _host.StartAsync(); + Logger.Info("Api running on http://localhost:7058"); + } - while (__running) - { - await Task.Delay(100); - } - host.Stop(); - Logger.Info("Api was shut down"); - } - catch (Exception e) + private async Task V2_ShowPackage(HttpContext context) + { + var query = context.Request.Query; + if (string.IsNullOrEmpty(query["pid"]) || string.IsNullOrEmpty(query["psource"])) { - Logger.Error("An error occurred while initializing the API"); - Logger.Error(e); + context.Response.StatusCode = 400; + return; } + + OnShowSharedPackage?.Invoke(null, new KeyValuePair(query["pid"], query["psource"])); + + await context.Response.WriteAsync("{\"status\": \"success\"}"); } - /// - /// Stop the background api - /// - public void Stop() + private async Task API_IsRunning(HttpContext context) { - __running = false; + await context.Response.WriteAsync("{\"status\": \"success\"}"); } - } - /// - /// The background api builder - /// - public class BackgroundApi : NancyModule - { - public static event EventHandler? OnOpenWindow; - public static event EventHandler? OnOpenUpdatesPage; - public static event EventHandler>? OnShowSharedPackage; - public static event EventHandler? OnUpgradeAll; - public static event EventHandler? OnUpgradeAllForManager; - public static event EventHandler? OnUpgradePackage; - - public BackgroundApi() + private async Task WIDGETS_V1_GetUniGetUIVersion(HttpContext context) { - // Enable CORS - After.AddItemToEndOfPipeline((ctx) => + if (!AuthenticateToken(context.Request.Query["token"])) { - ctx.Response.WithHeader("Access-Control-Allow-Origin", "*") - .WithHeader("Access-Control-Allow-Methods", "POST,GET,OPTIONS") - .WithHeader("Access-Control-Allow-Headers", "Authorization"); - }); - BuildShareApi(); - BuildV1WidgetsApi(); + context.Response.StatusCode = 401; + return; + } + + await context.Response.WriteAsync(CoreData.BuildNumber.ToString()); } - /// - /// Build the endpoints required for the Share Interface - /// - public void BuildShareApi() + private async Task WIDGETS_V1_GetUpdates(HttpContext context) { - // Show package from https://marticliment.com/unigetui/share - Get("/v2/show-package", (_) => + if (!AuthenticateToken(context.Request.Query["token"])) { - try - { - if (Request.Query.@pid == "" || Request.Query.@psource == "") - { - return 400; - } - - OnShowSharedPackage?.Invoke(this, new KeyValuePair(Request.Query.@pid.ToString(), Request.Query.@psource.ToString())); - - return "{\"status\": \"success\"}"; - } - catch (Exception e) - { - Logger.Error(e); - return 500; - } - }); + context.Response.StatusCode = 401; + return; + } - // Basic entrypoint to know if UniGetUI is running - Get("/is-running", (_) => + if (!PEInterface.UpgradablePackagesLoader.IsLoaded && !PEInterface.UpgradablePackagesLoader.IsLoading) { - return "{\"status\": \"success\"}"; - }); - } + _ = PEInterface.UpgradablePackagesLoader.ReloadPackages(); + } - /// - /// Build the endpoints required for the /widgets/v1 endpoint. All of these - /// endpoints are authenticated with MainApp.Instance.AuthenticateToken - /// - public void BuildV1WidgetsApi() - { - // Basic version check - Get("/widgets/v1/get_wingetui_version", (_) => + while (PEInterface.UpgradablePackagesLoader.IsLoading) { - if (!BackgroundApiRunner.AuthenticateToken(Request.Query.@token)) - { - return 401; - } - - return CoreData.BuildNumber.ToString(); - }); + await Task.Delay(100); + } - // Return found updates - Get("/widgets/v1/get_updates", async (parameters) => + StringBuilder packages = new(); + foreach (IPackage package in PEInterface.UpgradablePackagesLoader.Packages) { - if (!BackgroundApiRunner.AuthenticateToken(Request.Query.@token)) - { - return 401; - } + if (package.Tag is PackageTag.OnQueue or PackageTag.BeingProcessed) continue; - if (!PEInterface.UpgradablePackagesLoader.IsLoaded && !PEInterface.UpgradablePackagesLoader.IsLoading) - { - _ = PEInterface.UpgradablePackagesLoader.ReloadPackages(); // Actually begin loading the updates if not loaded or loading - } + string icon = $"http://localhost:7058/widgets/v2/get_icon_for_package?packageId={Uri.EscapeDataString(package.Id)}&packageSource={Uri.EscapeDataString(package.Source.Name)}&token={ApiTokenHolder.Token}"; + packages.Append($"{package.Name.Replace('|', '-')}" + $"|{package.Id}" + $"|{package.VersionString}" + $"|{package.NewVersionString}" + $"|{package.Source.AsString_DisplayName}" + $"|{package.Manager.Name}" + $"|{icon}&&"); + } - while (PEInterface.UpgradablePackagesLoader.IsLoading) - { - await Task.Delay(100); // Wait for the updates to be reported before showing anything - } + string result = packages.ToString(); + if (result.Length > 2) result = result[..(result.Length - 2)]; - StringBuilder packages = new(); - foreach (IPackage package in PEInterface.UpgradablePackagesLoader.Packages) - { - if (package.Tag is PackageTag.OnQueue or PackageTag.BeingProcessed) - continue; // Do not show already processed packages on queue + await context.Response.WriteAsync(result); + } - string icon = $"http://localhost:7058/widgets/v2/get_icon_for_package?packageId={HttpUtility.UrlEncode(package.Id)}&packageSource={HttpUtility.UrlEncode(package.Source.Name)}&token={ApiTokenHolder.Token}"; - packages.Append($"{package.Name.Replace('|', '-')}|{package.Id}|{package.VersionString}|{package.NewVersionString}|{package.Source.AsString_DisplayName}|{package.Manager.Name}|{icon}&&"); - } + private async Task WIDGETS_V1_OpenUniGetUI(HttpContext context) + { + if (!AuthenticateToken(context.Request.Query["token"])) + { + context.Response.StatusCode = 401; + return; + } - string pkgs_ = packages.ToString(); + OnOpenWindow?.Invoke(null, EventArgs.Empty); + context.Response.StatusCode = 200; + } - if (pkgs_.Length > 2) - { - pkgs_ = pkgs_[..(pkgs_.Length - 2)]; - } + private async Task WIDGETS_V1_ViewOnUniGetUI(HttpContext context) + { + if (!AuthenticateToken(context.Request.Query["token"])) + { + context.Response.StatusCode = 401; + return; + } - return pkgs_; - }); + OnOpenUpdatesPage?.Invoke(null, EventArgs.Empty); + context.Response.StatusCode = 200; + } - // Open UniGetUI (as it was) - Get("/widgets/v1/open_wingetui", (_) => + private async Task WIDGETS_V1_UpdatePackage(HttpContext context) + { + if (!AuthenticateToken(context.Request.Query["token"])) { - if (!BackgroundApiRunner.AuthenticateToken(Request.Query.@token)) - { - return 401; - } - - OnOpenWindow?.Invoke(this, EventArgs.Empty); - return 200; - }); + context.Response.StatusCode = 401; + return; + } - // Open UniGetUI with the Updates page shown - Get("/widgets/v1/view_on_wingetui", (_) => + var id = context.Request.Query["id"]; + if (string.IsNullOrEmpty(id)) { - if (!BackgroundApiRunner.AuthenticateToken(Request.Query.@token)) - { - return 401; - } + context.Response.StatusCode = 400; + return; + } - OnOpenUpdatesPage?.Invoke(this, EventArgs.Empty); - return 200; - }); + OnUpgradePackage?.Invoke(null, id); + context.Response.StatusCode = 200; + } - // Update a specific package given its Id - Get("/widgets/v1/update_package", (_) => + private async Task WIDGETS_V1_UpdateAllPackages(HttpContext context) + { + if (!AuthenticateToken(context.Request.Query["token"])) { - if (!BackgroundApiRunner.AuthenticateToken(Request.Query.@token)) - { - return 401; - } - - if (Request.Query.@id == "") - { - return 400; - } + context.Response.StatusCode = 401; + return; + } - OnUpgradePackage?.Invoke(this, Request.Query.@id); - return 200; - }); + Logger.Info("[WIDGETS] Updating all packages"); + OnUpgradeAll?.Invoke(null, EventArgs.Empty); + context.Response.StatusCode = 200; + } - // Update all packages - Get("/widgets/v1/update_all_packages", (_) => + private async Task WIDGETS_V1_UpdateAllPackagesForSource(HttpContext context) + { + if (!AuthenticateToken(context.Request.Query["token"])) { - if (!BackgroundApiRunner.AuthenticateToken(Request.Query.@token)) - { - return 401; - } - - Logger.Info("[WIDGETS] Updating all packages"); - OnUpgradeAll?.Invoke(this, EventArgs.Empty); - return 200; - }); + context.Response.StatusCode = 401; + return; + } - // Update all packages for a specific manager - Get("/widgets/v1/update_all_packages_for_source", (_) => + var source = context.Request.Query["source"]; + if (string.IsNullOrEmpty(source)) { - if (!BackgroundApiRunner.AuthenticateToken(Request.Query.@token)) - { - return 401; - } + context.Response.StatusCode = 400; + return; + } - if (Request.Query.@source == "") - { - return 400; - } + Logger.Info($"[WIDGETS] Updating all packages for manager {source}"); + OnUpgradeAllForManager?.Invoke(null, source); + context.Response.StatusCode = 200; + } - Logger.Info($"[WIDGETS] Updating all packages for manager {Request.Query.@source}"); - OnUpgradeAllForManager?.Invoke(this, Request.Query.@source); - return 200; - }); + private async Task WIDGETS_V2_GetIconForPackage(HttpContext context) + { + if (!AuthenticateToken(context.Request.Query["token"])) + { + context.Response.StatusCode = 401; + return; + } - // Update all packages for a specific manager - Get("/widgets/v2/get_icon_for_package", async (_) => + var packageId = context.Request.Query["packageId"]; + var packageSource = context.Request.Query["packageSource"]; + if (string.IsNullOrEmpty(packageId) || string.IsNullOrEmpty(packageSource)) { - if (!BackgroundApiRunner.AuthenticateToken(Request.Query.@token)) - { - return 401; - } + context.Response.StatusCode = 400; + return; + } - if (Request.Query.@packageId == "" || Request.Query.@packageSource == "") - { - return 400; - } + string iconPath = Path.Join(CoreData.UniGetUIExecutableDirectory, "Assets", "Images", "package_color.png"); - string iconPath = Path.Join(CoreData.UniGetUIExecutableDirectory, "Assets", "Images", "package_color.png"); - IPackage? package = PEInterface.UpgradablePackagesLoader.GetPackageForId(Request.Query.@packageId, Request.Query.@packageSource); - if (package is not null) - { - Uri iconUrl = await Task.Run(package.GetIconUrl); - if (iconUrl.ToString() != "ms-appx:///Assets/Images/package_color.png") - { - string mimePath = Path.Join(CoreData.UniGetUICacheDirectory_Icons, package.Manager.Name, - package.Id, "icon.mime"); - iconPath = Path.Join(CoreData.UniGetUICacheDirectory_Icons, package.Manager.Name, package.Id, - $"icon.{IconCacheEngine.MimeToExtension[await File.ReadAllTextAsync(mimePath)]}"); - } - // else, the iconPath will be the preloaded one (package_color.png) - } - else + IPackage? package = PEInterface.UpgradablePackagesLoader.GetPackageForId(packageId, packageSource); + if (package != null) + { + var iconUrl = await Task.Run(package.GetIconUrl); + if (iconUrl.ToString() != "ms-appx:///Assets/Images/package_color.png") { - Logger.Warn($"[API] Package id={Request.Query.@packageId} with sourceName={Request.Query.@packageSource} was not found!"); + string mimePath = Path.Join(CoreData.UniGetUICacheDirectory_Icons, package.Manager.Name, package.Id, "icon.mime"); + iconPath = Path.Join(CoreData.UniGetUICacheDirectory_Icons, package.Manager.Name, package.Id, $"icon.{IconCacheEngine.MimeToExtension[await File.ReadAllTextAsync(mimePath)]}"); } + } + else + { + Logger.Warn($"[API] Package id={packageId} with source={packageSource} not found!"); + } - byte[] fileContents = await File.ReadAllBytesAsync(iconPath); - return new Response - { - ContentType = IconCacheEngine.ExtensionToMime[iconPath.Split('.')[^1]], - Contents = (stream) => - { - try - { - stream.Write(fileContents, 0, fileContents.Length); - } - catch (Exception ex) - { - Logger.Warn($"Unable to load icon to path {iconPath}"); - Logger.Warn(ex); - } - } - }; + var bytes = await File.ReadAllBytesAsync(iconPath); + var ext = Path.GetExtension(iconPath).TrimStart('.').ToLower(); + context.Response.ContentType = IconCacheEngine.ExtensionToMime.GetValueOrDefault(ext, "image/png"); + await context.Response.Body.WriteAsync(bytes, 0, bytes.Length); + } - }); + public async void Stop() + { + await _host.StopAsync(); + Logger.Info("Api was shut down"); } } } - diff --git a/src/UniGetUI.Interface.BackgroundApi/UniGetUI.Interface.BackgroundApi.csproj b/src/UniGetUI.Interface.BackgroundApi/UniGetUI.Interface.BackgroundApi.csproj index c64dd75246..d1695ed4db 100644 --- a/src/UniGetUI.Interface.BackgroundApi/UniGetUI.Interface.BackgroundApi.csproj +++ b/src/UniGetUI.Interface.BackgroundApi/UniGetUI.Interface.BackgroundApi.csproj @@ -1,12 +1,7 @@ - - - + - - - NU1701 - + diff --git a/src/UniGetUI/App.xaml.cs b/src/UniGetUI/App.xaml.cs index 8a40a1a554..e0a6ab3f22 100644 --- a/src/UniGetUI/App.xaml.cs +++ b/src/UniGetUI/App.xaml.cs @@ -213,12 +213,41 @@ private async Task LoadComponentsAsync() IconDatabase.InitializeInstance(); IconDatabase.Instance.LoadIconAndScreenshotsDatabase(); - // Bind the background api to the main interface + await InitializeBackgroundAPI(); - if (!Settings.Get("DisableApi")) + _ = MainWindow.DoEntryTextAnimationAsync(); + + // Load package managers + await Task.Run(PEInterface.Initialize); + TelemetryHandler.Initialize(); + + Logger.Info("LoadComponentsAsync finished executing. All managers loaded. Proceeding to interface."); + MainWindow.SwitchToInterface(); + RaiseExceptionAsFatal = false; + + MainWindow.ProcessCommandLineParameters(); + MainWindow.ParametersToProcess.ItemEnqueued += (_, _) => { + MainWindow.DispatcherQueue.TryEnqueue(MainWindow.ProcessCommandLineParameters); + }; + + await CheckForMissingDependencies(); + } + catch (Exception e) + { + CoreTools.ReportFatalException(e); + } + } - BackgroundApi.OnOpenWindow += (_, _) => MainWindow.DispatcherQueue.TryEnqueue(() => MainWindow.Activate()); + private async Task InitializeBackgroundAPI() + { + // Bind the background api to the main interface + if (!Settings.Get("DisableApi")) + { + try + { + BackgroundApi.OnOpenWindow += (_, _) => + MainWindow.DispatcherQueue.TryEnqueue(() => MainWindow.Activate()); BackgroundApi.OnOpenUpdatesPage += (_, _) => MainWindow.DispatcherQueue.TryEnqueue(() => { @@ -236,40 +265,24 @@ private async Task LoadComponentsAsync() Operations.UpdateAll(); }); - BackgroundApi.OnUpgradeAllForManager += (_, managerName) => MainWindow.DispatcherQueue.TryEnqueue(async () => - { - Operations.UpdateAllForManager(managerName); - }); + BackgroundApi.OnUpgradeAllForManager += (_, managerName) => + MainWindow.DispatcherQueue.TryEnqueue(async () => + { + Operations.UpdateAllForManager(managerName); + }); BackgroundApi.OnUpgradePackage += (_, packageId) => MainWindow.DispatcherQueue.TryEnqueue(() => { Operations.UpdateForId(packageId); }); - _ = BackgroundApi.Start(); + await BackgroundApi.Start(); } - - _ = MainWindow.DoEntryTextAnimationAsync(); - - // Load package managers - await Task.Run(PEInterface.Initialize); - TelemetryHandler.Initialize(); - - Logger.Info("LoadComponentsAsync finished executing. All managers loaded. Proceeding to interface."); - MainWindow.SwitchToInterface(); - RaiseExceptionAsFatal = false; - - MainWindow.ProcessCommandLineParameters(); - MainWindow.ParametersToProcess.ItemEnqueued += (_, _) => + catch (Exception ex) { - MainWindow.DispatcherQueue.TryEnqueue(MainWindow.ProcessCommandLineParameters); - }; - - await CheckForMissingDependencies(); - } - catch (Exception e) - { - CoreTools.ReportFatalException(e); + Logger.Error("Could not initialize Background API:"); + Logger.Error(ex); + } } } From 2b55a740404e5ee366daeb752f12c093e178aaf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=AD=20Climent?= Date: Sun, 27 Apr 2025 16:00:10 +0200 Subject: [PATCH 2/3] full trim --- src/UniGetUI/UniGetUI.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/UniGetUI/UniGetUI.csproj b/src/UniGetUI/UniGetUI.csproj index 443f29fc98..202e722f91 100644 --- a/src/UniGetUI/UniGetUI.csproj +++ b/src/UniGetUI/UniGetUI.csproj @@ -16,7 +16,7 @@ true - partial + full true From 7ef2e728682ac5d8eb7adaa0cf7705e278ea2435 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=AD=20Climent?= Date: Sun, 27 Apr 2025 16:00:33 +0200 Subject: [PATCH 3/3] Update Licenses.cs --- src/UniGetUI.Core.Data/Licenses.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/UniGetUI.Core.Data/Licenses.cs b/src/UniGetUI.Core.Data/Licenses.cs index b8ddcb667f..e1e4fa852d 100644 --- a/src/UniGetUI.Core.Data/Licenses.cs +++ b/src/UniGetUI.Core.Data/Licenses.cs @@ -10,7 +10,6 @@ public static class LicenseData {"Community Toolkit", "MIT"}, {"H.NotifyIcon", "MIT"}, {"Windows App Sdk", "MIT"}, - //{"NancyFx", "MIT"}, {"PhotoSauce.MagicScaler", "MIT"}, {"YamlDotNet", "MIT"}, {"WinUIEx", "MIT"}, @@ -45,7 +44,6 @@ public static class LicenseData {"Community Toolkit", new Uri("https://github.com/CommunityToolkit/Windows/blob/main/License.md")}, {"H.NotifyIcon", new Uri("https://github.com/HavenDV/H.NotifyIcon/blob/master/LICENSE.md")}, {"Windows App Sdk", new Uri("https://github.com/microsoft/WindowsAppSDK/blob/main/LICENSE")}, - //{"NancyFx", new Uri("https://github.com/NancyFx/Nancy/blob/master/license.txt")}, {"PhotoSauce.MagicScaler", new Uri("https://github.com/saucecontrol/PhotoSauce/blob/master/license")}, {"YamlDotNet", new Uri("https://github.com/aaubry/YamlDotNet/blob/master/LICENSE.txt") }, {"WinUIEx", new Uri("https://github.com/dotMorten/WinUIEx/blob/main/LICENSE") }, @@ -80,7 +78,6 @@ public static class LicenseData {"Community Toolkit", new Uri("https://github.com/CommunityToolkit/Windows/")}, {"H.NotifyIcon", new Uri("https://github.com/HavenDV/H.NotifyIcon/")}, {"Windows App Sdk", new Uri("https://github.com/microsoft/WindowsAppSDK/")}, - //{"NancyFx", new Uri("https://github.com/NancyFx/Nancy/")}, {"PhotoSauce.MagicScaler", new Uri("https://github.com/saucecontrol/PhotoSauce/")}, {"YamlDotNet", new Uri("https://github.com/aaubry/YamlDotNet/") }, {"WinUIEx", new Uri("https://github.com/dotMorten/WinUIEx/") },