Search and Install do not return the same results
Brief description of your issue
Steps to reproduce
run winget search wireshark
run winget install wireshark
Expected behavior
If only one package is returned from search, only one package should be returned for install. Search and install should return the same available packages
Actual behavior
PS C:\WINDOWS\system32> winget search wireshark
Name Id Version Source
-------------------------------------------------------
Wireshark WiresharkFoundation.Wireshark 3.4.8.0 winget
PS C:\WINDOWS\system32> winget install wireshark
Multiple packages found matching input criteria. Please refine the input.
Name Id Source
-----------------------------------------------------------
Computer Networks One 9NC6N8L4T5WS msstore
Wireshark WiresharkFoundation.Wireshark winget
Environment
PS C:\WINDOWS\system32> winget --info
Windows Package Manager v1.1.12653
Copyright (c) Microsoft Corporation. All rights reserved.
Windows: Windows.Desktop v10.0.19043.1237
Package: Microsoft.DesktopAppInstaller v1.16.12653.0
It looks like searches sent to a REST source look in specific fields when a search is ran for winget install, and those fields are not specified for winget search.
The body of the request for winget search wireshark:
{
"Filters":[
{
"PackageMatchField":"Market",
"RequestMatch":{
"KeyWord":"US",
"MatchType":"CaseInsensitive"
}
}
],
"Query":{
"KeyWord":"wireshark",
"MatchType":"Substring"
}
}
And the body of the request for winget install wireshark:
{
"Filters":[
{
"PackageMatchField":"Market",
"RequestMatch":{
"KeyWord":"US",
"MatchType":"CaseInsensitive"
}
}
],
"Inclusions":[
{
"PackageMatchField":"PackageFamilyName",
"RequestMatch":{
"KeyWord":"wireshark",
"MatchType":"Exact"
}
},
{
"PackageMatchField":"ProductCode",
"RequestMatch":{
"KeyWord":"wireshark",
"MatchType":"Exact"
}
},
{
"PackageMatchField":"PackageIdentifier",
"RequestMatch":{
"KeyWord":"wireshark",
"MatchType":"CaseInsensitive"
}
},
{
"PackageMatchField":"PackageName",
"RequestMatch":{
"KeyWord":"wireshark",
"MatchType":"CaseInsensitive"
}
},
{
"PackageMatchField":"Moniker",
"RequestMatch":{
"KeyWord":"wireshark",
"MatchType":"CaseInsensitive"
}
}
]
}
Either there's something weird about the Store source's search where nothing happens if there's not a field set, or (more likely based on my mild knowledge) the use of MatchType: Substring instead of MatchType: CaseInsensitive is causing the searches to be tighter than they intended them to be.
The store source is approximating the REST API calls. We've got another change to hopefully bring the results of search and install to a more consistent state.
Definitely running into this, even specifying the id doesn't disambiguate it enough

Definitely running into this, even specifying the id doesn't disambiguate it enough
Use the —id parameter specifier as a temporary workaround
@Masamune3210 The ID could be case-sensitive. You wrote gog.galaxy whereas the ID is GOG.Galaxy. At least check if that might be an issue.
From what I've seen install usually works with case-insensitivity but tried anyway, no dice

winget install GOG.Galaxy -s winget is a workaround also.
I ran into similar issue trying to install MS Teams:

❯ winget --version
v1.1.12653
I know this may not be the place to ask this, but is there a way to remove msstore as a source?
I found the answer to my question. You can remove the msstore source and avoid these issues. Open elevated shell and run winget source remove msstore
msstore is definitely causing issues here - you don't even get the same (incorrect) results between runs
C:\Users\peter>winget install Microsoft.VisualStudioCode
Multiple packages found matching input criteria. Please refine the input.
Name Id Source
---------------------------------------------------------------
Microsoft Whiteboard 9MSPC6MP8FM4 msstore
Microsoft Visual Studio Code Microsoft.VisualStudioCode winget
C:\Users\peter>winget install "Microsoft.VisualStudioCode"
Multiple packages found matching input criteria. Please refine the input.
Name Id Source
---------------------------------------------------------------------
Microsoft Wireless Display Adapter 9WZDNCRFJBB1 msstore
Microsoft Visual Studio Code Microsoft.VisualStudioCode winget
If this is causing too many issues for you run winget source remove msstore to use the community repo only. If you want to try it again, run winget source reset.
Here's some more info: https://github.com/microsoft/winget-cli/discussions/1515#discussioncomment-1398086
I've covered a few tips in the blog for Windows Package Manager 1.1.
I actually think "search" and "install" should not return the same results. winget search should be a wide-ranging search that matches anything in product ID, moniker or package name. winget install should give precedence to any moniker that has been defined (and monikers should be unique). If the install request does not match a defined moniker, then it should attempt to match by product id (this will give precedence to the winget repository, because msstore product IDs are random strings of letters).
On the other hand, winget install and winget show should return the same results, in my opinion. If I type winget show kiwix, I expect it to show details of the package that will install if I then type winget install kiwix. Unfortunately these commands are currently broken if a moniker is defined: see #1568.
I feel like there should be a "default" store that is given precedence
If the install request does not match a defined moniker, then it should attempt to match by product id (this will give precedence to the winget repository, because msstore product IDs are random strings of letters).
I'd go one step further to say that the "default" repository should be user-selectable, and that an exact-match of product id should always work if it's unique, or if it's available in the default repository.
If I'm adding custom/additional repositories, I don't expect them to interfere with my "default" behavior.
@peter-dolkens I think you're asking for:
- #1488
I don't know why, but this one cracked me up:
PS C:\Users\easton> winget install office
Multiple packages found matching input criteria. Please refine the input.
Name Id Source
-------------------------------------------------------------------------------
Neat Office - Word, Excel, PDF, Powerpoint alternative 9P2HTZQ722V3 msstore
Microsoft 365 Apps for enterprise Microsoft.Office winget
"Hi! I'm a Microsoft utility! You want Office? Have you tried 'not Office'?"
Quick update. We're going to test some of the changes this week and anticipate a release as early as October 18th (+ or - a day depending on geography).
another example of this is with anaconda
> winget install anaconda -i
Found DocRunService [9NG6PPC33R21] Version Unknown
This package is provided through Microsoft Store. winget may need to acquire the package from Microsoft Store on behalf of the current user.
Version: Unknown
Publisher: OVO.LTD
Publisher Url: https://www.doc.run
Publisher Support Url: mailto:[email protected]
Description: DocRunService makes the DocRun(a cloud-based notebook application running on browser) being able to calculate and launch remote calculating tasks.
> winget search anaconda
Name Id Version Source
--------------------------------------------------
Miniconda3 Anaconda.Miniconda3 py39_4.10.3 winget
Anaconda3 Anaconda.Anaconda3 2021.05 winget
We're aware of what is causing this issue. We have changes planned early next week to improve this.
Fortunately, this is a back-end change and doesn't require client changes. I thought I'd share this bit of information.
This didn't make the 10/18 target date. I'm chasing the next date down.
It looks like 10/25 is the next release window we're targeting.