-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Installing a package doesn't add it it to path #549
Comments
As I know, I'm look at it and vim installer don't have any installer arguments (and there is no installer option to add PATH too). You have to add yourself until this ability comes to Have a nice day! 🥂 |
Thanks, I came from linux and is used to installing packages with |
I think that linux users benefits WSL as a package manager when native gui server comes with it. I use WSLGentoo and when gui server comes with it, I will migrate fully and only use |
@matifali winget is still in preview. Hope it will soon grow like apt and other package managers. We have to wait. |
I've been working on the backlog recently. You can take a look at the milestones to see what we're planning. We do plan on having the ability to add the path for .zip, .exe, and standalone/portable apps. I'm not sure what we'd be able to do with an installer that doesn't provide a path. If we specify a path during "install" time for packages like this, we might be able to add that path to the environment. Is that what you would be looking for here? |
@matifali this path problem is not because of winget-cli. The actual installer of vim does not add vim directory to the path. So this is not an issue of winget-cli. |
@denelon I don't know how you gonna handle this but something like this will be good I think:
In the end it turns something like this (example for vim manifest):
|
Is this essentially a duplicate of #222 ? |
This isn't an exact duplicate, because opening a new shell doesn't change the behavior. the Application is still not in the PATH. |
Makes sense-- it does not appear to be a problem with winget, but with the vim package; I guess the question then becomes how should winget handle packages that don't add themselves to PATH? Is this exclusive to the vim package, or have other packages shown this behavior too? |
Rather than populate your PATH like Chocolatey, winget should add shims like Scoop(UWP also has this feature) |
Yes I understand But wiget-cli should not accept such packages in repo if they don't add themselves to path. |
Is there any due diligence performed on the items in the winget repos? Does Microsoft do any validation of applications?? |
Most probably no. |
@Witchilich Sorry to jump in. I just wanted to note that Chocolatey brought about the idea of shims not to clutter your PATH - it existed long before Scoop was created as a concept called batch redirects. Later we moved to shim exes. Luke thought shimming was great and added it to Scoop. Just want to make sure the credit is in the proper place on shims. References:
I think your confusion might be in that Chocolatey might defer to an installer as well, which might put things on PATH. Scoop doesn't use the installer at all, it just unpacks, so the shims are much more necessary. Chocolatey's docs on this - https://docs.chocolatey.org/en-us/features/shim |
I think windows already has its own version shim, if you look up wsl.exe, wt.exe. they are in windowsapp folder |
So I’m a complete idiot. How can you figure out where vim actually installs. I’ve tried winget list vim and can’t figure it out. Do I look at the source. Same issue with winget install git by the way. |
Is this still pending? Does anybody know a workaround? edit*: regarding vim |
Being able to easily install vim with winget should be a core use case of winget. |
I just tried winget for the first time on a brand new windows 11 system from dell and encountered this.
This is completely unacceptable and an absolute non-starter for a package manager. this is the application level equivalent of installing an operating system without adding it to the bootloader. fixing this should be priority 1. thank you |
This issue's been open for 3 years and I get emails for this thread frequently. The conversation keeps going in circles about how it's not the role of the package MANAGER to manage the dang package! This is far from true of EVERY other package manager I have ever used for any system or language, ever. I have never had to go hunt things down after they were "installed" because they've always worked as expected. The only one that's not in line here is winget, and it makes me think about POLA (Principle of least astonishment).
see also
I know this isn't actual law, but having to play find the needle in the haystack with software I got through winget isn't what I expect from a package manager - the package manager is supposed to let me pick a package from a repository, install it, and be able to use it after install. Winget does 2/3 of those things. As a user, I couldn't really care less how this is handled semantically; I just want those programs to be callable! Not a single thing I have ever installed through winget has been callable after install even if I opened up a new shell. I've had to look for Every package and add them all to path myself, --info is supposed to show me install locations, among other things, and I'm not even seeing my package in those directories, --location is supposed to let me at least pick the location the package is installed to and that didn't work for me! So now here I am, having to play find the needle in the haystack with ffmpeg and thinking about POLA, and this specific Issue. The thing I really admire about technology is that there's never only one perfect way to solve an issue, there are always multiple options that can be used to achieve a given goal. This is true on both ends, you have multiple options you can try to work with, and I have other package managers I could try that work as expected. I'd rather have SOMETHING that's good, than wait around forever for something to be perfect. I don't need perfect, and no one here is asking for perfect or really even being too picky about the implementation. Anecdotally, I'm using a different computer and the Chocolatey package manager was FAST to install, it installed ffmpeg quickly for me, and I didn't even have to start a new session to call it. This is a package manager working as expected, this is the kind of result I want to see. Chocolatey used a shim, I do not care that they used a shim, they didn't get bogged down with the semantics like we're seeing here they just did Something! Seeing how fast and simple Chocolatey was to setup/use, I don't really see myself coming back to winget and am just going to put Chocolatey on all my home and work systems for future use, and if asked about a good Windows package manager that'd likely be my go-to because yeah if I'm being honest with them and knowing what they expect from a package manager why would I, or anyone, recommend winget over anything else that does what people expect a package manager to do. I want to be sympathetic here, but every time this Issue looks like it's going in the right direction and we landed on SOMETHING to try, it gets steered back to the position that winget is not responsible for making things callable after install - and that this is the job of the package maintainers themselves. I don't really have the energy to care about this anymore given I found a good solution, but figured this feedback is important to share nonetheless. There is a lot of valuable user feedback and genuine good faith attempts at trying to find a solution in this thread that is not being fully appreciated and these people are working with you for free and unsolicited because they want this to succeed. I do too, but I can't really wait for it and I'm definitely not going to argue for it when Chocolatey is right there. Three separate things that would probably make this whole situation more workable for end users, besides actually addressing the problem in question, would be 1.) show people WHERE any given package is getting installed so if it's not callable afterwards we at least know where to look exactly so we can fix it ourselves 2.) don't call winget a package "manager" if it can't fully commit to being one, can't complain or compare it to a PM if it's not trying to be one, or 3.) fully lean into it being on package maintainers to ensure a portable/MSIX version of their package is added to the repo for predictable outcomes, and in doing so tighten your standards on what it takes for a package to be listed in the repo. After having gone through the entire thread I'm assuming every single program I've ever tried downloading through winget wasn't portable and led to them all ending up in random locations and giving me an extremely poor UX. The poorest package management UX I've ever had to date! Also not helping with the overall reception here is it's not clear who on this thread is actually a winget dev and who is just playing devil's advocate and speaking for/over winget devs (or defending MS) - neither of which they have to do because everyone who is raising this as a concern wants to see a built-in Windows package manager that's on-par with any other run-of-the-mill package manager. Yes, Linux-based ones will be mentioned because they're the most immediately recognizable - but you also have working Windows-based ones being mentioned by name because people want it to work! Pedantry isn't productive and if you're not actually on the dev team are just drawing more ire towards them, lack of visibility into what's actually happening with this Issue doesn't help, and as an end user my trust and interest in this product is pretty burnt :^} this exact Issue IS a really big deal and IS a major expectation of anyone who has used a package manager before, regardless of what's being argued here. winget is the outlier full stop. This is a very real example of someone who leads the IT/*Admin team at an organization falling out of this because of all the friction and inconsistency that goes into trying to use it, as has been warned about multiple times throughout the thread. I am validating those people and saying they are right. |
A long response but while the POLA is an interesting justification, Snover's First Law trumps it. To ship is to choose and in 3 years the Winget team has indicated no interest in implementing this, and almost zero support elsewhere. And o see zero interest from those who could implement it. In my experience guilt tripping rarely works. But if you want it, then explain how it could be implemented. I know of no way running an executable in PowerShell that can cause the environment block refreshed (and $profile to be reexecuted). And even if it could be, it would seem to be a security hole. I see little hope of winget doing this on its own. You would need to change PowerShell and Windows Powershell. And I see zero chance of updating powershell to implement this (and an even lower chance of backporting it to Windows PowerShell. I could be wrong, but I simply see inadequate support. |
I don't know why we keep going back to this. I understand how the issue's title could give the initial impression that winget needs to add stuff to PATH, but if you read their full message, the only thing OP wants is the following to work:
And this behaviour can be achieved using shims. scoop does it today. It is not some novel problem that we have to rewrite the OS from scratch to fix. So, please stop bloating the thread about why something we never needed in the first place can't be done. When I don't care about a feature, I just ignore the GH issue suggesting it, because why not have it if it will be useful to someone, right? That is unless it would introduce some undesirable behaviour that I rather not see in the product. Does winget implementing this feature have any downsides you're worried about that we are not aware of? Would it negatively affect how you use winget in any way whatsoever? And if not, what value are you trying to add here? "I've been using Windows before you were born, and I never needed it" isn't an argument against this feature - the only thing it tells is that there are people who can live without it, and don't get me wrong, that still is valuable feedback, but does it really need to be repeated under every message that justifies this feature? We heard your opinion about why you don't need this, but we all have different needs. |
@denelon Is there any movement or interest in this issue? |
@doctordns You could argue every issue in every repo is not possible because you do not know how to do it. Your own lack of knowledge is not a counter argument. You have ignored all the approaches already proposed in this thread. Either educate yourself on why this is possible, feasible, currently in use, and make more nuanced critique of a specific approach or stop spamming this thread. There was support by @denelon a few months ago when we workshopped some ideas. It is on the vnext-client backlog for a reason. If we can instead use this issue for discussion upsides/downsides of specific approaches and get affirmation around which path the lead wants to go we can start actually implementing it. I personally think shims are the way to go because they're really easy to write but I'd be curious what the lead's take is. |
@doctordns: it's true that there's not a great way for a separate process ( (It's totally understandable that one could miss that comment; this Issue is huge, and I had to click through multiple "show hidden items" folds in order to find that comment again.) I took the liberty of making my idea easier to consume by publishing it as, you guessed it, a winget package. :D It requires admin access to install, which is unfortunate, but even so I think it could make things a lot more convenient for a lot of people, so I went ahead with it. You can try it out by: winget install WingetPathUpdater # <-- this is the thing
# Now this will work:
winget install nvim
winget install Microsoft.VCRedist.2015+.x64 # this is missing from the nvim package :(
nvim # ta-da! (that is for (More info here: https://github.com/jazzdelightsme/WingetPathUpdater) My package is not an ideal solution. Besides requiring admin, you have to know that you need it--having a solution in package form does not help unless you have the package, and I expect most people will not know that they need this package. Just to head off the conversation "why doesn't winget just ship this 'in-box'?!": the winget team has more constraints than I do (see caveat at the beginning of my Design comment), so I doubt they would find it feasible. However, they are aware of this package's technique (and I know they carefully read and discussed my Design comment), so hopefully it is helpful to them. And I hope my package is helpful to people in the meantime. Edit: oh, and special thanks to @denelon and @stephengillie for helping me get my package manifest working! Edit 2: Oh crud; my first demo used " Edit 3: on a totally clean VM, nvim "launched", but didn't really run: it depends on the VC runtime, but doesn't distribute it (installer bug, IMO). So I added " |
We're working to get dependencies out with WinGet 1.6 (ETA end of September). A couple of weeks after that we will start automated validation with dependencies in earnest. Updated: WinGet 1.6 supports dependencies. > winget install WingetPathUpdater # <-- this is the thing
> winget install nvim
> nvim |
This is awesome!! thanks @jazzdelightsme for your hard work and thank you @denelon for supporting this. Very exciting :) |
Ok, not 100% sure what I am doing here. Need to fiddle around with it a bit more. |
If you have problem installing global commands from pip, try adding the following directory to your
|
@mon-jai Even some kind of prompt would be helpful - "Warning: this package will not executable using its alias [alias] until the shell is restarted." I would note this includes any shells that may be open within VS Code etc. |
Stumbled upon this package that have cli version but installer does not add it to PATH https://github.com/microsoft/winget-pkgs/tree/afaf1950df18389dcf43dcdb43e9c5673f58fce0/manifests/p/PragmaTwice/proxinject Same with 7zip-zstd mcmilk/7-Zip-zstd#360 |
Great news! Search for "winget" on that page.
Note: This has not been implemented in PowerShell. |
Amazing!! |
but.. will it? :D |
@denelon This is indeed good news, but many programs don't add themselves to the PATH at all - we still need a solution for these (expecting all programs to remember to do this isn't realistic). |
In the meantime, use the --interactive flag and click the .bat file checkbox per microsoft/winget-pkgs#656 (comment)
|
It isn't refreshing my shell after the installation, also in vscode if I don't close those windows the shell isn't refreshed inside it. |
Brief description of your issue
Installing a package doesn't add it it to path
Steps to reproduce
winget install Vim
Vim test.txt
Expected behavior
Vim should open the file if it exist or create a new file.
Actual behavior
Environment
The text was updated successfully, but these errors were encountered: