Skip to content

Commit d73e3ce

Browse files
authored
Merge pull request #3339 from mrixner/winget-code-correction
WinGet Code Handling Modifications
2 parents 878bd18 + 1790c39 commit d73e3ce

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

src/UniGetUI.PackageEngine.Managers.WinGet/Helpers/WinGetPkgOperationHelper.cs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using UniGetUI.Core.SettingsEngine;
55
using UniGetUI.Core.Tools;
66
using UniGetUI.PackageEngine.Classes.Manager.BaseProviders;
7+
using UniGetUI.PackageEngine.Classes.Packages.Classes;
78
using UniGetUI.PackageEngine.Enums;
89
using UniGetUI.PackageEngine.Interfaces;
910

@@ -157,10 +158,16 @@ protected override OperationVeredict _getOperationResult(
157158
return OperationVeredict.Failure;
158159
}
159160

160-
if (uintCode is 0x8A15002B)
161-
{ // TODO: The update cannot be installed (not applicable)
162-
return OperationVeredict.Failure;
163-
}
161+
if (uintCode is 0x8A15002B)
162+
{
163+
if (Settings.Get("IgnoreUpdatesNotApplicable"))
164+
{
165+
Logger.Warn($"Ignoring update {package.Id} as the update is not applicable to the platform, and the user has enabled IgnoreUpdatesNotApplicable");
166+
IgnoredUpdatesDatabase.Add(IgnoredUpdatesDatabase.GetIgnoredIdForPackage(package), package.VersionString);
167+
return OperationVeredict.Success;
168+
}
169+
return OperationVeredict.Failure;
170+
}
164171

165172
if (uintCode is 0x8A15010D or 0x8A15004F or 0x8A15010E)
166173
{ // Application is already installed

src/UniGetUI/Pages/SettingsPage.xaml.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,17 @@ public SettingsPage()
196196
_ = PEInterface.InstalledPackagesLoader.ReloadPackages();
197197
};
198198

199+
CheckboxCard WinGet_HideNonApplicableUpdates = new()
200+
{
201+
Text = CoreTools.Translate("Add updates that fail with a 'no applicable update found' to the ignored updates list"),
202+
SettingName = "IgnoreUpdatesNotApplicable"
203+
};
204+
199205
ExtraSettingsCards[PEInterface.WinGet].Add(WinGet_EnableTroubleshooter);
200206
ExtraSettingsCards[PEInterface.WinGet].Add(WinGet_EnableTroubleshooter_v2);
201207
ExtraSettingsCards[PEInterface.WinGet].Add(WinGet_ResetWindowsIPackageManager);
202208
ExtraSettingsCards[PEInterface.WinGet].Add(WinGet_UseBundled);
209+
ExtraSettingsCards[PEInterface.WinGet].Add(WinGet_HideNonApplicableUpdates);
203210

204211
// ----------------------------------------------------------------------------------------
205212

0 commit comments

Comments
 (0)