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
23.3k stars 1.45k forks source link

winget list --exact matches incorrectly for similar packages #3994

Open slycordinator opened 11 months ago

slycordinator commented 11 months ago

Brief description of your issue

The package Id = CodecGuide.K-LiteCodecPack.Standard version 18.0.0 installs with name "K-Lite Codec Pack 18.0.0 Standard"

But when that package is installed, winget list indicates that each of:

Steps to reproduce

1) run winget install --id CodecGuide.K-LiteCodecPack.Standard 2) run winget list --exact CodecGuide.K-LiteCodecPack.Standard 3) run winget list --exact CodecGuide.K-LiteCodecPack.Basic 4) run winget list --exact CodecGuide.K-LiteCodecPack.Full 5) run winget list --exact CodecGuide.K-LiteCodecPack.Mega

Expected behavior

1) winget list --exact 'packageID' to show information only for the exact package in question 2) winget list --exact 'packageID' to not display name information for other packages

Actual behavior

winget list --exact show that CodecGuide.K-LiteCodecPack.Standard, CodecGuide.K-LiteCodecPack.Basic, CodecGuide.K-LiteCodecPack.Full, and CodecGuide.K-LiteCodecPack.Mega are all installed with the "Standard" name.

$ winget.exe list --exact CodecGuide.K-LiteCodecPack.Standard
Name                              Id                                  Version Source
-------------------------------------------------------------------------------------
K-Lite Codec Pack 18.0.0 Standard CodecGuide.K-LiteCodecPack.Standard 18.0.0  winget
ash:/mnt/c/Users/USER/Desktop:(Local)$ echo $?
0
$ winget.exe list --exact CodecGuide.K-LiteCodecPack.Basic

Name                              Id                               Version Source
----------------------------------------------------------------------------------
K-Lite Codec Pack 18.0.0 Standard CodecGuide.K-LiteCodecPack.Basic 18.0.0  winget
$ echo $?
0
$ winget.exe list --exact CodecGuide.K-LiteCodecPack.Full
Name                              Id                              Version Source
---------------------------------------------------------------------------------
K-Lite Codec Pack 18.0.0 Standard CodecGuide.K-LiteCodecPack.Full 18.0.0  winget
$ echo $?
0
$ winget.exe list --exact CodecGuide.K-LiteCodecPack.Mega
Name                              Id                              Version Source
---------------------------------------------------------------------------------
K-Lite Codec Pack 18.0.0 Standard CodecGuide.K-LiteCodecPack.Mega 18.0.0  winget
$ echo $?
0
$

But winget list with no arguments shows that the Basic, Full, and Mega packages are not installed:

$ winget.exe list | grep CodecGuide.K-LiteCodecPack.Standard
K-Lite Codec Pack 18.0.0 Standard        CodecGuide.K-LiteCodecPack.Standard      18.0.0                         winget
$ echo $?
0
$ winget.exe list | grep CodecGuide.K-LiteCodecPack.Basic
$ echo $?
1
$ winget.exe list | grep CodecGuide.K-LiteCodecPack.Full
$ echo $?
1
$ winget.exe list | grep CodecGuide.K-LiteCodecPack.Mega
$ echo $?
1
$

Environment

$ winget.exe --info
Windows Package Manager v1.6.3421
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.19045.3803
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.21.3421.0

Winget Directories
-------------------------------------------------------------------------------------------------------------------------------
Logs                               %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir
User Settings                      %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json
Portable Links Directory (User)    %LOCALAPPDATA%\Microsoft\WinGet\Links
Portable Links Directory (Machine) C:\Program Files\WinGet\Links
Portable Package Root (User)       %LOCALAPPDATA%\Microsoft\WinGet\Packages
Portable Package Root              C:\Program Files\WinGet\Packages
Portable Package Root (x86)        C:\Program Files (x86)\WinGet\Packages
Installer Downloads                %USERPROFILE%\Downloads

Links
---------------------------------------------------------------------------
Privacy Statement   https://aka.ms/winget-privacy
License Agreement   https://aka.ms/winget-license
Third Party Notices https://aka.ms/winget-3rdPartyNotice
Homepage            https://aka.ms/winget
Windows Store Terms https://www.microsoft.com/en-us/storedocs/terms-of-sale

Admin Setting                             State
--------------------------------------------------
LocalManifestFiles                        Disabled
BypassCertificatePinningForMicrosoftStore Disabled
InstallerHashOverride                     Disabled
LocalArchiveMalwareScanOverride           Disabled
jhribal commented 10 months ago

I found this problem too and i have to say that it is little bit funny how everywhere the need for tests is propagated and then you have this core system feature and it is probably not tested at all. I literally used the -e option and winget be like "meh i will do substring". Nobody is perfect but error like this in software like this from Microsoft? Bruh :(

denelon commented 10 months ago

Do the other packages have a different "display Name" in Windows Apps & Features?

This might be a case where the "installer" isn't reporting something unique for WinGet to get a distinct match. If all three report the same way in the registry, the Package ID specified is matching the manifest against what was written to the registry.

What happens with winget list K-Lite? I'm curious which manifest is getting matched by default.

slycordinator commented 10 months ago

1) The display name in the Apps & Features is Unique.

In that, I see "K-Lite Codec Pack 18.0.1 Standard"

2)

$ winget list K-Lite
Name                              Id                                  Version Source
-------------------------------------------------------------------------------------
K-Lite Codec Pack 18.0.1 Standard CodecGuide.K-LiteCodecPack.Standard 18.0.1  winget