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

Package Microsoft.Git Id incorrectly shown as Git.Git with `winget list` command #4917

Open YingyHuang opened 2 weeks ago

YingyHuang commented 2 weeks ago

Brief description of your issue

I want to update my git for vfs to the latest version using winget, so I started to use winget list --name git. But the returned id for git for vfs was Git.Git (which is supposed to be the git for windows, other than git for vfs): Image

Upating git with command winget update --id Git.Git fails as expected with this error message "The VFS for Git-aware flavor of Git for Windows is currently installed. Switching away from that flavor might break your Scalar/VFS for Git enlistments."

The correct command is winget update --id Microsoft.git. But because the returned Id from winget list shows that as Git.Git, it was causing confusion and users not able to update git for VFS with the correct winget command.

Steps to reproduce

  1. In my local machine, run gvfs --version to confirm that I have GVFS installed:

    gvfs --version GVFS 1.0.24074.1

  2. Run git -v to confirm that I have git for VFS installed:

    git -v git version 2.46.0.vfs.0.0

  3. Run winget list --name git to retrieve all the git related packages, from where I see that Microsoft.Git was using the Git.Git id

    winget list --name git Name Id Version Available Source

    Git Git.Git 2.46.0.0.0 2.47.0 winget GitService 2.0.21069.2 ARP\Machine\X64{0CBA8A6D-A696-4277-AF07-9379F4552C16}_is1 2.0.21069.2 VFS for Git version 1.0.24074.1 ARP\Machine\X64{489CA581-F131-4C28-BE04-4FB178933E6D}_is1 1.0.24074.1

  4. To update my git, if I run winget update --id Git.Git, it failed with error "The VFS for Git-aware flavor of Git for Windows is currently installed. Switching away from that flavor might break your Scalar/VFS for Git enlistments." as exepcted Image

Expected behavior

winget list --name git command should return Microsoft.Git for the installed git for vfs.

Actual behavior

winget list --name git command is currently returning Git.Git for the installed git for vfs.

Environment

Windows Package Manager v1.9.25180 Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.22631.4317 System Architecture: X64 Package: Microsoft.DesktopAppInstaller v1.24.25180.0

git version 2.46.0.vfs.0.0 GVFS 1.0.24074.1

denelon commented 2 weeks ago

I believe the issue here is the data written to the registry for Microsoft.Git and Git.Git are identical. If the installer for Microsoft.Git did something to update the "DisplayName" or "ProductCode" or something else we could key on, it would likely be resolved.