-
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
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 |
@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. |
The PowerShell team has spec'd this change and is evaluating with impacted teams. I don't have a date to announce, but we plan to include this in the future. |
I made this PowerShell script for solving the path problem when using winget to install. It makes a persistent symlink so that I don't have to change my vim path in my git config. https://gist.github.com/eggbean/351982f02f0ce7203669ac5ee05d7a06 |
@denelon we're still experiencing it for Godot even when we close terminal entirely and reboot any tips? |
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: