Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -267,13 +267,11 @@ operation is OperationType.Uninstall
return OperationVeredict.Failure;
}

// WinGet (CLI/COM) reports "not applicable" as 0x8A15002B; bundled pinget instead exits
// non-zero with "No applicable installer found" in its output.
bool pingetReportedNotApplicable =
((WinGet)Manager).SelectedCliToolKind is WinGetCliToolKind.BundledPinget
&& returnCode != 0
&& processOutput.Any(line =>
line.Contains("No applicable installer found", StringComparison.OrdinalIgnoreCase)
|| line.Contains("No applicable upgrade found", StringComparison.OrdinalIgnoreCase)
);

if (uintCode is 0x8A15002B || pingetReportedNotApplicable)
Expand Down
23 changes: 23 additions & 0 deletions src/UniGetUI.PackageEngine.Tests/WinGetManagerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1180,6 +1180,29 @@ public void WinGetUpdateNotApplicableViaPingetRetriesWithoutScopeAndArchitecture
Assert.True(package.OverridenOptions.WinGet_DropArchAndScope);
}

[Fact]
public void WinGetUpdateNotApplicableViaPingetWithZeroExitCodeFails()
{
var manager = new WinGet();
SetCliToolKind(manager, WinGetCliToolKind.BundledPinget);
var package = new PackageBuilder()
.WithManager(manager)
.WithId("Contoso.Tool")
.WithVersion("1.0.0")
.WithNewVersion("2.0.0")
.Build();

var veredict = manager.OperationHelper.GetResult(
package,
OperationType.Update,
["No applicable upgrade found."],
0
);

OperationAssert.HasVeredict(veredict, OperationVeredict.Failure);
Assert.True(WinGetPkgOperationHelper.IsStuckUpgradeLoop(package));
}

[Fact]
public void WinGetGenericPingetFailureDoesNotRetry()
{
Expand Down