winget-cli icon indicating copy to clipboard operation
winget-cli copied to clipboard

discord upgrade

Open jb-aft opened this issue 2 years ago • 4 comments

Brief description of your issue

When I want to update all software (winget upgrade --all) Winget detects an update from discord. Discord is already updated on my PC. Winget throws an error 4294967295 for the discord update

Steps to reproduce

Disord is already installed at the last version. Open terminal. winget upgrade --all wait and see the error 4294967295

Expected behavior

Winget should detect the software version and update it if necessary

Actual behavior

Winget does not detect the software version

Environment

French version
Microsoft Windows 10 Familly
10.0.19044 N/A build 19044
Bios version American Megatrends Inc. 4306, 22/09/2013
Winget version v1.2.10271
Discord already installed
Stable 117300 (cc0861f)
Host 1.0.9004
Windows 10 64-Bit (10.0.19044)

jb-aft avatar Mar 07 '22 10:03 jb-aft

See #1163

Trenly avatar Mar 07 '22 12:03 Trenly

@Trenly do we need to add requiresExplicit upgrade on this package?

I don't see it in the installer.yaml

denelon avatar Aug 08 '22 19:08 denelon

I think we do, but there are larger issues here. Discord is a Squirrel installer (see https://github.com/microsoft/winget-cli/issues/1748 ) if I recall correctly, and even when attempting an explicit upgrade on my end it "errors" out. More specifically, the 'installer' will return a successful response, but the sub-installer throws an error if Discord is running. So, I think this probably requires explicit upgrade and these items:

  • #1748
  • #1786
  • #2217

Trenly avatar Aug 08 '22 19:08 Trenly

I've opened a ticket with Discord support (#31825648) to hopefully have them fix the bug not updating the DisplayVersion registry value on auto-update. I'll update this issue when I hear back from Discord.

Cyber5imon avatar Jan 21 '23 18:01 Cyber5imon

I'm not sure if this is related, but on my Windows 10 Pro x64 system, the actual Discord app shows this version information at the bottom of the Settings page:

Stable 199933 (db1e138) Host 1.0.9013 (32266) Windows 10 64-Bit (10.0.19045)

winget upgrade shows this for Discord:

Name Id Version Available Source

Discord Discord.Discord 1.0.9012 1.0.9013 winget

and the winget.run site for Discord shows the latest version to be 1.0.9011:

https://winget.run/pkg/Discord/Discord

So, assuming the "Host" line in the Discord app is my actual version, that says I'm on 1.0.9013, winget upgrade says I'm on 1.0.9012 and 1.0.9013 is available, and the winget.run site says the last available version is 1.0.9011.

Very odd. But, I installed Discord via its actual installer instead of via winget. So, maybe that's causing the difference.

ourichermath avatar May 30 '23 12:05 ourichermath

WinGet doesn't "inspect" the installed package. It looks at the registry entries behind the Apps & Features metadata. If the Discord package upgrades itself and doesn't upgrade the registry value for the installed version, it's likely to continue to have an invalid version.

Unfortunately, this is a common gap with many installers.

denelon avatar May 30 '23 17:05 denelon

A word of note is the way that discord handles updates is especially weird, even for the realm of auto-updating apps. It unfortunately tends to never update the registry key correctly, meaning that it tends to show up as having a update no matter what you do unless you manually modify the key yourself, which is not recommended.

Masamune3210 avatar May 31 '23 21:05 Masamune3210

WinGet 1.7 was updated to support the "Deny" property in the manifest for upgrades.

denelon avatar Mar 06 '24 19:03 denelon

WinGet 1.7 was updated to support the "Deny" property in the manifest for upgrades.

Sorry to be an idiot, but what does that mean? Can you point to some kind of documentation that explains how we're supposed to use "Deny" to stop Discord (and other programs) from showing up when we use "winget upgrade"? I can't find anything.

ourichermath avatar Mar 08 '24 12:03 ourichermath

@ourichermath UpgradeBehavior: deny tells WinGet that an installed application should not be supported for an upgrade. Essentially "denying" all upgrades for a particular application.

Discord performs auto-updates, but doesn't update its version number in Apps&Features/Control Panel. This means that user can be on a newer discord version, but WinGet would still prompt the user for an upgrade since winget uses the metadata in the Apps&Features / Registry for the source of truth for a package's metadata. This should be reported to the publisher to fix; meanwhile winget upgrade is being blocked for Discord through UpgradeBehavior: deny since it's known to be problematic.

Related:

  • https://github.com/microsoft/winget-cli/issues/3482#issuecomment-1722437239

mdanish-kh avatar Mar 08 '24 17:03 mdanish-kh

@mdanish-kh Why does Discord still show up upon using winget upgrade?

CanePlayz avatar Apr 05 '24 15:04 CanePlayz

@CanePlayz Is it showing under the normal upgrade list, or packages marked with requiring explicit upgrade? For me it shows as:

The following packages have an upgrade available, but require explicit targeting for upgrade:
Name            Id                      Version      Available   Source
-----------------------------------------------------------------------
Discord         Discord.Discord         1.0.9016     1.0.9035    winget
Microsoft Teams Microsoft.Teams.Classic 1.6.00.29964 1.7.00.7956 winget

This is the expected behavior for now. Ideally, denied packages should be hidden from the list entirely, I've created an issue for that https://github.com/microsoft/winget-cli/issues/4299

If you want to hide it entirely, you can set up a pin for Discord with winget pin add Discord.Discord

mdanish-kh avatar Apr 06 '24 02:04 mdanish-kh

Ah thanks a lot, that explains it

CanePlayz avatar Apr 06 '24 10:04 CanePlayz