-
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
winget should install an app if there is an exact match (eg 'git') #292
Comments
I'm having this exact issue with "Powershell" and/or "Microsoft.Powershell", and I have no idea how to actually get the one I want. |
I've hit the same issue trying to install Discord. IMHO each package should have a mandatory, unique and case insensitive moniker (or just apply those characteristics to the ID). Basically, the same user experience as brew.sh @CalvinAllen you can use the |
@kipters Thanks, that did the trick! |
I suggest trying |
So we should give user a hint when such things happen. Here is a mock hint. |
This is exactly what happened to me when I discovered the issue |
However, it can be difficult for a newbie to find a such a option.
|
I support it! |
Im adding onto this because there is tons of pacakges that have Git in the name but i cant possibly install git even with the exact id Git.Git because Git.GitLFS exists. |
Hints aren't as good as what @kipsters suggested:
There's a reason why most popular package managers have short package names. |
"Fall into the pit of success" Search = case insensitive, non-exact match These should be no brainer commands: If I type |
I ran into this today as well, and it was very confusing. 👍 to changing something here. |
I think it is fine that when you say "install git" it says "which git". However, it should show a message similar to what kipters mentioned, or provide a sequence number against the filtered result and ask us to enter a number. |
We're working with the PowerShell team to address some of this with adjustments to the manifests. For now |
The |
I am also thinking the help dialog may benefit from providing an example. I'll build a short spec. |
* Update spec-template.md * Update #292 - winget should install an app if there is an exact match.md * Update spec-template.md * Update #292 - winget should install an app if there is an exact match.md * Update #292 - winget should install an app if there is an exact match.md * Update spec-template.md
Winget will also try to install a package by its tag (!!!) Installing
|
The above example should work. It is more than exact to work without having an -e or --e specified. Not sure how to code this but for UX next to the simple proposal to add the info line by @KiruyaMomochi the approach is a good thing. Perhaps yellow text color. |
I think it's become clear that the use of substring instead of literal matching is not suitable for install, uninstall and upgrade operations as the user knows what he wants. The current behaviour only really makes sense for the The current spec only covers the |
#492 is out to make this better. The short of it is that it requires case insensitive equality on one of Id, Name, or Moniker for install (and show). I was also thinking of ways to help the user more. My two thoughts so far are:
I don't feel that either of these are strictly required to resolve this issue, and they may not even be something anyone cares about. So looking for feedback on when/if these (or any other) suggestions would make sense to help in the workflow. |
I think it is not. Can't be that my script breaks because someone published something between writing it and running it. Plus, do I have to know they published |
Why will your script break because someone published something in between? There is one command that tries finding a match, installs if it only finds one, and another command that installs the exactly provided id. The latter is clearly intended for your use case, why wouldn't you just use it instead? |
@denelon the release is not clear. What exactly is taken into account for an exact match? The name of the package? |
I guess it matters how easy it is. Short of writing a script it is just quite unfortunate the way it is now I try to install something five times in a row in various way and still nothing happens. And there's at least four concept of identifiers of various kinds which I seriously don't care about and I just don't want Windows to become Linux where it is quite normal to ask for help and get a bible full of switches and not even a good luck reading all that (e.g. curl). |
@felipecassiors , the value needs to be a case insensitive match to one of Id, Name, or Moniker by default. If you specify which field with an argument, you can make it even more specific.
Will find anything with Id == 'git', Name == 'git', or Moniker == 'git' (where == is case insensitive). You can use the show command to play around with it as it uses the same semantics to find a package. When writing a script, to guarantee that the target package will be chosen, always use the
This will only find a package whose Id == 'git.git', and as the Id is case insensitively unique, there can only be either 0 or 1 of them. |
Thanks @JohnMcPMS, this is very clear now. |
Yeah, but this still doesn't work.
EDIT: I had an older version of WinGet installed, updating it fixed this issue. |
@theLMGN , I think that does show an issue with the winget-pkgs repo though. We shouldn't really have let those two packages have the same name, because |
I like those thoughts @JohnMcPMS. Real issue no 3 I would say simplify unneeded concepts: install only ever by id and allow ids without dots, remove the concept of I think everybody is happy to get rid of |
Brief description of your issue
Steps to reproduce
winget install Git
Expected behavior
git installs, as the name is an exact match (case insensitive).
Actual behavior
The error above.
Environment
The text was updated successfully, but these errors were encountered: