microsoft / microsoft/winget-cli

list command fails when ambiguous regkeys are present

Open
#2,297 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-Matching Issue-Bug
Dominant language
C++
Stars
26.4k
Forks
1.8k
Avg merge
1d 11h
Merged PRs (30d)
15

Description

Brief description of your issue

When additional regkeys that resemble the package id (and possibly other matching properties?) are present in the uninstall registry hive, the list command is unable to find the affected package.

Steps to reproduce
  1. Import the following regkey:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Test_Key_7Zip]
"DisplayName"="7Zip"
"DisplayVersion"="1.0"
"InstallDate"="20200101"
"Publisher"="IgorPavlov"

  1. Install the 7zip winget package:

winget.exe install --id 7zip.7zip -s winget -e --accept-source-agreements --accept-package-agreements -h --scope=Machine --verbose-logs

  1. Try listing the package:

winget.exe list --id 7zip.7zip -s winget -e --accept-source-agreements

Expected behavior

Name Id Version
-----------------------------------
7-Zip 22.00 (x64) 7zip.7zip 22.00

Actual behavior

No installed package found matching input criteria.

Environment
Tested on stable (Windows Store AppInstaller version) and latest github pre-release (1.3.1741)
Windows: Windows.Desktop v10.0.19044.1766
System Architecture: X64

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by importing the supplied Test_Key_7Zip registry key, installing 7-Zip, and reproducing the winget list command with the exact package ID. Trace the uninstall-registry matching path responsible for resolving the package, then verify that the command returns 7-Zip 22.00 while the ambiguous key is present.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.