winget-cli
winget-cli copied to clipboard
`winget upgrade` Android Studio Beta does not show the latest version installed, resulting in repeating upgrades with `winget upgrade --all`
Brief description of your issue
This issue seems to only affect Google.AndroidStudio.Beta but I'm not sure if it's an issue with the package or with winget upgrade
When I run winget upgrade it shows the installed version to be > 2022.1.1.11 instead of 2022.2.1.12. This means that Android Studio Beta will always appear in the upgrade list.
Terminal

Installed version

Steps to reproduce
- Run
winget install google.androidstudio.beta - Run
winget upgrade. - Run
winget upgrade --all
Expected behavior
winget upgrade should show the latest version installed instead of "> 2022.1.1.11"
winget upgrade --all should not upgrade this application repeatedly.
Actual behavior
After installing, Android Studio Beta will still appear in the list when running winget upgrade even though the latest version was just installed.
Running winget upgrade --all will attempt to upgrade the newly installed Android Studio Beta again. This repeats indefinitely.
Environment
Windows Package Manager v1.4.10173
Copyright (c) Microsoft Corporation. All rights reserved.
Windows: Windows.Desktop v10.0.22621.1413
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.19.10173.0
Using Windows 11, Powershell v7.4.0-preview.1
Not a bug in winget really, installers are the sole handlers of their install keys in the registry and that includes versions. What happened here likely is the upgrade installer didn't update the version entry in the registry, which is what winget checks to see if a update is available. Since it was never updated correctly, winget thinks that the old version is still installed and continues to offer the update.
Some of the publisher installer does not write the value into the display version registry key. "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall%TheAppName%" or "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall%TheAppName%"
Do we have a solution or a workaround for this problem? Because this means winget upgrade --all would not be a useful command for me as it would always download and upgrade these outliers. 😅
You can temporarily pin Android Studio to the current version, that way winget ignores it when checking for updates. Just remember to either remove the pin after a while to let it check again or let Android Studio handle updating itself
This is not the first time a package/installer has not provided some information required by winget. Please think about adding any of these requirements to the testing and qualification process before accepting and publishing winget packages... quality overrules quantity. It is also not ecological to download and reinstall a package without a need.
Why this is not resolved yet? This is same with Google.AndroidStudio (not beta)