Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

winget upgrade --all aways tries to upgrade vscode #976

Closed
LuanVSO opened this issue May 20, 2021 · 26 comments
Closed

winget upgrade --all aways tries to upgrade vscode #976

LuanVSO opened this issue May 20, 2021 · 26 comments
Labels
Catalog-Health Some scenarios related to install/upgrade/import need improvements Issue-Bug It either shouldn't be doing this or needs an investigation.
Milestone

Comments

@LuanVSO
Copy link

LuanVSO commented May 20, 2021

Brief description of your issue

Winget always sees vscode as if it is not up-to-date. i think it is because the version number on the manifest includes the commit id, but the version reported back from Winget list doesn't.

Steps to reproduce

winget install vscode --scope machine
winget list vscode

Expected behavior

Winget should detect that the most recent version of vscode is already installed

Actual behavior

it thinks there's a new update for vscode

Environment

Windows Package Manager version: v0.4.11391
Windows: Windows.Desktop version: v10.0.19043.985
Package: Microsoft.DesktopAppInstaller version: v1.11.11391.0

Any other software?
Visual Studio Code

Recommended fix

just remove the commit id from the version number in the manifest

@denelon denelon transferred this issue from microsoft/winget-pkgs May 20, 2021
@ghost ghost added the Needs-Triage Issue need to be triaged label May 20, 2021
@denelon denelon added Issue-Bug It either shouldn't be doing this or needs an investigation. and removed Needs-Triage Issue need to be triaged labels May 20, 2021
@denelon
Copy link
Contributor

denelon commented May 20, 2021

@LuanVSO this is primarily related to the version numbers in the manifest with a four part identifier and the entry in Add/Remove Programs having a three part identifier. I moved this Issue to the client to see if this might be something generic we need to consider in the client when we do our comparisons for tracking what version of a package we installed vs. what we see in Add/Remove programs. This could likely be addressed by modifying the "PackageVersion" in the manifest, but I want to give the Visual Studio Code team an opportunity to evaluate before changing their manifests.

@OfficialEsco
Copy link

Should this thread maybe include other Packages that do the same since winget upgrade is out of experimental and actually works?

image
7-Zip version 21.01-alpha is being selected over 21.02 alpha
Battle.net and Portmaster don't show a version, which then leads to a Unknown download loop
CPU-Z is dumb and released a update with the same version number/download link, easy manifest fix aslong as someone don't submit it again..

@denelon
Copy link
Contributor

denelon commented May 21, 2021

@OfficialEsco, We use alpha sort on each token in the version string. If the 21.02 alpha is updated to 21.02-alpha it should work.

@chausner
Copy link
Contributor

I have encountered a similar case with Anvil Studio:

Anvil Studio WillowSoftware.AnvilStudio 20.12.03 2020.12.03 winget

The official version string is 2020.12.03 which is also what's in the manifest but the version in Add/Remove programs is 20.12.03. Changing the version format in the manifest accordingly is no long-term solution, I think, as somebody else might change it again with an update, breaking it. Maybe an alternative version field could help in the manifest with the format to use to correlate entries in Add/Remove Programs.

@chausner
Copy link
Contributor

chausner commented May 21, 2021

I think some of these issues could potentially be detected automatically in CI during manifest validation. After installing a program, it could be checked whether the installer added an entry to Add/Remove Programs with a version number that matches the one in the manifest, and if not require the version to be adapted or require the specification of an alternative version field.

@denelon
Copy link
Contributor

denelon commented May 21, 2021

@chausner, that's a great idea! You mind creating that as a Feature Request/Idea in the winget-pkgs repository?

@chausner
Copy link
Contributor

@chausner, that's a great idea! You mind creating that as a Feature Request/Idea in the winget-pkgs repository?

I created microsoft/winget-pkgs#13620 and https://github.com/microsoft/winget-pkgs/issues/13622.

@OfficialEsco
Copy link

OfficialEsco commented May 22, 2021

@denelon i renamed the 7ZipAlpha manifest #13613 and its still upgrading to 21.01-alpha
image

Can it be because 21.01 is installed as exe?

Edit:
It did indeed upgrade to 21.02-alpha when i added the exe
image

@jedieaston
Copy link
Contributor

@lszomoru Is there a particular reason the four part identifier is used at all for VSCode? In release notes they only ever use the three part one. I can understand for Insiders (since you want to tie it back to the commit in microsoft/code), but not for stable.

@denelon
Copy link
Contributor

denelon commented May 23, 2021

@OfficialEsco we do try to ensure to use the same "InstallerType" used previously. We're running into a similar challenge with PowerToys as it is an .msi file inside of a .exe that performs bootstrapping work.

@jedieaston
Copy link
Contributor

I know I said this somewhere else, but once we get dependency support, we should see if the PowerToys team would be willing to supply a standalone MSI for WinGet so we can upgrade it the usual way. I need to open an issue about that when I have a second...

@psychelzh
Copy link

psychelzh commented May 24, 2021

Other programs that are constantly upgraded:

  • Amazon Kindle [Amazon.Kindle]
  • LockHunter [CrystalRich.LockHunter]
  • TechPowerUp GPU-Z [TechPowerUp.GPU-Z]
  • Visual Studio Code [Microsoft.VisualStudioCode]

What's more, TechPowerUp GPU-Z is installed twice.

image

@denelon
Copy link
Contributor

denelon commented May 24, 2021

@psychelzh I've seen a few installers that support "side by side" install for different versions. I'm wondering if a previous call to upgrade actually "upgraded" more than one of them. Could you submit feedback ([Windows]+[f] - "Apps" & "Windows Package Manager") and share the link here so we can look at logs?

@psychelzh
Copy link

@denelon Is it this: https://aka.ms/AAco74f

@Shatungoo
Copy link

Shatungoo commented May 24, 2021

Some other apps. Most of them from MS, and maybe 10+ apps from another vendors was successfully updated:

Mozilla.FirefoxDeveloperEdition -it was updated to latest version, but i still have it in upgrade command
Microsoft.VisualStudioCode - it was updated, but winget tries to upgrade it one more time
Microsoft.Teams - it was updated to latest version, but still in the list, the second upgrade command failed
Microsoft.PowerToys -upgrade didn't start at all
Microsoft.dotnetRuntime -upgrade was successfull but i still have an old version. This was discussed in previous ticket, but it was closed as fixed (#752). Maybe i need to add information to it?

Logs:
DiagOutputDir.zip

PS C:\Users\Leanid_Miron> winget -v
v0.4.11391 Preview
PS C:\Users\Leanid_Miron> winget upgrade --all
Found Microsoft Teams [Microsoft.Teams]
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://statics.teams.cdn.office.net/production-windows-x64/1.4.00.11161/Teams_windows_x64.msi
██████████████████████████████ 107 MB / 107 MB
Successfully verified installer hash
Starting package install...
Installer failed with exit code: 1638
Installer log is available at: C:\Users\Leanid_Miron\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir\WinGet-Microsoft.Teams.1.4.00.11161-2021-05-24-23-32-41.501.log
Found Visual Studio Code [Microsoft.VisualStudioCode]
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://az764295.vo.msecnd.net/stable/054a9295330880ed74ceaedda236253b4f39a335/VSCodeSetup-x64-1.56.2.exe
██████████████████████████████ 76.3 MB / 76.3 MB
Successfully verified installer hash
Starting package install...
Successfully installed
Found .NET Core Runtime [Microsoft.dotnetRuntime]
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://download.visualstudio.microsoft.com/download/pr/6279dc90-f437-4481-82a5-73dd9f97da06/6519ef44735fd31115b9b1a81d6ff1e8/windowsdesktop-runtime-5.0.6-win-x64.exe
██████████████████████████████ 51.9 MB / 51.9 MB
Successfully verified installer hash
Starting package install...
Successfully installed
PS C:\Users\Leanid_Miron> winget upgrade
Name Id Version Available Source
Firefox Developer Edition Mozilla.FirefoxDeveloperEdition 89.0 89.0b9 winget
Microsoft Teams Microsoft.Teams 1.2.0.19260 1.4.00.11161 winget
Visual Studio Code Microsoft.VisualStudioCode 1.56.2 1.56.2.054a929533 winget
PowerToys Microsoft.PowerToys 0.31.2 0.37.2 winget
.NET Core Runtime Microsoft.dotnetRuntime 3.1.11.29516 5.0.6.30021 winget

@Karl-WE
Copy link
Contributor

Karl-WE commented May 25, 2021

as on topic of VSC I can repro it.
There is no error on upgrade but the root cause seems to be this wrong version number in the YAML.
Was same for Zoom.Zoom (fixed at the moment)

steps:

  1. winget upgrade showed a pending upgrade for VSC.
  2. winget upgrade Microsoft.VisualStudiocode
  3. result: success, also confirmed in Settings > Apps and in app (VSC internal build info)
  4. still appears on the upgrade list after
    image

@OfficialEsco
Copy link

@Karl-WE These issues mainly comes from Bots updating Packages with weird/inconsistent version number in the download link/after install...

I see you've struggled with 7-Zip too, which comes from us replacing the EXE installer with the MSI installer (since people here would prefer a MSI install), however @denelon explained in this thread that WinGet will try to use the same InstallerType, so for future manifests we will have to add the MSI as Primary and the EXE as Secondary so the upgrade works..

@Karl-WE
Copy link
Contributor

Karl-WE commented May 25, 2021

Makes sense thank you @OfficialEsco

@LeonarddeR
Copy link

I have a similar issue with the NVAccess.NVDA package, though it incists on downgrading. I have version 'alpha-22934,e05715d3' installed whereas winget tries to upgrade (or rather downgrade) to version 2020.4, which is the most recent version.
Now my question is, how does winget determine the installed version? It seems that the Version, VersionMajor and VersionMinor fields in the uninstall registry key are ignored. Also what might make it more difficult for winget is that NVDA has a 4 part version scheme for its full version, e.g. 2021.2.0.22934 for the version with display version alpha-22934,e05715d3.

See also nvaccess/nvda#12469

@narnaud
Copy link

narnaud commented May 27, 2021

I see multiple issues myself, see here:

image

  1. RocketChat and OpenVPN do not upgrade, when I explicitely ask one to upgrade, there's the text: "No applicable update found."

  2. Blender is constantly updating, even if it's already in version 2.92.0 (could be a problem from Blender installer)

  3. The rest is always updated all the time

@OfficialEsco
Copy link

OfficialEsco commented May 27, 2021

@narnaud

  • Rocket.Chat probably failed because there was no exe installer available.
  • OpenVPN is failing because 2.4.9 is installed as EXE and 4.5+ does not release EXE's anymore.
  • VS Pro, VS Code and MS Teams might have a machinewide installer which is not updated all the time (Your user installed which you use is tho)
  • Blender seems to install side by side? o_O This can be fixed by swapping the UpgradeBehavior from install to uninstallPrevious
    image

@narnaud
Copy link

narnaud commented May 28, 2021

@OfficialEsco Thank you, that fixes most of the issues, I still have VS Code and VS Pro reinstalling, will try to understand why later.

@OfficialEsco
Copy link

OfficialEsco commented May 28, 2021

@OfficialEsco Thank you, that fixes most of the issues, I still have VS Code and VS Pro reinstalling, will try to understand why later.

VS Code was updating because the version Windows sees is a 3 part identifier, while the "real" version is a 4 part identifier, i know denelon said he would wait, but i just pushed a temporary version fix since this is a recurring issue which a lot of people are having, hopefully this will be sorted in the next VS Code update.

VS Pro is a bigger issue, i think the Package installs Microsoft Visual Studio Installer which then installs/updates VS Pro, but at the same the installer installs

  • Microsoft .NET SDK 5.0.300 (x64) from Visual Studio
  • x64 and x86 Microsoft System CLR Types for SQL Server 2019 CTP2.2
  • x64 and x86 Microsoft Visual C++ 2015-2019 Redistributable
  • Windows SDK Addon
  • Windows Software Development Kit

In shorter words: the Visual Studio Team needs to fix their stuff

@jedieaston
Copy link
Contributor

jedieaston commented Jun 2, 2021

I've proposed a solution in #1073. For Visual Studio specifically, it will need some refinement (or for the VS team to rearchitect their installer to act right) but for other programs this would help I think.

@lszomoru
Copy link
Member

I have made the necessary changes to the pipeline that publishes the Visual Studio Code winget package. We have dropped the 4th segment of the version number, so now the version in the winget manifest matches the version number in add/remote programs.

@denelon, can you please go ahead and close the issue as I do not seem to have the necessary permissions. Thanks!

@denelon
Copy link
Contributor

denelon commented Jun 23, 2021

@lszomoru thank you for making the changes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Catalog-Health Some scenarios related to install/upgrade/import need improvements Issue-Bug It either shouldn't be doing this or needs an investigation.
Projects
None yet
Development

No branches or pull requests