Skip to content

Commit 25e8ff3

Browse files
committed
Merge branch 'winget-code-correction' of https://github.com/mrixner/UniGetUI into pr/3339
2 parents b12e46c + 37aefa4 commit 25e8ff3

2 files changed

Lines changed: 13 additions & 8 deletions

File tree

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

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,13 @@ protected override OperationVeredict _getOperationResult(
158158
return OperationVeredict.Failure;
159159
}
160160

161-
if (uintCode == 0x8A15002B)
161+
if (uintCode is 0x8A15002B)
162162
{
163-
IgnoredUpdatesDatabase.Add(IgnoredUpdatesDatabase.GetIgnoredIdForPackage(package), package.Version);
163+
if (Settings.Get("IgnoreUpdatesNotApplicable")) {
164+
Logger.Info("Ignoring update " + package.Name + " as the update is not applicable to the platform");
165+
IgnoredUpdatesDatabase.Add(IgnoredUpdatesDatabase.GetIgnoredIdForPackage(package), package.VersionString);
166+
return OperationVeredict.Success;
167+
}
164168
return OperationVeredict.Failure;
165169
}
166170

@@ -189,12 +193,6 @@ protected override OperationVeredict _getOperationResult(
189193
return OperationVeredict.AutoRetry;
190194
}
191195

192-
if (uintCode == 0x8A150014 && operation is OperationType.Uninstall)
193-
{
194-
// Application not found
195-
return OperationVeredict.Success;
196-
}
197-
198196
return OperationVeredict.Failure;
199197
}
200198

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)