Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple installed versions of .NET Desktop Runtime are incorrectly matched when running winget upgrade. #4158

Open
MaanuelMM opened this issue Feb 9, 2024 · 9 comments
Labels
Area-Matching Issue related to correlation between installed package and manifest Command-Upgrade Issue related to WinGet Upgrade Issue-Bug It either shouldn't be doing this or needs an investigation.

Comments

@MaanuelMM
Copy link

Brief description of your issue

When multiple versions of Microsoft .NET Desktop Runtime are installed under certain circumstances (see below), WinGet CLI will incorrectly identify some of them, offering an update that it should not.

Steps to reproduce

First of all, I should comment that this has supposedly happened as a result of a Lenovo Vantage Service update due to dependencies it has with both Microsoft ASP.NET Core 7.0.15 - Shared Framework (x64) and Microsoft Windows Desktop Runtime - 7.0.15 (x64) and which I have managed to successfully recreate on a relatively fresh Windows 10 Version 22H2 virtual machine running on Hyper-V.

With that said, here are the step-by-step instructions on how to reproduce it:

  1. Install .NET Desktop Runtime 6.0 with WinGet: winget install Microsoft.DotNet.DesktopRuntime.6.
  2. Install .NET Desktop Runtime 7.0 but instead of using WinGet, download the installer from the official website and install it manually (be sure it's the Desktop Runtime and matching architecture).
  3. Now, run winget upgrade and see that an update is offered, however, it is for Microsoft.DotNet.DesktopRuntime.6 trying to update to .NET 7.0 (looks like a mismatch):
Name                                             Id                                Version  Available Source
------------------------------------------------------------------------------------------------------------
Microsoft Windows Desktop Runtime - 7.0.15 (x64) Microsoft.DotNet.DesktopRuntime.6 > 6.0.26 7.0.15    winget
  1. If we now uninstall Microsoft Windows Desktop Runtime - 7.0.15 from Settings or Control Panel and run winget upgrade again, it will report no updates available, as it should:
No installed package found matching input criteria.

Diving into the WinGet logs, I have detected the following:

2024-02-09 22:00:00.928 [REPO] Finding available package from installed package using system reference search: Query:[none] Include:ProductCode='{678ecfdb-8552-4dd3-9bd7-ed16b0f23ae2}'[Exact] Include:NormalizedNameAndPublisher='microsoftwindowsdesktopruntime'+'microsoft'[Exact] Include:NormalizedNameAndPublisher='microsoftwindowsdesktopruntime(x64)'+'microsoft'[Exact]
2024-02-09 22:00:00.964 [REPO] Found multiple matches for installed package [{678ecfdb-8552-4dd3-9bd7-ed16b0f23ae2}] in source [Microsoft.Winget.Source_8wekyb3d8bbwe] when searching for [Query:[none] Include:ProductCode='{678ecfdb-8552-4dd3-9bd7-ed16b0f23ae2}'[Exact] Include:NormalizedNameAndPublisher='microsoftwindowsdesktopruntime'+'microsoft'[Exact] Include:NormalizedNameAndPublisher='microsoftwindowsdesktopruntime(x64)'+'microsoft'[Exact]]
2024-02-09 22:00:00.965 [REPO]   Checking match with package id: Microsoft.DotNet.DesktopRuntime.7
2024-02-09 22:00:00.966 [REPO]   Checking match with package id: Microsoft.DotNet.DesktopRuntime.Preview
2024-02-09 22:00:00.967 [REPO]   Checking match with package id: Microsoft.DotNet.DesktopRuntime.8
2024-02-09 22:00:00.968 [REPO]   Checking match with package id: Microsoft.DotNet.DesktopRuntime.6
2024-02-09 22:00:00.968 [REPO]   Checking match with package id: Microsoft.DotNet.DesktopRuntime.5
2024-02-09 22:00:00.969 [REPO]   Checking match with package id: Microsoft.DotNet.DesktopRuntime.3_1
[...]
2024-02-09 22:00:01.025 [REPO] Finding available package from installed package using system reference search: Query:[none] Include:ProductCode='{b2476903-b8da-4dcc-903f-378730bb4c48}'[Exact] Include:NormalizedNameAndPublisher='microsoftwindowsdesktopruntime'+'microsoft'[Exact] Include:NormalizedNameAndPublisher='microsoftwindowsdesktopruntime(x64)'+'microsoft'[Exact]
2024-02-09 22:00:01.056 [REPO] Found multiple matches for installed package [{b2476903-b8da-4dcc-903f-378730bb4c48}] in source [Microsoft.Winget.Source_8wekyb3d8bbwe] when searching for [Query:[none] Include:ProductCode='{b2476903-b8da-4dcc-903f-378730bb4c48}'[Exact] Include:NormalizedNameAndPublisher='microsoftwindowsdesktopruntime'+'microsoft'[Exact] Include:NormalizedNameAndPublisher='microsoftwindowsdesktopruntime(x64)'+'microsoft'[Exact]]
2024-02-09 22:00:01.057 [REPO]   Checking match with package id: Microsoft.DotNet.DesktopRuntime.6
2024-02-09 22:00:01.057 [REPO]   Checking match with package id: Microsoft.DotNet.DesktopRuntime.Preview
2024-02-09 22:00:01.058 [REPO]   Checking match with package id: Microsoft.DotNet.DesktopRuntime.8
2024-02-09 22:00:01.058 [REPO]   Checking match with package id: Microsoft.DotNet.DesktopRuntime.7
2024-02-09 22:00:01.058 [REPO]   Checking match with package id: Microsoft.DotNet.DesktopRuntime.5
2024-02-09 22:00:01.059 [REPO]   Checking match with package id: Microsoft.DotNet.DesktopRuntime.3_1
2024-02-09 22:00:01.068 [REPO] Opening pinning index
2024-02-09 22:00:01.068 [REPO] Opening existing pinning index
2024-02-09 22:00:01.068 [REPO] Opening SQLite Index for ReadWrite at 'C:\Users\test\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\pinning.db'
2024-02-09 22:00:01.068 [SQL ] Opening SQLite connection #6: 'C:\Users\test\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\pinning.db' [2, 0]
2024-02-09 22:00:01.070 [REPO] Opened Pinning Index with version [1.0], last write [2023-12-26 15:10:19.000]
2024-02-09 22:00:01.123 [REPO] Did not find a Version for { 7.0.15 }
2024-02-09 22:00:01.124 [REPO] Did not find a Version for { 7.0.15 }
2024-02-09 22:00:01.151 [CLI ] Leaf command succeeded: root:upgrade

The interesting part here is that there are multiple possible matches but there's no Appropriate available package could not be determined message, and then seems to be that it's calling on pinning.db and that's where it maybe determines that .NET 6.0 was installed previously with WinGet so it (mis)match the .NET 7.0 installation as a .NET 6.0 installation too? I don't really know.

Expected behavior

It should detect Microsoft Windows Desktop Runtime - 7.0.15 as Microsoft.DotNet.DesktopRuntime.7 instead of Microsoft.DotNet.DesktopRuntime.6.

Actual behavior

It mismatch the Microsoft Windows Desktop Runtime - 7.0.15 package ID because it was installed without WinGet and there's another version that was installed previously using WinGet.

Environment

Windows Package Manager v1.6.3482
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.19045.3930
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.21.3482.0

Winget Directories
-------------------------------------------------------------------------------------------------------------------------------
Logs                               %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir
User Settings                      %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json
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                        Enabled
BypassCertificatePinningForMicrosoftStore Disabled
InstallerHashOverride                     Disabled
LocalArchiveMalwareScanOverride           Disabled
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Triage Issue need to be triaged label Feb 9, 2024
Copy link

github-actions bot commented Feb 9, 2024

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@MaanuelMM
Copy link
Author

Regarding this, I've noticed .NET installations have a property in the Windows registry called BundleUpgradeCode, however, according to the WinGet logs, this value never seems to be taken into account when matching, so I understand that this could be where the wrong matching is coming from because, as far as I know, upgrade codes are used for tracking upgrades (as on Windows Installer).

image

@stephengillie stephengillie added Issue-Feature This is a feature request for the Windows Package Manager client. and removed Needs-Triage Issue need to be triaged labels Feb 12, 2024
@Trenly
Copy link
Contributor

Trenly commented Mar 6, 2024

[Policy] Issue-Bug
[Policy] Area-Matching
[Policy] Command-Upgrade

@microsoft-github-policy-service microsoft-github-policy-service bot added Area-Matching Issue related to correlation between installed package and manifest Command-Upgrade Issue related to WinGet Upgrade Issue-Bug It either shouldn't be doing this or needs an investigation. and removed Issue-Feature This is a feature request for the Windows Package Manager client. labels Mar 6, 2024
@grimson73
Copy link

grimson73 commented Mar 20, 2024

winget list .net
Name                                                   Id                                               Version     Source
---------------------------------------------------------------------------------------------------------------------------
Microsoft ASP.NET Core 7.0.17 - Shared Framework (x64) Microsoft.DotNet.AspNetCore.7                    7.0.17      winget
Microsoft ASP.NET Core 8.0.3 - Shared Framework (x64)  Microsoft.DotNet.AspNetCore.8                    8.0.3       winget
Microsoft Windows Desktop Runtime - 7.0.17 (x64)       Microsoft.DotNet.DesktopRuntime.7                7.0.17      winget
Microsoft Windows Desktop Runtime - 8.0.3 (x64)        Microsoft.DotNet.DesktopRuntime.8                8.0.3       winget
Microsoft .Net Native Framework Package 2.2            Microsoft.NET.Native.Framework.2.2_8wekyb3d8bbwe 2.2.29512.0
Microsoft .Net Native Runtime Package 2.2              Microsoft.NET.Native.Runtime.2.2_8wekyb3d8bbwe   2.2.28604.0
Microsoft .Net Native Framework Package 1.7            Microsoft.NET.Native.Framework.1.7_8wekyb3d8bbwe 1.7.27413.0
Microsoft .Net Native Runtime Package 1.7              Microsoft.NET.Native.Runtime.1.7_8wekyb3d8bbwe   1.7.27422.0
Microsoft .NET Core SDK Uninstall Tool (x86)           Microsoft.DotNet.UninstallTool                   4.96.657    winget

winget update
Name                                            Id                                Version  Available Source
-----------------------------------------------------------------------------------------------------------
Microsoft Windows Desktop Runtime - 8.0.3 (x64) Microsoft.DotNet.DesktopRuntime.7 > 7.0.17 8.0.3     winget
1 upgrades available.

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

Windows: Windows.Desktop v10.0.22631.3296
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.22.10661.0

Winget Directories
-------------------------------------------------------------------------------------------------------------------------------
Logs                               %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir
User Settings                      %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json
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

Same issue with Microsoft.DotNet.DesktopRuntime.7 -> 8. Strangely not for 'Microsoft.DotNet.AspNetCore.7 -> 8'

@grimson73
Copy link

grimson73 commented Mar 20, 2024

After fiddling around and (also) running:
Get-AppxPackage Microsoft.DesktopAppInstaller | Reset-AppxPackage

Seems that the '7 -> 8 upgrade' isn't showing anymore:

winget list .net
Name                                                   Id                                               Version     Source
---------------------------------------------------------------------------------------------------------------------------
Microsoft ASP.NET Core 7.0.17 - Shared Framework (x64) Microsoft.DotNet.AspNetCore.7                    7.0.17      winget
Microsoft ASP.NET Core 8.0.3 - Shared Framework (x64)  Microsoft.DotNet.AspNetCore.8                    8.0.3       winget
Microsoft Windows Desktop Runtime - 8.0.3 (x64)        Microsoft.DotNet.DesktopRuntime.8                8.0.3       winget
Microsoft Windows Desktop Runtime - 7.0.17 (x64)       Microsoft.DotNet.DesktopRuntime.7                7.0.17      winget
Microsoft .Net Native Framework Package 2.2            Microsoft.NET.Native.Framework.2.2_8wekyb3d8bbwe 2.2.29512.0
Microsoft .Net Native Runtime Package 2.2              Microsoft.NET.Native.Runtime.2.2_8wekyb3d8bbwe   2.2.28604.0
Microsoft .Net Native Framework Package 1.7            Microsoft.NET.Native.Framework.1.7_8wekyb3d8bbwe 1.7.27413.0
Microsoft .Net Native Runtime Package 1.7              Microsoft.NET.Native.Runtime.1.7_8wekyb3d8bbwe   1.7.27422.0
Microsoft .NET Core SDK Uninstall Tool (x86)           Microsoft.DotNet.UninstallTool                   4.96.657    winget

winget upgrade
No installed package found matching input criteria.

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

Windows: Windows.Desktop v10.0.22631.3296
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.22.10661.0

@denelon
Copy link
Contributor

denelon commented Mar 25, 2024

We're doing some work to handle side-by-side installed packages better.

I'm expecting a WinGet 1.8-preview release with the experimental feature to be available soon.

@akrymskiy
Copy link

After fiddling around and (also) running: Get-AppxPackage Microsoft.DesktopAppInstaller | Reset-AppxPackage

Seems that the '7 -> 8 upgrade' isn't showing anymore:

Thank you! This fixed it for me also!

@soredake
Copy link

soredake commented Apr 3, 2024

No change for me with this new preview version and sideBySide set to true.

@denelon
Copy link
Contributor

denelon commented Apr 3, 2024

Just posting for others who find this issue:

We've been working on the side-by-side scenarios. You could try the latest release and enable the experimental feature on:

Please provide feedback at:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Matching Issue related to correlation between installed package and manifest Command-Upgrade Issue related to WinGet Upgrade Issue-Bug It either shouldn't be doing this or needs an investigation.
Projects
None yet
Development

No branches or pull requests

7 participants