-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Exact match for Moniker not being selected for install #3547
Comments
This also happens with packages within the same source -
WinGet-2023-08-23-11-51-36.391.log
|
can confirm with edge
|
It looks like the issue you're having with edge is expected behavior and is not related to the moniker issue. Because you're using the uninstall command, the list of packages is specific to what is currently installed on your machine, not what is available in the source. It is possible to have both |
I have a similar issue with the
Presumably this is because Python.Python.3.11 also has the |
Brief description of your issue
When attempting an install, winget tries to select the best package matching user intent. This is done by assessing for exact matches on Moniker, ID, Name, and in some cases (such as uninstall) product code. If an exact match is found, the package is assumed to be the user intent and is selected for install.
The logic for this appears to be broken
when both themsstore
source and thewinget
source are enabled.Steps to reproduce
Running
winget search
will provide a list of the packages matched by the search and what field they were matched on if the match was not part of the name or package identifier.winget search
uses a substring match on the Name and Package identifier by default, but a case insensitive match on monikers, commands, tags, etc.The specific reproduction steps rely on the Google Chrome package. Running
winget search chrome
-WinGet-2023-08-23-10-23-37.093.log
From the search, it is clear that the first two entries are substring matches on the Name, the third entry is an exact match on moniker and substring matches on the Name and Package Identifier, and so on and so forth. Each entry in the list can be correlated to a match type.
Running
winget install chrome
-WinGet-2023-08-23-10-24-04.956.log
Expected behavior
Because the package
Google.Chrome
from thewinget
source had an exact match on moniker, and there were no exact matches on Name or Package Identifier from any source, theGoogle.Chrome
package should be selected for install.Actual behavior
Multiple packages are being found as matching user intent - the package
XP890QTFL1X0D0
from the msstore source, andGoogle.Chrome
from the winget source.Based on the results from
winget show
, the packageXP890QTFL1X0D0
is only a substring match on the package name, whereasGoogle.Chrome
is an exact match on the moniker. Because of the exact match on the moniker, this package should be selected for user intent above any substring matches on name or identifier.Environment
The text was updated successfully, but these errors were encountered: