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

[Package Issue]: Microsoft.VCRedist.2012.x64 points to x86 version! #97053

Closed
2 tasks done
K8-and-a-half-1000 opened this issue Feb 17, 2023 · 26 comments
Closed
2 tasks done
Labels
Help-Wanted This is a good candidate work item from the community. Issue-Bug It either shouldn't be doing this or needs an investigation.

Comments

@K8-and-a-half-1000
Copy link

K8-and-a-half-1000 commented Feb 17, 2023

Please confirm these before moving forward

  • I have searched for my issue and not found a work-in-progress/duplicate/resolved issue.
  • I have not been informed if the issue is resolved in a preview version of the winget client.

Category of the issue

Installation issue.

Brief description of your issue

If I run: winget install -e --id=Microsoft.VCRedist.2012.x64
or: winget install -e --name='Microsoft Visual C++ 2012 Redistributable (x64)'

winget only installs the x86 version of this package!
This is breaking some orchestration scripts I maintain, please fix this ASAP.
As a workaround, I need to download and install the x64 via powershell, which is not ideal.

Steps to reproduce

If I run: winget install -e --id=Microsoft.VCRedist.2012.x64
or: winget install -e --name='Microsoft Visual C++ 2012 Redistributable (x64)'

Actual behavior

winget installs the x86 version.

Expected behavior

winget installs the x64 version.

Environment

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

Windows: Windows.Desktop v10.0.22621.1194
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.19.10173.0

Screenshots and Logs

No response

@K8-and-a-half-1000 K8-and-a-half-1000 added the Issue-Bug It either shouldn't be doing this or needs an investigation. label Feb 17, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Triage This work item needs to be triaged by a member of the core team. label Feb 17, 2023
@Trenly
Copy link
Contributor

Trenly commented Feb 17, 2023

Can you share your install logs and the full output from winget list "2012 Redistributable"?

According to the manifest, the only installer in VCRedist.2012.x64 is the x64 version

Installers:
- Architecture: x64
InstallerUrl: https://download.microsoft.com/download/1/6/B/16B06F60-3B20-4FF2-B699-5E9B7962F9AE/VSU_4/vcredist_x64.exe
InstallerSha256: 681BE3E5BA9FD3DA02C09D7E565ADFA078640ED66A0D58583EFAD2C1E3CC4064
ProductCode: '{ca67548a-5ebe-413a-b50c-4b9ceb6d66c6}'
ManifestType: installer

@K8-and-a-half-1000
Copy link
Author

Sure thing.

PS C:\> winget list "2012 Redistributable"
Name                                                         Id                          Version      Source
-------------------------------------------------------------------------------------------------------------
Microsoft Visual C++ 2012 Redistributable (x86) - 11.0.61030 Microsoft.VCRedist.2012.x86 11.0.61030.0 winget
PS C:\>

And if I do it with the x64 specification, I get a weird mashup.

PS C:\> winget list -e 'Microsoft Visual C++ 2012 Redistributable (x64)'
Name                                                         Id                          Version      Source
-------------------------------------------------------------------------------------------------------------
Microsoft Visual C++ 2012 Redistributable (x86) - 11.0.61030 Microsoft.VCRedist.2012.x64 11.0.61030.0 winget
PS C:\>

Add and remove programs list confirms that only the 2012 x86 package is installed.

@K8-and-a-half-1000
Copy link
Author

K8-and-a-half-1000 commented Feb 17, 2023

Some code is obviously altering the (x64) specification, and it's not handled properly.

These are the logs for installing the x64 package:

2023-02-17 12:21:24.499 [CORE] WinGet, version [1.4.10173], activity [{1F6A7848-6D66-461D-9D9C-C55BB4E505AA}]
2023-02-17 12:21:24.499 [CORE] OS: Windows.Desktop v10.0.22621.1194
2023-02-17 12:21:24.499 [CORE] Command line Args: "C:\Users\root\AppData\Local\Microsoft\WindowsApps\winget.exe" install -e --name= "Microsoft Visual C++ 2012 Redistributable (x64)"
2023-02-17 12:21:24.499 [CORE] Package: Microsoft.DesktopAppInstaller v1.19.10173.0
2023-02-17 12:21:24.499 [CORE] IsCOMCall:0; Caller: winget-cli
2023-02-17 12:21:24.501 [CLI ] WinGet invoked with arguments: 'install' '-e' '--name=' 'Microsoft Visual C++ 2012 Redistributable (x64)'
2023-02-17 12:21:24.502 [CLI ] Found subcommand: install
2023-02-17 12:21:24.502 [CLI ] Leaf command to execute: root:install
2023-02-17 12:21:24.505 [CLI ] Executing command: install
2023-02-17 12:21:24.515 [REPO] GetCurrentSourceRefs: Source named 'microsoft.builtin.desktop.frameworks' from origin Default is hidden and is dropped.
2023-02-17 12:21:24.515 [REPO] Default source requested, multiple sources available, adding all to source references.
2023-02-17 12:21:24.515 [REPO] Adding to source references msstore
2023-02-17 12:21:24.515 [REPO] Adding to source references winget
2023-02-17 12:21:24.515 [REPO] Source past auto update time [5 mins]; it has been at least 9 mins
2023-02-17 12:21:24.515 [REPO] Source past auto update time [5 mins]; it has been at least 9 mins
2023-02-17 12:21:24.854 [CORE] Examining extension: PFN = Microsoft.Winget.Source_8wekyb3d8bbwe, ID = IndexDB
2023-02-17 12:21:24.854 [CORE] Found matching extension.
2023-02-17 12:21:24.856 [REPO] Remote source data was not newer than existing, no update needed
2023-02-17 12:21:24.861 [REPO] Multiple sources available, creating aggregated source.
2023-02-17 12:21:24.861 [REPO] Adding to aggregated source: msstore
2023-02-17 12:21:24.861 [REPO] Sending http GET request to: https://storeedgefd.dsx.mp.microsoft.com/v9.0/information
2023-02-17 12:21:24.970 [REPO] Response status: 200
2023-02-17 12:21:24.970 [REPO] Sending http GET request to: https://storeedgefd.dsx.mp.microsoft.com/v9.0/information
2023-02-17 12:21:24.988 [REPO] Response status: 200
2023-02-17 12:21:24.988 [REPO] Adding to aggregated source: winget
2023-02-17 12:21:24.995 [CORE] Examining extension: PFN = Microsoft.Winget.Source_8wekyb3d8bbwe, ID = IndexDB
2023-02-17 12:21:24.995 [CORE] Found matching extension.
2023-02-17 12:21:25.008 [REPO] Opening SQLite Index for ImmutableRead at 'C:\Program Files\WindowsApps\Microsoft.Winget.Source_2023.217.1251.187_neutral__8wekyb3d8bbwe\Public\index.db'
2023-02-17 12:21:25.008 [SQL ] Opening SQLite connection #1: 'C:\Program Files\WindowsApps\Microsoft.Winget.Source_2023.217.1251.187_neutral__8wekyb3d8bbwe\Public\index.db' [1, 40]
2023-02-17 12:21:25.008 [REPO] Opened SQLite Index with version [1.6], last write [2023-02-17 11:50:44.000]
2023-02-17 12:21:25.148 [REPO] Creating PredefinedInstalledSource with filter [None]
2023-02-17 12:21:25.148 [REPO] Creating new SQLite Index [4294967295.4294967295] at ':memory:'
2023-02-17 12:21:25.148 [SQL ] Opening SQLite connection #2: ':memory:' [6, 0]
2023-02-17 12:21:25.172 [REPO] Reading MSI UpgradeCodes
2023-02-17 12:21:25.177 [REPO] Examining ARP entries for Machine | X64
2023-02-17 12:21:25.190 [REPO] Examining ARP entries for Machine | X86
2023-02-17 12:21:25.199 [REPO] Reading MSI UpgradeCodes
2023-02-17 12:21:25.202 [REPO] Examining ARP entries for User | X64
2023-02-17 12:21:25.517 [REPO] Opening SQLite Index for ReadWrite at 'C:\Users\root\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\StoreEdgeFD\installed.db'
2023-02-17 12:21:25.517 [SQL ] Opening SQLite connection #3: 'C:\Users\root\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\StoreEdgeFD\installed.db' [2, 0]
2023-02-17 12:21:25.518 [REPO] Opened SQLite Index with version [1.6], last write [2023-02-05 17:59:14.000]
2023-02-17 12:21:25.540 [REPO] Sending http POST request to: https://storeedgefd.dsx.mp.microsoft.com/v9.0/manifestSearch
2023-02-17 12:21:25.577 [REPO] Response status: 200
2023-02-17 12:21:25.583 [REPO] Opening SQLite Index for ReadWrite at 'C:\Users\root\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\Microsoft.Winget.Source_8wekyb3d8bbwe\installed.db'
2023-02-17 12:21:25.583 [SQL ] Opening SQLite connection #4: 'C:\Users\root\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\Microsoft.Winget.Source_8wekyb3d8bbwe\installed.db' [2, 0]
2023-02-17 12:21:25.584 [REPO] Opened SQLite Index with version [1.6], last write [2023-02-05 18:17:24.000]
2023-02-17 12:21:25.609 [CLI ] No app found matching input criteria
2023-02-17 12:21:25.621 [CLI ] Terminating context: 0x8a150014 at D:\a\_work\1\s\external\pkg\src\AppInstallerCLICore\Workflows\WorkflowBase.cpp:337`


@Trenly
Copy link
Contributor

Trenly commented Feb 17, 2023

Interesting. The logs say that nothing was installed because there was

2023-02-17 12:21:25.609 [CLI ] No app found matching input criteria

Do you have the logs from installing with winget install -e --id Microsoft.VCRedist.2012.x64?

@K8-and-a-half-1000
Copy link
Author

After checking my environment, I see the same issue has occurred for the package Microsoft.VCRedist.2013.x64.
I'll re-install and fetch the logs for winget install -e --id Microsoft.VCRedist.2012.x64

@Trenly
Copy link
Contributor

Trenly commented Feb 17, 2023

Thanks!

@K8-and-a-half-1000
Copy link
Author

This is for winget install -e --id Microsoft.VCRedist.2012.x64

2023-02-17 13:41:56.877 [CORE] WinGet, version [1.4.10173], activity [{3DE0E6D4-9673-4AE4-8C19-58C4320FC86B}]
2023-02-17 13:41:56.878 [CORE] OS: Windows.Desktop v10.0.22621.1194
2023-02-17 13:41:56.878 [CORE] Command line Args: "C:\Users\root\AppData\Local\Microsoft\WindowsApps\winget.exe" install -e --id Microsoft.VCRedist.2012.x64
2023-02-17 13:41:56.878 [CORE] Package: Microsoft.DesktopAppInstaller v1.19.10173.0
2023-02-17 13:41:56.878 [CORE] IsCOMCall:0; Caller: winget-cli
2023-02-17 13:41:56.881 [CLI ] WinGet invoked with arguments: 'install' '-e' '--id' 'Microsoft.VCRedist.2012.x64'
2023-02-17 13:41:56.881 [CLI ] Found subcommand: install
2023-02-17 13:41:56.881 [CLI ] Leaf command to execute: root:install
2023-02-17 13:41:56.883 [CLI ] Executing command: install
2023-02-17 13:41:56.888 [REPO] GetCurrentSourceRefs: Source named 'microsoft.builtin.desktop.frameworks' from origin Default is hidden and is dropped.
2023-02-17 13:41:56.888 [REPO] Default source requested, multiple sources available, adding all to source references.
2023-02-17 13:41:56.888 [REPO] Adding to source references msstore
2023-02-17 13:41:56.888 [REPO] Adding to source references winget
2023-02-17 13:41:56.889 [REPO] Source past auto update time [5 mins]; it has been at least 15 mins
2023-02-17 13:41:56.889 [REPO] Source past auto update time [5 mins]; it has been at least 15 mins
2023-02-17 13:41:57.112 [CORE] Examining extension: PFN = Microsoft.Winget.Source_8wekyb3d8bbwe, ID = IndexDB
2023-02-17 13:41:57.113 [CORE] Found matching extension.
2023-02-17 13:41:57.116 [CORE] Downloading to path: C:\Users\root\AppData\Local\Temp\WinGet\Microsoft.Winget.Source_8wekyb3d8bbwe.msix
2023-02-17 13:41:57.117 [CORE] Started applying motw to C:\Users\root\AppData\Local\Temp\WinGet\Microsoft.Winget.Source_8wekyb3d8bbwe.msix with zone: 3
2023-02-17 13:41:57.118 [CORE] Finished applying motw
2023-02-17 13:41:57.118 [CORE] WinINet downloading from url: https://cdn.winget.microsoft.com/cache/source.msix
2023-02-17 13:41:57.923 [CORE] Download completed.
2023-02-17 13:41:57.923 [CORE] Starting AddPackage operation #0: file:///C:/Users/root/AppData/Local/Temp/WinGet/Microsoft.Winget.Source_8wekyb3d8bbwe.msix SkipSmartScreen: 1
2023-02-17 13:41:57.957 [CORE] Begin waiting for operation #0
2023-02-17 13:41:57.958 [CORE] Begin blocking for operation #0
2023-02-17 13:41:58.463 [CORE] Successfully completed #0
2023-02-17 13:41:58.469 [REPO] Multiple sources available, creating aggregated source.
2023-02-17 13:41:58.469 [REPO] Adding to aggregated source: msstore
2023-02-17 13:41:58.469 [REPO] Sending http GET request to: https://storeedgefd.dsx.mp.microsoft.com/v9.0/information
2023-02-17 13:41:58.566 [REPO] Response status: 200
2023-02-17 13:41:58.567 [REPO] Sending http GET request to: https://storeedgefd.dsx.mp.microsoft.com/v9.0/information
2023-02-17 13:41:58.587 [REPO] Response status: 200
2023-02-17 13:41:58.587 [REPO] Adding to aggregated source: winget
2023-02-17 13:41:58.596 [CORE] Examining extension: PFN = Microsoft.Winget.Source_8wekyb3d8bbwe, ID = IndexDB
2023-02-17 13:41:58.596 [CORE] Found matching extension.
2023-02-17 13:41:58.610 [REPO] Opening SQLite Index for ImmutableRead at 'C:\Program Files\WindowsApps\Microsoft.Winget.Source_2023.217.1421.850_neutral__8wekyb3d8bbwe\Public\index.db'
2023-02-17 13:41:58.610 [SQL ] Opening SQLite connection #1: 'C:\Program Files\WindowsApps\Microsoft.Winget.Source_2023.217.1421.850_neutral__8wekyb3d8bbwe\Public\index.db' [1, 40]
2023-02-17 13:41:58.611 [REPO] Opened SQLite Index with version [1.6], last write [2023-02-17 13:20:57.000]
2023-02-17 13:41:58.633 [REPO] Creating PredefinedInstalledSource with filter [None]
2023-02-17 13:41:58.633 [REPO] Creating new SQLite Index [4294967295.4294967295] at ':memory:'
2023-02-17 13:41:58.633 [SQL ] Opening SQLite connection #2: ':memory:' [6, 0]
2023-02-17 13:41:58.656 [REPO] Reading MSI UpgradeCodes
2023-02-17 13:41:58.661 [REPO] Examining ARP entries for Machine | X64
2023-02-17 13:41:58.674 [REPO] Examining ARP entries for Machine | X86
2023-02-17 13:41:58.683 [REPO] Reading MSI UpgradeCodes
2023-02-17 13:41:58.686 [REPO] Examining ARP entries for User | X64
2023-02-17 13:41:59.006 [REPO] Opening SQLite Index for ReadWrite at 'C:\Users\root\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\StoreEdgeFD\installed.db'
2023-02-17 13:41:59.006 [SQL ] Opening SQLite connection #3: 'C:\Users\root\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\StoreEdgeFD\installed.db' [2, 0]
2023-02-17 13:41:59.007 [REPO] Opened SQLite Index with version [1.6], last write [2023-02-05 17:59:14.000]
2023-02-17 13:41:59.027 [REPO] Sending http GET request to: https://storeedgefd.dsx.mp.microsoft.com/v9.0/packageManifests/Microsoft.VCRedist.2012.x64?Market=GB
2023-02-17 13:41:59.110 [REPO] Response status: 200
2023-02-17 13:41:59.115 [REPO] Opening SQLite Index for ReadWrite at 'C:\Users\root\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\Microsoft.Winget.Source_8wekyb3d8bbwe\installed.db'
2023-02-17 13:41:59.115 [SQL ] Opening SQLite connection #4: 'C:\Users\root\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\Microsoft.Winget.Source_8wekyb3d8bbwe\installed.db' [2, 0]
2023-02-17 13:41:59.116 [REPO] Opened SQLite Index with version [1.6], last write [2023-02-05 18:17:24.000]
2023-02-17 13:41:59.141 [CLI ] Found one app. App id: Microsoft.VCRedist.2012.x64 App name: Microsoft Visual C++ 2012 Redistributable (x64)
2023-02-17 13:41:59.141 [CLI ] Found installed package, converting to upgrade flow
2023-02-17 13:41:59.146 [CLI ] Terminating context: 0x8a15002b at D:\a\_work\1\s\external\pkg\src\AppInstallerCLICore\Workflows\UpdateFlow.cpp:87

@K8-and-a-half-1000
Copy link
Author

My best guess:

The issue seems to be that the x64 part of the package search is completely ignored, probably because it matches the x64 architecture denotation, and is therefore deemed redundant.
This is breaking the install flow, and moving us into the upgrade flow, which also breaks immediately after.

There is no upgrade log.

The output is this:

Found an existing package already installed. Trying to upgrade the installed package...
No applicable upgrade found.

@Trenly
Copy link
Contributor

Trenly commented Feb 17, 2023

You're mostly correct; the package matching especially for the VCRedists is a bit finnicky.

Using --force will cause it to install and not convert to the upgrade flow

@K8-and-a-half-1000
Copy link
Author

K8-and-a-half-1000 commented Feb 17, 2023

--force is fine for now to install the package

Any solution for this check?
winget list -e --name='Microsoft Visual C++ 2012 Redistributable (x64)'

I need to be able to detect if this package is installed. ^

Update: I'll detect the presence of (x86) in the list result via powershell, and ignore that output.
Should work if winget gets updated, since I have no control over the versioning.

@stephengillie stephengillie added Help-Wanted This is a good candidate work item from the community. and removed Needs-Triage This work item needs to be triaged by a member of the core team. labels Feb 17, 2023
@denelon
Copy link
Contributor

denelon commented Feb 17, 2023

We've got some ideas, and we will do some experimentation. We have some fuzzy matching heuristics where we essentially ignore anything at the end of a "displayName" like: "(*)". We're going to run some tests against manifests with the "AppsAndFeatures" entry for "displayName" to see if anything messes up, or if it improves matching in some cases.

@K8-and-a-half-1000
Copy link
Author

Fuzzy matching on the --exact flag?
That's a clear cut mistake.

A search can be fuzzy or exact, but it can't be both.

@denelon
Copy link
Contributor

denelon commented Feb 20, 2023

@K8-and-a-half-1000 the "-e" applies to the package identifier. That's getting an "exact" match to the manifest. The challenge is what's in the manifest and which registry entry values are present. Several packages modify the string in the "displayName" property in Windows Apps & Features.

We often see architecture at the end of the "displayName" like "(x86)" or "(x64)" which leaves some ambiguity. We also see cases where different installers may not report the "displayVersion" properly or they may not upgrade it properly. This is where the fuzzy matching comes into play. We're working on changing the heuristic for those cases where we have an "AppsAndFeatures" entry, so we don't ignore what's in parenthesis.

Unfortunately, VCResist packages don't all follow semantic versioning, and there are no standard keys for specifying installer architecture. I'm working with other teams to see about adding those keys as standard keys for installers to leverage, but that is a much bigger scope work item, and it will have a long lead time both in terms of getting it into the OS, and the length of time it takes various software publishers to start using those values.

@Trenly
Copy link
Contributor

Trenly commented Feb 20, 2023

@denelon - seems like a "quick fix" would be to also make -e make the --name parameter strict, not just the ID

@K8-and-a-half-1000
Copy link
Author

@denelon
I apologize for being direct; I didn't mean to be disrespectful, I just prefer cutting to the meat of the matter.

Let me show you what I mean:

PS C:\> winget install -e --id Microsoft.VCRedist.2012.x86; winget install -e --id Microsoft.VCRedist.2012.x64
Found Microsoft Visual C++ 2012 Redistributable (x86) [Microsoft.VCRedist.2012.x86] Version 11.0.61030.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.
Downloading https://download.microsoft.com/download/1/6/B/16B06F60-3B20-4FF2-B699-5E9B7962F9AE/VSU_4/vcredist_x86.exe
  ██████████████████████████████  6.25 MB / 6.25 MB
Successfully verified installer hash
Starting package install...
Successfully installed
Found an existing package already installed. Trying to upgrade the installed package...
No applicable upgrade found.
PS C:\>

The --exact flag doesn't work.
Making the -e flag work for either the ID or the DisplayName would resolve this issue for me.

@Trenly
Copy link
Contributor

Trenly commented Feb 20, 2023

Ah, I see the issue; It isn't that the package identifier or name points to the wrong version, it's that the matching to existing ARP entries isn't accurate. This is a much deeper issue than just the ID or DisplayName

@K8-and-a-half-1000
Copy link
Author

@Trenly
Yes, exactly.
The x86 / x64 is not handled properly, and as a result the --exact flag doesn't work anymore.

@denelon
Copy link
Contributor

denelon commented Feb 20, 2023

We're experimenting with some additional logic like:
If "AppsAndFeatures" entry contains "displayName" do not use exclusion of trailing parethesis.

We're testing to see if it improves matching or if it worsens matching.

@K8-and-a-half-1000
Copy link
Author

@denelon
If the --exact flag is present, the provided ID should match the package identifier exactly.

Please stop moving the goalpost to something else.

@denelon
Copy link
Contributor

denelon commented Feb 21, 2023

@K8-and-a-half-1000 "packageIdentifier" is a manifest construct.

Installers (except for portable packages) are writing the registry keys WinGet depends on to determine a "match".

The "--exact" argument is working to match the given input to a manifest and somewhat indirectly to a package based on the metadata in the manifest. There is a level of mapping necessary to match a manifest with an installed package. When the installer doesn't provide accurate, correct, unique data for WinGet to match on. The only option left is heuristics to find a "best match".

The goal post hasn't moved. It's more a matter of how we get there. We're trying to meet developers where they are in terms of their current installers and enabling a way for them to operate as well formed "packages". In many cases, it's a matter of bad data in bad data out.

I'm open to suggestions that are going to improve the situation.

@K8-and-a-half-1000
Copy link
Author

The "--exact" argument is working to match the given input to a manifest and somewhat indirectly to a package based on the metadata in the manifest. There is a level of mapping necessary to match a manifest with an installed package. When the installer doesn't provide accurate, correct, unique data for WinGet to match on. The only option left is heuristics to find a "best match".

🙈

https://learn.microsoft.com/en-us/windows/package-manager/winget/install

-e, --exact | Uses the exact string in the query, including checking for case-sensitivity. It will not use the default behavior of a substring.

PS C:\> winget search --id Microsoft.VCRedist.2012
Name                                            Id                          Version      Source
------------------------------------------------------------------------------------------------
Microsoft Visual C++ 2012 Redistributable (x86) Microsoft.VCRedist.2012.x86 11.0.61030.0 winget
Microsoft Visual C++ 2012 Redistributable (x64) Microsoft.VCRedist.2012.x64 11.0.61030.0 winget
PS C:\>

Look at the package IDs ☝️
See how I'm matching the x64 ID perfectly 👇

winget install -e --id Microsoft.VCRedist.2012.x64
Found Microsoft Visual C++ 2012 Redistributable (x64) [Microsoft.VCRedist.2012.x64] Version 11.0.61030.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.
Downloading https://download.microsoft.com/download/1/6/B/16B06F60-3B20-4FF2-B699-5E9B7962F9AE/VSU_4/vcredist_x64.exe
  ██████████████████████████████  6.85 MB / 6.85 MB
Successfully verified installer hash
Starting package install...
Successfully installed

One of these next outputs is wrong, can you spot it?

PS C:\> winget list -e --name 'Microsoft Visual C++ 2012 Redistributable'
No installed package found matching input criteria.
PS C:\> winget list -e --name 'Microsoft Visual C++ 2012 Redistributable ()'
No installed package found matching input criteria.
PS C:\> winget list -e --name 'Microsoft Visual C++ 2012 Redistributable (x)'
No installed package found matching input criteria.
PS C:\> winget list -e --name 'Microsoft Visual C++ 2012 Redistributable (x64)'
Name                                                         Id                          Version      Source
-------------------------------------------------------------------------------------------------------------
Microsoft Visual C++ 2012 Redistributable (x64) - 11.0.61030 Microsoft.VCRedist.2012.x64 11.0.61030.0 winget
PS C:\> winget list -e --name 'Microsoft Visual C++ 2012 Redistributable (x86)'
Name                                                         Id                          Version      Source
-------------------------------------------------------------------------------------------------------------
Microsoft Visual C++ 2012 Redistributable (x64) - 11.0.61030 Microsoft.VCRedist.2012.x86 11.0.61030.0 winget

The -e flag either finds an exact match, or it fails.
That's the only correct behavior by it's own definition.
I'm not here for a lecture on how packageIdentifiers are constructed.
I'm not here to discuss how the fuzzy matching can be improved.

@Trenly
Copy link
Contributor

Trenly commented Feb 21, 2023

IMO, this boils down to being a CLI bug around Area-Matching and Area-Side-By-Side

Its specifically an issue with list due to how currently installed packages are matched to Package Identifiers, which is why it isn’t occurring with search but is converting the install flow to an upgrade flow

@denelon
Copy link
Contributor

denelon commented Feb 21, 2023

@Trenly

Yes.

Before we had the "displayName" key available in the manifest, we had to try and match the "packageName" against the "displayName".

Now we need to change the behavior so that when the "displayName" key is present in the manifest WinGet will stop trying to find a match by dropping the values in parenthesis at the end of the registry key mapped to the Windows Apps & Features "displayName" .

@K8-and-a-half-1000
Copy link
Author

Ok, seems like we're all on the same page now.
Thanks for the patience.

I have some spare time during the weekend to debug this issue further.
Should a draft PR come from it, I'll link it here.

@denelon
Copy link
Contributor

denelon commented Feb 21, 2023

@Trenly
Copy link
Contributor

Trenly commented May 1, 2024

Several other issues are tracking issues related to VC Runtimes and side-by-side. I'm closing this issue in favor of the work over at the CLI.

Close with reason: Tracked at CLI;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Help-Wanted This is a good candidate work item from the community. Issue-Bug It either shouldn't be doing this or needs an investigation.
Projects
None yet
Development

No branches or pull requests

4 participants