microsoft / winget-cli

WinGet is the Windows Package Manager. This project includes a CLI (Command Line Interface), PowerShell modules, and a COM (Component Object Model) API (Application Programming Interface).
https://learn.microsoft.com/windows/package-manager/
MIT License
22.68k stars 1.4k forks source link

[Side-By-Side] List by package identifier fails #2726

Open Trenly opened 1 year ago

Trenly commented 1 year ago

Brief description of your issue

I am well aware of the uninstall issues with side by side packages and the CLI not being able to disambiguate between package versions. However, winget list shouldn't need to disambiguate and should be unaffected by side-by-side installs.

Using winget list <PackageId> fails with side-by-side applications, even though listing by name succeeds

Steps to reproduce

Install multiple versions of a single package identifier. Run winget list <PackageId>

Expected behavior

All versions of the package identifier to be listed

Actual behavior

Logs.zip

PS C:\WINDOWS\system32>  winget list microsoft.windowssdk
No installed package found matching input criteria.
PS C:\WINDOWS\system32>  winget list windowssdk
No installed package found matching input criteria.
PS C:\WINDOWS\system32> winget list "Windows software development kit"
Name                                                      Id                   Version          Available
------------------------------------------------------------------------------------------------------------
Windows Software Development Kit - Windows 10.0.18362.1   Microsoft.WindowsSDK < 10.0.22000.832 10.0.22621.2
Windows Software Development Kit - Windows 10.0.19041.685 Microsoft.WindowsSDK < 10.0.22000.832 10.0.22621.2
Windows Software Development Kit - Windows 10.0.22000.832 Microsoft.WindowsSDK 10.0.22000.832   10.0.22621.2
Windows Software Development Kit - Windows 10.0.22621.1   Microsoft.WindowsSDK 10.0.22621.1     10.0.22621.2
PS C:\WINDOWS\system32> winget list Microsoft.WindowsSDK
No installed package found matching input criteria.

Environment

PS C:\WINDOWS\system32> winget --info
Windows Package Manager (Preview) v1.4.3132-preview
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.19044.2251
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.19.3132.0
denelon commented 3 weeks ago

Did this get fixed in WinGet 1.8?

mdanish-kh commented 2 weeks ago

Nope, issue persists on WinGet 1.8

List by ID:

 ~ winget list --id Microsoft.PowerShell
Name       Id                   Version Source
-----------------------------------------------
PowerShell Microsoft.PowerShell 7.4.3.0 winget

List by name query:

 ~ winget list powershell
Name                       Id                        Version      Available    Source
-------------------------------------------------------------------------------------
PowerShell                 Microsoft.PowerShell      7.4.3.0                   winget
PowerShell 7-x64           Microsoft.PowerShell      7.4.2.0                   winget
Trenly commented 2 weeks ago

Nope, issue persists on WinGet 1.8

List by ID:

 ~ winget list --id Microsoft.PowerShell
Name       Id                   Version Source
-----------------------------------------------
PowerShell Microsoft.PowerShell 7.4.3.0 winget

List by name query:

 ~ winget list powershell
Name                       Id                        Version      Available    Source
-------------------------------------------------------------------------------------
PowerShell                 Microsoft.PowerShell      7.4.3.0                   winget
PowerShell 7-x64           Microsoft.PowerShell      7.4.2.0                   winget

Out of curiosity, can you also try winget list Microsoft.PowerShell without the --id argument?

mdanish-kh commented 2 weeks ago

So I could not reproduce this behavior with all packages. For most packages, WinGet correctly displays all installed side-by-side versions, whether you list by name or use --id. I could only reproduce this behavior with side-by-side versions that differ in installer type.

In the example above, the two installations of PowerShell are PowerShell MSIX and PowerShell MSI. I could also reproduce this with installing side-by-side versions of another package Coder.Coder, that offers two installer types: Nullsoft and Portable. (I'm sure there would be other examples, but these were the ones already installed on my machine)


@Trenly, and to answer your question, listing with just Microsoft.PowerShell behaves the same as listing with --id Microsoft.PowerShell i.e.,

 ~ winget list Microsoft.PowerShell
Name       Id                   Version Source
-----------------------------------------------
PowerShell Microsoft.PowerShell 7.4.3.0 winget