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
22.99k stars 1.43k forks source link

Upgrade doesn't upgrade all architectures #2243

Open trparky opened 2 years ago

trparky commented 2 years ago

Please confirm these before moving forward

Category of the issue

Installation issue.

Brief description of your issue

When I execute "winget upgrade --all" it doesn't download the x86 version of the Microsoft.DotNet.DesktopRuntime.6 package which is installed side-by-side on x64-based installations.

Steps to reproduce

Execute "winget upgrade --all".

Actual behavior

It downloads the x64 version when it should be downloading the x86 version since both need to be updated.

Expected behavior

It should be downloading both the x86 and the x64 versions.

Environment

Windows Package Manager (Preview) v1.3.1391-preview
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.22000.739
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.18.1391.0

Logs: %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir

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

Screenshots and Logs

No response

denelon commented 2 years ago

We need to have a way to determine the architecture for a given installed package to upgrade architectures that aren't the default architecture on the system. The current logic looks at the architecture of the system to make the determination of the best architecture to install when the "--architecture <architecture>" isn't specified.

denelon commented 2 years ago

@trparky As a workaround you can specify the "--architecture" to get the x86 variations

dotnetx86
NJT145 commented 1 year ago

The same feature need to be added to winget uninstall command. For example, I can not uninstall Oracle.JavaRuntimeEnvironment because I have both x86 and x64 versions.

o-l-a-v commented 5 days ago

Simple repro that shows that winget upgrade with --architecture does not work either, as suggested by comment https://github.com/microsoft/winget-cli/issues/2243#issuecomment-1159015335. I originally posted this to #4810.

PS > winget install --silent --id Microsoft.DotNet.DesktopRuntime.6 --version 6.0.31 --architecture x64

Found Microsoft .NET Windows Desktop Runtime 6.0 [Microsoft.DotNet.DesktopRuntime.6] Version 6.0.31
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://dotnetcli.azureedge.net/dotnet/WindowsDesktop/6.0.31/windowsdesktop-runtime-6.0.31-win-x64.exe
  ██████████████████████████████  55.0 MB / 55.0 MB
Successfully verified installer hash
Starting package install...
Successfully installed

PS > winget install --silent --id Microsoft.DotNet.DesktopRuntime.6 --version 6.0.33 --architecture x86

Found an existing package already installed. Trying to upgrade the installed package...
Found Microsoft .NET Windows Desktop Runtime 6.0 [Microsoft.DotNet.DesktopRuntime.6] Version 6.0.33
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://dotnetcli.azureedge.net/dotnet/WindowsDesktop/6.0.33/windowsdesktop-runtime-6.0.33-win-x86.exe
  ██████████████████████████████  50.2 MB / 50.2 MB
Successfully verified installer hash
Starting package install...
Successfully installed

PS >

Now try to either upgrade or uninstall just x64.

PS > winget list Microsoft.DotNet.DesktopRuntime.6

Name                                             Id                                Version Source
--------------------------------------------------------------------------------------------------
Microsoft Windows Desktop Runtime - 6.0.33 (x86) Microsoft.DotNet.DesktopRuntime.6 6.0.33  winget
Microsoft Windows Desktop Runtime - 6.0.31 (x64) Microsoft.DotNet.DesktopRuntime.6 6.0.31  winget

PS > winget upgrade --silent --id Microsoft.DotNet.DesktopRuntime.6 --architecture x64

No available upgrade found.
No newer package versions are available from the configured sources.

PS > winget install --silent --id Microsoft.DotNet.DesktopRuntime.6 --version 6.0.33 --architecture x64

Found an existing package already installed. Trying to upgrade the installed package...
No available upgrade found.
No newer package versions are available from the configured sources.

PS >

Output of winget upgrade --silent --exact --id Microsoft.DotNet.DesktopRuntime.6 --architecture x64 with WinGet v1.8.1911.

Click to view ```log 2024-09-16 11:59:52.501 [CORE] WinGet, version [1.8.1911], activity [{36B51B6C-0D75-468F-B56A-A3638C1EDAE4}] 2024-09-16 11:59:52.502 [CORE] OS: Windows.Desktop v10.0.22631.4169 2024-09-16 11:59:52.502 [CORE] Command line Args: "C:\Users\olav.birkeland\AppData\Local\Microsoft\WindowsApps\winget.exe" upgrade --silent --exact --id Microsoft.DotNet.DesktopRuntime.6 --architecture x64 2024-09-16 11:59:52.502 [CORE] Package: Microsoft.DesktopAppInstaller v1.23.1911.0 2024-09-16 11:59:52.502 [CORE] IsCOMCall:0; Caller: winget-cli 2024-09-16 11:59:52.515 [CLI ] WinGet invoked with arguments: 'upgrade' '--silent' '--exact' '--id' 'Microsoft.DotNet.DesktopRuntime.6' '--architecture' 'x64' 2024-09-16 11:59:52.516 [CLI ] Found subcommand: upgrade 2024-09-16 11:59:52.516 [CLI ] Leaf command to execute: root:upgrade 2024-09-16 11:59:52.523 [CLI ] Executing command: upgrade 2024-09-16 11:59:52.530 [REPO] Default source requested, multiple sources available, adding all to source references. 2024-09-16 11:59:52.530 [REPO] Adding to source references msstore 2024-09-16 11:59:52.531 [CORE] Default proxy is not set 2024-09-16 11:59:52.531 [REPO] REST HTTP Client helper does not use proxy 2024-09-16 11:59:52.531 [REPO] Adding to source references winget 2024-09-16 11:59:52.531 [CLI ] Created authentication arguments. Mode: silentPreferred, Account: 2024-09-16 11:59:52.545 [CORE] Examining extension: PFN = Microsoft.Winget.Source_8wekyb3d8bbwe, ID = IndexDB 2024-09-16 11:59:52.545 [CORE] Found matching extension. 2024-09-16 11:59:52.549 [REPO] Multiple sources available, creating aggregated source. 2024-09-16 11:59:52.549 [REPO] Adding to aggregated source: msstore 2024-09-16 11:59:52.549 [REPO] Sending http GET request to: https://storeedgefd.dsx.mp.microsoft.com/v9.0/information 2024-09-16 11:59:52.882 [REPO] Response status: 200 2024-09-16 11:59:52.883 [REPO] Authentication node not found. Assuming authentication type none. 2024-09-16 11:59:52.884 [REPO] Sending http GET request to: https://storeedgefd.dsx.mp.microsoft.com/v9.0/information 2024-09-16 11:59:53.000 [REPO] Response status: 200 2024-09-16 11:59:53.001 [REPO] Authentication node not found. Assuming authentication type none. 2024-09-16 11:59:53.001 [REPO] Adding to aggregated source: winget 2024-09-16 11:59:53.013 [CORE] Examining extension: PFN = Microsoft.Winget.Source_8wekyb3d8bbwe, ID = IndexDB 2024-09-16 11:59:53.013 [CORE] Found matching extension. 2024-09-16 11:59:53.067 [REPO] Opening database for ImmutableRead at 'C:\Program Files\WindowsApps\Microsoft.Winget.Source_2024.916.1035.45_neutral__8wekyb3d8bbwe\Public\index.db' 2024-09-16 11:59:53.068 [REPO] Opened SQLite Index with version [2.0], last write [2024-09-16 11:33:30.000] 2024-09-16 11:59:53.712 [REPO] Creating new SQLite Index with version [Latest] at ':memory:' 2024-09-16 11:59:53.715 [REPO] Reading MSI UpgradeCodes 2024-09-16 11:59:53.804 [REPO] Reading MSI UpgradeCodes 2024-09-16 11:59:54.598 [REPO] Opening database for ReadWrite at 'C:\Users\olav.birkeland\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\StoreEdgeFD\installed.db' 2024-09-16 11:59:54.598 [REPO] Opened SQLite Index with version [1.7], last write [2024-03-13 15:54:31.000] 2024-09-16 11:59:54.795 [REPO] Sending http GET request to: https://storeedgefd.dsx.mp.microsoft.com/v9.0/packageManifests/Microsoft.DotNet.DesktopRuntime.6?Market=NO 2024-09-16 11:59:54.913 [REPO] Response status: 200 2024-09-16 11:59:54.926 [REPO] Opening database for ReadWrite at 'C:\Users\olav.birkeland\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\Microsoft.Winget.Source_8wekyb3d8bbwe\installed.db' 2024-09-16 11:59:54.927 [REPO] Opened SQLite Index with version [1.7], last write [2024-09-16 09:24:19.000] 2024-09-16 11:59:55.172 [CLI ] Found one app. App id: Microsoft.DotNet.DesktopRuntime.6 App name: Microsoft .NET Windows Desktop Runtime 6.0 2024-09-16 11:59:55.182 [REPO] Attempting to open pinning database: C:\Users\olav.birkeland\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\pinning.db 2024-09-16 11:59:55.182 [REPO] ... opening existing pinning database 2024-09-16 11:59:55.182 [REPO] Opening database for Read at 'C:\Users\olav.birkeland\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\pinning.db' 2024-09-16 11:59:55.183 [REPO] Opened Pinning Index with version [1.0], last write [2024-05-24 10:42:55.000] 2024-09-16 11:59:55.195 [CLI ] Terminating context: 0x8a15002b at C:\__w\1\s\external\pkg\src\AppInstallerCLICore\Workflows\UpdateFlow.cpp:be ```

From the logs it does not seem like it differentiates on architecture? 🤔

Given how WinGet works right now it'd probably work better with one ID per architecture (Microsoft.DotNet.DesktopRuntime.6.x86, Microsoft.DotNet.DesktopRuntime.6.x64 etc.).


Edit: Upgrade with full name seems to work, but look at what URL it fetches. 🤦‍♂️

PS > winget upgrade "Microsoft Windows Desktop Runtime - 6.0.31 (x64)"

Found Microsoft .NET Windows Desktop Runtime 6.0 [Microsoft.DotNet.DesktopRuntime.6] Version 6.0.33
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://dotnetcli.azureedge.net/dotnet/WindowsDesktop/6.0.33/windowsdesktop-runtime-6.0.33-win-x86.exe
  ██████████████████████████████  50.2 MB / 50.2 MB
Successfully verified installer hash
Starting package install...
Successfully installed

PS >
Logs ```log 2024-09-16 12:14:05.512 [CORE] WinGet, version [1.8.1911], activity [{CDFE7B5F-9D1F-43C6-B981-90FEC6B8B8B5}] 2024-09-16 12:14:05.512 [CORE] OS: Windows.Desktop v10.0.22631.4169 2024-09-16 12:14:05.512 [CORE] Command line Args: "C:\Users\olav.birkeland\AppData\Local\Microsoft\WindowsApps\winget.exe" upgrade "Microsoft Windows Desktop Runtime - 6.0.31 (x64)" --silent --logs 2024-09-16 12:14:05.512 [CORE] Package: Microsoft.DesktopAppInstaller v1.23.1911.0 2024-09-16 12:14:05.512 [CORE] IsCOMCall:0; Caller: winget-cli 2024-09-16 12:14:05.525 [CLI ] WinGet invoked with arguments: 'upgrade' 'Microsoft Windows Desktop Runtime - 6.0.31 (x64)' '--silent' '--logs' 2024-09-16 12:14:05.525 [CLI ] Found subcommand: upgrade 2024-09-16 12:14:05.525 [CLI ] Leaf command to execute: root:upgrade 2024-09-16 12:14:05.531 [CLI ] Executing command: upgrade 2024-09-16 12:14:05.538 [REPO] Default source requested, multiple sources available, adding all to source references. 2024-09-16 12:14:05.539 [REPO] Adding to source references msstore 2024-09-16 12:14:05.539 [CORE] Default proxy is not set 2024-09-16 12:14:05.539 [REPO] REST HTTP Client helper does not use proxy 2024-09-16 12:14:05.539 [REPO] Adding to source references winget 2024-09-16 12:14:05.539 [CLI ] Created authentication arguments. Mode: silentPreferred, Account: 2024-09-16 12:14:05.553 [CORE] Examining extension: PFN = Microsoft.Winget.Source_8wekyb3d8bbwe, ID = IndexDB 2024-09-16 12:14:05.553 [CORE] Found matching extension. 2024-09-16 12:14:05.557 [REPO] Multiple sources available, creating aggregated source. 2024-09-16 12:14:05.557 [REPO] Adding to aggregated source: msstore 2024-09-16 12:14:05.557 [REPO] Sending http GET request to: https://storeedgefd.dsx.mp.microsoft.com/v9.0/information 2024-09-16 12:14:05.732 [REPO] Response status: 200 2024-09-16 12:14:05.732 [REPO] Authentication node not found. Assuming authentication type none. 2024-09-16 12:14:05.733 [REPO] Sending http GET request to: https://storeedgefd.dsx.mp.microsoft.com/v9.0/information 2024-09-16 12:14:05.786 [REPO] Response status: 200 2024-09-16 12:14:05.786 [REPO] Authentication node not found. Assuming authentication type none. 2024-09-16 12:14:05.786 [REPO] Adding to aggregated source: winget 2024-09-16 12:14:05.794 [CORE] Examining extension: PFN = Microsoft.Winget.Source_8wekyb3d8bbwe, ID = IndexDB 2024-09-16 12:14:05.794 [CORE] Found matching extension. 2024-09-16 12:14:05.842 [REPO] Opening database for ImmutableRead at 'C:\Program Files\WindowsApps\Microsoft.Winget.Source_2024.916.1035.45_neutral__8wekyb3d8bbwe\Public\index.db' 2024-09-16 12:14:05.843 [REPO] Opened SQLite Index with version [2.0], last write [2024-09-16 11:33:30.000] 2024-09-16 12:14:06.442 [REPO] Creating new SQLite Index with version [Latest] at ':memory:' 2024-09-16 12:14:06.449 [REPO] Reading MSI UpgradeCodes 2024-09-16 12:14:06.541 [REPO] Reading MSI UpgradeCodes 2024-09-16 12:14:07.340 [REPO] Opening database for ReadWrite at 'C:\Users\olav.birkeland\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\StoreEdgeFD\installed.db' 2024-09-16 12:14:07.341 [REPO] Opened SQLite Index with version [1.7], last write [2024-03-13 15:54:31.000] 2024-09-16 12:14:07.538 [REPO] Opening database for ReadWrite at 'C:\Users\olav.birkeland\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\Microsoft.Winget.Source_8wekyb3d8bbwe\installed.db' 2024-09-16 12:14:07.539 [REPO] Opened SQLite Index with version [1.7], last write [2024-09-16 09:24:19.000] 2024-09-16 12:14:07.725 [REPO] Found multiple matches for installed package [ARP\Machine\X86\{1a7abdc5-639b-4af0-87c6-dbc511750c6e}] in source [Microsoft.Winget.Source_8wekyb3d8bbwe] when searching for [Query:[none] Include:ProductCode='{1a7abdc5-639b-4af0-87c6-dbc511750c6e}'[Exact] Include:NormalizedNameAndPublisher='microsoftwindowsdesktopruntime'+'microsoft'[Exact] Include:NormalizedNameAndPublisher='microsoftwindowsdesktopruntime(x64)'+'microsoft'[Exact]] 2024-09-16 12:14:07.726 [REPO] Checking match with package id: Microsoft.DotNet.DesktopRuntime.3_1 2024-09-16 12:14:07.726 [REPO] Checking match with package id: Microsoft.DotNet.DesktopRuntime.5 2024-09-16 12:14:07.726 [REPO] Checking match with package id: Microsoft.DotNet.DesktopRuntime.6 2024-09-16 12:14:07.726 [REPO] Checking match with package id: Microsoft.DotNet.DesktopRuntime.7 2024-09-16 12:14:07.726 [REPO] Checking match with package id: Microsoft.DotNet.DesktopRuntime.8 2024-09-16 12:14:07.726 [REPO] Checking match with package id: Microsoft.DotNet.DesktopRuntime.Preview 2024-09-16 12:14:07.726 [REPO] Appropriate available package could not be determined 2024-09-16 12:14:07.731 [REPO] Sending http POST request to: https://storeedgefd.dsx.mp.microsoft.com/v9.0/manifestSearch 2024-09-16 12:14:07.775 [REPO] Response status: 200 2024-09-16 12:14:07.778 [CLI ] Found one app. App id: Microsoft.DotNet.DesktopRuntime.6 App name: Microsoft .NET Windows Desktop Runtime 6.0 2024-09-16 12:14:07.791 [REPO] Attempting to open pinning database: C:\Users\olav.birkeland\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\pinning.db 2024-09-16 12:14:07.792 [REPO] ... opening existing pinning database 2024-09-16 12:14:07.792 [REPO] Opening database for Read at 'C:\Users\olav.birkeland\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\pinning.db' 2024-09-16 12:14:07.793 [REPO] Opened Pinning Index with version [1.0], last write [2024-05-24 10:42:55.000] 2024-09-16 12:14:07.796 [CLI ] Manifest fields: Name [Microsoft .NET Windows Desktop Runtime 6.0], Version [6.0.33] 2024-09-16 12:14:08.195 [CLI ] Generated temp download path: C:\Users\OLAV~1.BIR\AppData\Local\Temp\WinGet\Microsoft.DotNet.DesktopRuntime.6.6.0.33\15e99cd7ef4d705ed348b966da16cbe4873767eb8474729cad277015ca5d422c 2024-09-16 12:14:08.196 [CORE] Downloading to path: C:\Users\OLAV~1.BIR\AppData\Local\Temp\WinGet\Microsoft.DotNet.DesktopRuntime.6.6.0.33\15e99cd7ef4d705ed348b966da16cbe4873767eb8474729cad277015ca5d422c 2024-09-16 12:14:08.197 [CORE] DeliveryOptimization downloading from url: https://dotnetcli.azureedge.net/dotnet/WindowsDesktop/6.0.33/windowsdesktop-runtime-6.0.33-win-x86.exe 2024-09-16 12:14:16.809 [CORE] Download completed. 2024-09-16 12:14:16.881 [CORE] Started applying motw to C:\Users\OLAV~1.BIR\AppData\Local\Temp\WinGet\Microsoft.DotNet.DesktopRuntime.6.6.0.33\15e99cd7ef4d705ed348b966da16cbe4873767eb8474729cad277015ca5d422c with zone: 3 2024-09-16 12:14:16.885 [CORE] Finished applying motw 2024-09-16 12:14:16.886 [CLI ] Installer hash verified 2024-09-16 12:14:16.886 [CORE] Started applying motw to C:\Users\OLAV~1.BIR\AppData\Local\Temp\WinGet\Microsoft.DotNet.DesktopRuntime.6.6.0.33\15e99cd7ef4d705ed348b966da16cbe4873767eb8474729cad277015ca5d422c with zone: 2 2024-09-16 12:14:16.888 [CORE] Finished applying motw 2024-09-16 12:14:16.889 [CLI ] Successfully renamed downloaded installer. Path: C:\Users\OLAV~1.BIR\AppData\Local\Temp\WinGet\Microsoft.DotNet.DesktopRuntime.6.6.0.33\windowsdesktop-runtime-6.0.33-win-x86.exe 2024-09-16 12:14:16.889 [REPO] Creating new SQLite Index with version [Latest] at ':memory:' 2024-09-16 12:14:16.892 [REPO] Reading MSI UpgradeCodes 2024-09-16 12:14:16.978 [REPO] Reading MSI UpgradeCodes 2024-09-16 12:14:17.310 [CLI ] Installer args: /quiet /log "C:\Users\olav.birkeland\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir\WinGet-Microsoft.DotNet.DesktopRuntime.6.6.0.33-2024-09-16-12-14-17.310.log" /norestart 2024-09-16 12:14:17.311 [CLI ] Starting: 'C:\Users\OLAV~1.BIR\AppData\Local\Temp\WinGet\Microsoft.DotNet.DesktopRuntime.6.6.0.33\windowsdesktop-runtime-6.0.33-win-x86.exe' with arguments '/quiet /log "C:\Users\olav.birkeland\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir\WinGet-Microsoft.DotNet.DesktopRuntime.6.6.0.33-2024-09-16-12-14-17.310.log" /norestart' 2024-09-16 12:14:37.986 [REPO] Creating new SQLite Index with version [Latest] at ':memory:' 2024-09-16 12:14:37.998 [REPO] Reading MSI UpgradeCodes 2024-09-16 12:14:38.095 [REPO] Reading MSI UpgradeCodes 2024-09-16 12:14:38.341 [CLI ] During package install, 0 changes to ARP were observed, 4 matches were found for the package, and 0 packages were in both 2024-09-16 12:14:38.341 [CLI ] No single entry was determined to be associated with the package 2024-09-16 12:14:38.349 [REPO] Opening database for ReadWrite at 'C:\Users\olav.birkeland\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\Microsoft.Winget.Source_8wekyb3d8bbwe\installed.db' 2024-09-16 12:14:38.350 [REPO] Opened SQLite Index with version [1.7], last write [2024-09-16 09:24:19.000] 2024-09-16 12:14:38.561 [CLI ] Removing installer: C:\Users\OLAV~1.BIR\AppData\Local\Temp\WinGet\Microsoft.DotNet.DesktopRuntime.6.6.0.33\windowsdesktop-runtime-6.0.33-win-x86.exe 2024-09-16 12:14:38.714 [CLI ] Leaf command succeeded: root:upgrade ```

Edit 2: Add --architecture to previous command and it works.

PS > winget upgrade "Microsoft Windows Desktop Runtime - 6.0.31 (x64)" --silent --architecture x64

Found Microsoft .NET Windows Desktop Runtime 6.0 [Microsoft.DotNet.DesktopRuntime.6] Version 6.0.33
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://dotnetcli.azureedge.net/dotnet/WindowsDesktop/6.0.33/windowsdesktop-runtime-6.0.33-win-x64.exe
  ██████████████████████████████  55.1 MB / 55.1 MB
Successfully verified installer hash
Starting package install...
Successfully installed

PS >