microsoft / winget-cli

WinGet is the Windows Package Manager. This project includes a CLI (Command Line Interface), PowerShell modules, and a COM (Component Object Model) API (Application Programming Interface).
https://learn.microsoft.com/windows/package-manager/
MIT License
23.35k stars 1.45k forks source link

Winget detecting Steam app ShareX #4826

Open tookender opened 2 months ago

tookender commented 2 months ago

Brief description of your issue

Running winget upgrade --all --include-unknown lists ShareX.ShareX as an installed app even though it is installed via Steam, resulting in an error.

> winget upgrade --all --include-unknown

Name   Id            Version Available Source
---------------------------------------------
ShareX ShareX.ShareX Unknown 16.1.0    winget
1 upgrades available.

(1/1) Found ShareX [ShareX.ShareX] Version 16.1.0
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Successfully verified installer hash
Starting package install...
Installer failed with exit code: 1
Installer log is available at: C:\Users\me\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir\WinGet-ShareX.ShareX.16.1.0-2024-09-20-21-26-45.499.log

Steps to reproduce

  1. Install ShareX via Steam
  2. Run winget upgrade --all --include-unknown, watch it send an error about ShareX

Expected behavior

I expected it to not be detected by winget as it is installed by Steam.

Actual behavior

Winget is detecting ShareX as an application even though it is installed from Steam and giving an error when using the command.

Environment

❯ winget --info
Windows Package Manager v1.8.1911
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.22631.4169
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.23.1911.0

Winget Directories
-----------------------------------------------------------------------------------------------------------------------
Logs                               %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\Diag…
User Settings                      %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\sett…
Portable Links Directory (User)    %LOCALAPPDATA%\Microsoft\WinGet\Links
Portable Links Directory (Machine) C:\Program Files\WinGet\Links
Portable Package Root (User)       %LOCALAPPDATA%\Microsoft\WinGet\Packages
Portable Package Root              C:\Program Files\WinGet\Packages
Portable Package Root (x86)        C:\Program Files (x86)\WinGet\Packages
Installer Downloads                %USERPROFILE%\Downloads

Links
---------------------------------------------------------------------------
Privacy Statement   https://aka.ms/winget-privacy
License Agreement   https://aka.ms/winget-license
Third Party Notices https://aka.ms/winget-3rdPartyNotice
Homepage            https://aka.ms/winget
Windows Store Terms https://www.microsoft.com/en-us/storedocs/terms-of-sale

Admin Setting                             State
--------------------------------------------------
LocalManifestFiles                        Disabled
BypassCertificatePinningForMicrosoftStore Disabled
InstallerHashOverride                     Disabled
LocalArchiveMalwareScanOverride           Disabled
ProxyCommandLineOptions                   Disabled
DefaultProxy                              Disabled

I used Steam to install ShareX
tookender commented 2 months ago

I don't think it should be detecting this as Steam already updates those apps, so there is no point. I understand winget is meant to detect already installed applications, but I don't think it makes sense to detect Steam apps.

stephengillie commented 2 months ago

The package manager operates by downloading a compressed copy of the manifests in its repo, then matching this data against data in the Registry, and outputting matches. This package might have 1 installer that is installed through various package managers and maybe other means. Were this the case, then the Registry would receive the same data regardless of install source, and the package manager should offer the upgrade.

Does upgrading through this package manager cause issues for other package managers including Steam? (Consider using a VM or Sandbox to test instead of modifying your system.)

One possible solution could be using the --pin feature, to prevent this package manager from offering upgrades for this package in the future.

florelis commented 2 months ago

Looking at the ARP on my machine, it seems that apps installed by Steam all have a product code like "Steam App [numerical ID]". So we could potentially detect that an app is managed by Steam and ignore them for updates. I think it would be worth doing since we probably can't do anything useful with those apps (except maybe list).

tookender commented 1 month ago

I think florelis solution would be perfect. It makes no sense to just list them as they are pretty much useless since you can't update them or anything.

yao-msft commented 1 month ago

In the meantime, maybe "winget pin" feature could be used as a workaround to block updating ShareX in upgrade all scenario.