winget-cli icon indicating copy to clipboard operation
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`

Open tedawf opened this issue 2 years ago • 6 comments

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 image

Installed version image

Steps to reproduce

  1. Run winget install google.androidstudio.beta
  2. Run winget upgrade.
  3. 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

tedawf avatar Mar 16 '23 18:03 tedawf

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.

Masamune3210 avatar Mar 17 '23 15:03 Masamune3210

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%"

BrandonWanHuanSheng avatar Mar 19 '23 15:03 BrandonWanHuanSheng

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. 😅

tedawf avatar Mar 20 '23 01:03 tedawf

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

Masamune3210 avatar Mar 20 '23 02:03 Masamune3210

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.

ChristianBeier avatar Jul 20 '23 12:07 ChristianBeier

Why this is not resolved yet? This is same with Google.AndroidStudio (not beta)

bfcns avatar Jan 26 '24 03:01 bfcns