winget-cli

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 8ded03a778ca50499e99d3eba39ade3b71ab1198
parent a989c11e91b78c070bcc97c6ac2c0308a97fb867
Author: Easton Pillay <easton@planeteaston.com>
Date:   Wed, 18 May 2022 13:26:52 -0400

Fix list/upgrade table for packages with multiple ARP entries. (#2137)

Now, winget will always use the PackageName from the Add and Remove Programs table, instead of the one in the manifest
Diffstat:
Msrc/AppInstallerCLICore/Workflows/WorkflowBase.cpp | 23++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/src/AppInstallerCLICore/Workflows/WorkflowBase.cpp b/src/AppInstallerCLICore/Workflows/WorkflowBase.cpp @@ -738,23 +738,28 @@ namespace AppInstaller::CLI::Workflow if (latestVersion) { + // Always show the source for correlated packages + sourceName = latestVersion->GetProperty(PackageVersionProperty::SourceName); + if (updateAvailable) { availableVersion = latestVersion->GetProperty(PackageVersionProperty::Version); availableUpgradesCount++; } - - // Always show the source for correlated packages - sourceName = latestVersion->GetProperty(PackageVersionProperty::SourceName); } + // Output using the local PackageName instead of the name in the manifest, to prevent confusion for packages that add multiple + // Add/Remove Programs entries. + // TODO: De-duplicate this list, and only show (by default) one entry per matched package. table.OutputLine({ - match.Package->GetProperty(PackageProperty::Name), - match.Package->GetProperty(PackageProperty::Id), - installedVersion->GetProperty(PackageVersionProperty::Version), - availableVersion, - shouldShowSource ? sourceName : ""s - }); + installedVersion->GetProperty(PackageVersionProperty::Name), + match.Package->GetProperty(PackageProperty::Id), + installedVersion->GetProperty(PackageVersionProperty::Version), + availableVersion, + shouldShowSource ? sourceName : ""s + }); + + } } }