Skip to content

Multiple installed packaged found #1083

Closed

Description

Brief description of your issue

Cannot upgrade Visual Studio Code as winget fails to properly use the provided criteria

Steps to reproduce

All of the following commands fail:

PS C:\Users\adil> winget upgrade --id Microsoft.VisualStudioCode
Multiple installed packages found matching input criteria. Please refine the input.
Name                                Id
------------------------------------------------------------------------------
Visual Studio Code                  Microsoft.VisualStudioCode
Microsoft Visual Studio Code (User) {771FD6B0-FA20-440A-A002-3B3BAC16DC50}_is1

PS C:\Users\adil> winget upgrade --id Microsoft.VisualStudioCode -e
Multiple installed packages found matching input criteria. Please refine the input.
Name                                Id
------------------------------------------------------------------------------
Visual Studio Code                  Microsoft.VisualStudioCode
Microsoft Visual Studio Code (User) {771FD6B0-FA20-440A-A002-3B3BAC16DC50}_is1

PS C:\Users\adil> winget upgrade -e Microsoft.VisualStudioCode
Multiple installed packages found matching input criteria. Please refine the input.
Name                                Id
------------------------------------------------------------------------------
Visual Studio Code                  Microsoft.VisualStudioCode
Microsoft Visual Studio Code (User) {771FD6B0-FA20-440A-A002-3B3BAC16DC50}_is1

PS C:\Users\adil> winget upgrade -e --id Microsoft.VisualStudioCode
Multiple installed packages found matching input criteria. Please refine the input.
Name                                Id
------------------------------------------------------------------------------
Visual Studio Code                  Microsoft.VisualStudioCode
Microsoft Visual Studio Code (User) {771FD6B0-FA20-440A-A002-3B3BAC16DC50}_is1

Expected behavior

It should match just the top one:

Name                                Id
------------------------------------------------------------------------------
Visual Studio Code                  Microsoft.VisualStudioCode

Actual behavior

Matches another install that actually does not have the id I typed.

Environment

PS C:\Users\adil> winget --info
Windows Package Manager v1.0.11451
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.19042.985
Package: Microsoft.DesktopAppInstaller v1.11.11451.0


Activity

  1. ghost added
    Needs-Triage
    on Jun 3, 2021
  2. denelon commented on Jun 3, 2021

    @denelon
    Collaborator

    Adil Hindistan (@AdilHindistan) can you share the output for winget list visual?

    We've run into some challenges with packages that have a different version number than what shows up in "Add / Remove Programs". The Visual Studio Code manifests have a four part version number, and only the first three appear to be registered in Windows.

  3. added
    Issue-Bug
    and removed
    Needs-Triage
    on Jun 3, 2021
  4. denelon commented on Jun 3, 2021

    @denelon
    Collaborator

    I'm also wondering if you have the "stable" release and a daily build installed on your machine. I've seen some interesting interactions with packages that have side by side install support.

  5. AdilHindistan commented on Jun 3, 2021

    @AdilHindistan
    Author

    I'm also wondering if you have the "stable" release and a daily build installed on your machine. I've seen some interesting interactions with packages that have side by side install support.

    How do I check Demitrius Nelon (@denelon) ?

  6. denelon commented on Jun 3, 2021

    @denelon
    Collaborator

    Run winget list visual and share the output if you don't mind. Visual Studio Code supports "side by side" install for stable and "daily" builds. I believe we would see more than one entry for "Visual Studio Code".

  7. added
    Needs-Author-Feedback
    on Jun 3, 2021
  8. added this to the milestone on Jun 3, 2021
  9. AdilHindistan commented on Jun 4, 2021

    @AdilHindistan
    Author

    I think you are onto something here Demitrius Nelon (@denelon)

    PS C:\Users\adil> winget list visual
    Name                                             Id                                     Version        Available Source
    -----------------------------------------------------------------------------------------------------------------------
    Visual Studio Code                               Microsoft.VisualStudioCode             1.47.3         1.56.2    winget
    Microsoft Visual C++ 2010  x64 Redistributable … {1D8E6291-B0D5-35EC-8441-6616F567A0F7} 10.0.40219
    Microsoft Visual C++ 2008 Redistributable - x64… {5FCE6D76-F5DC-37AB-B2B8-22AB8CEDB1D4} 9.0.30729.6161
    Microsoft Visual C++ 2008 Redistributable - x64… {8220EEFE-38CD-377E-8595-13398D740ACE} 9.0.30729
    Microsoft Visual C++ 2013 Redistributable (x64)… {050d4fc8-5d48-4b8f-8972-47c82c46020f} 12.0.30501.0
    Microsoft Visual C++ 2012 Redistributable (x86)… {33d1fd90-4274-48a1-9bc1-97e33d9c2d6f} 11.0.61030.0
    Microsoft Visual C++ 2005 Redistributable        {710f4c1c-cc18-4c49-8cbf-51240c89a1a2} 8.0.61001
    Microsoft Visual C++ 2005 Redistributable        {7299052b-02a4-4627-81f2-1818da5d550d} 8.0.56336
    Microsoft Visual C++ 2008 Redistributable - x86… {9BE518E6-ECC6-35A9-88E4-87755C07200F} 9.0.30729.6161
    Microsoft Visual C++ 2015-2019 Redistributable … {a9cfe9c7-e54f-46cd-9c5c-542ff8e3e8c4} 14.28.29334.0
    Microsoft Visual C++ 2015-2019 Redistributable … {b2d0f752-adc5-496e-8f70-8669de01f746} 14.28.29334.0
    Microsoft Visual C++ 2012 Redistributable (x64)… {ca67548a-5ebe-413a-b50c-4b9ceb6d66c6} 11.0.61030.0
    Microsoft Visual C++ 2010  x86 Redistributable … {F0C3E5D1-1ADE-321E-8167-68EF0DE699A5} 10.0.40219
    Microsoft Visual C++ 2013 Redistributable (x86)… {f65db027-aff3-4070-886a-0d87064aabb1} 12.0.30501.0
    Visual Studio Code                               Microsoft.VisualStudioCode             1.56.2
    

    When I launch appwiz.cpl to check, it shows two entries.

    • Visual Studio code
    • Visual Studio code (User)

    System-wide one is the older version, the one shown on top and it is installed at

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{EA457B21-F73E-494C-ACAB-524FDE069978}_is1
        Inno Setup: Setup Version    REG_SZ    5.6.1 (u)
        Inno Setup: App Path    REG_SZ    C:\Program Files\Microsoft VS Code
        InstallLocation    REG_SZ    C:\Program Files\Microsoft VS Code\
        Inno Setup: Icon Group    REG_SZ    Visual Studio Code
    

    user version is installed at
    %appdatalocal%\Programs\Microsoft VS Code\

    I don't recall installing 2 different versions. Judging by the date, it looks like I wanted to update the vscode and update ended up in the %appdatalocal%\

  10. ghost added
    Needs-Attention
    on Jun 4, 2021
  11. ghost removed
    Needs-Author-Feedback
    on Jun 4, 2021
  12. denelon commented on Jun 4, 2021

    @denelon
    Collaborator

    The Windows Package Manager has "settings" and an argument to specify "User" vs. "Machine". The default is "User" when not specified (assuming the manifest is configured correctly). Depending on when and how the first version was installed, this could have been the result of the Windows Package Manager not being able to map to the version or scope on your machine. We will need to perform some additional testing to see if the behavior is correct in the client, or if we need to make some additional changes in the code paths to see if it is possible to detect which one a user has installed, and at least provide a warning to avoid this scenario. We have a feature to look at "UpgradeCode" in MSI packages, and I'm hoping that will properly address at least this scenario.

    Thank you so much for the detailed analysis!

    It really helps when we have sufficient data to be able to troubleshoot and reproduce errors

  13. removed
    Needs-Attention
    on Jun 9, 2021
  14. denelon commented on Sep 23, 2021

    @denelon
    Collaborator

    I believe we have narrowed down what has happened in this case. The previous version was installed as "machine" and the installer in the manifest currently defaults to "user". We see the earlier version, but when we install we install the new version as "user". This shows up as a second entry. I'm not sure what we could do in cases like this to help improve experience. If you can think of a better behavior, let us know. I'd be happy to have a new "Feature" request additional behavior or user control.

  15. modified the milestones: , v1.2 Client, v1.1-Client on Oct 1, 2021
  16. Elias-Graf commented on Oct 21, 2021

    @Elias-Graf

    Demitrius Nelon (@denelon) I'm experiencing this issue when trying to uninstall a package.

    > winget list --name Colorpicker
    Name        Id                  Version Available Source
    --------------------------------------------------------
    Colorpicker Toinane.Colorpicker 2.0.0   2.0.3     winget
    Colorpicker Toinane.Colorpicker 2.0.3             winget
    

    One of those packages (the new one) was installed via an .exe downloaded from the internet, the other one was installed via winget (at least that's how I remember it, don't count on it though).

    So I wanted to remove one of the packages:

    > winget uninstall Colorpicker
    Multiple installed packages found matching input criteria. Please refine the input.
    Name              Id
    --------------------------------------------------------
    Colorpicker       Toinane.Colorpicker
    Colorpicker 2.0.3 {2fa01720-ea93-5692-9697-66fad2caf3bf}
    

    I totally understand why the command would fail, so I found out about the "exact" flag and tried that:

    winget uninstall -e Toinane.Colorpicker
    Multiple installed packages found matching input criteria. Please refine the input.
    Name              Id
    --------------------------------------------------------
    Colorpicker       Toinane.Colorpicker
    Colorpicker 2.0.3 {2fa01720-ea93-5692-9697-66fad2caf3bf}
    

    The ids are clearly not the same, why is this failing? I'm also confused as to why the winget list also returns two packages, but both have the same id.

    I also reported the issue here: #282 (comment), but I assume it's the wrong issue as that is specifically about installing powershell.

    In case you are wondering about the version:

    > winget -v
    v1.1.12663
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions