Repository navigation
Closed
Labels
Issue-BugIt either shouldn't be doing this or needs an investigation.
Milestone
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
Reacted by Stefan Reichel, Peter-76, Kaleb Luedtke, Void48 and github-account1111
Metadata
Metadata
Assignees
Labels
Issue-BugIt either shouldn't be doing this or needs an investigation.
Activity
denelon commentedon Jun 3, 2021
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.
denelon commentedon Jun 3, 2021
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.
AdilHindistan commentedon Jun 3, 2021
How do I check Demitrius Nelon (@denelon) ?
denelon commentedon Jun 3, 2021
Run
winget list visualand 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".AdilHindistan commentedon Jun 4, 2021
I think you are onto something here Demitrius Nelon (@denelon)
When I launch appwiz.cpl to check, it shows two entries.
System-wide one is the older version, the one shown on top and it is installed at
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%\
denelon commentedon Jun 4, 2021
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
denelon commentedon Sep 23, 2021
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.
Elias-Graf commentedon Oct 21, 2021
Demitrius Nelon (@denelon) I'm experiencing this issue when trying to uninstall a package.
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:
I totally understand why the command would fail, so I found out about the "exact" flag and tried that:
The ids are clearly not the same, why is this failing? I'm also confused as to why the
winget listalso 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: