-
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
Reload PATH environment variable after package installation #531
Comments
Related to #194 in the sense that we may need to handle PATH reload for that as well. |
There is a Windows broadcast message you can send to tell all running apps that they should reload their environment but Explorer.exe is the only application (AFAIK) that actually cares enough to do it (and it probably uses a undocumented function to do so). Even if most applications did it, cmd.exe would probably be excluded from it by design, you don't want your command interpreter to automatically override your variables at unknown times. The only documented way for this to actually work would be for winget to exist as a batch file and as wingetReal.exe finishes, it would have to write Changing the environment of your parent process by modifying the PEB is undocumented, has multiple race conditions and is probably too much of a hack. |
Adding that chocolatey ships with a script called |
i think this would be really cool if powershell would then be able to automatically set the path to any installed applications, allowing users to easily open programs like you can do with notepad at the moment. |
This issue is basically identical to issue #222 (and many other similar issues that have already been closed as duplicate). |
Duplicate of #222 |
@kimwalisch we've identified this Issue as a duplicate of another one that already exists. This specific instance is being closed in favor of tracking the concern over on the referenced Issue. Thanks for your report! Be sure to add your 👍 to the other issue to help raise the priority. |
Hi,
My Primesieve package is a command-line tool and its setup (based on Inno Setup) adds its path (
C:\Program Files\Primesieve\bin
) to thePATH
environment variable. However when I install primesieve usingwinget install primesieve
I cannot immediately use it on the command-line as the PATH environment variable has not been reloaded yet (tested usingcmd.exe
):So I need to close the current terminal window, open a new terminal window and then I can start using my tool. This is quite annoying, on Linux and MacOS you can immediately use a tool after the installation with the package manager has completed.
Is there a known workaround for this issue?
If there is no workaround for this issue yet, I see 2 possible options to fix/improve this issue:
PATH
environment variable after each package installation.PATH
environment variable should be reloaded after the package installation.The text was updated successfully, but these errors were encountered: