-
Notifications
You must be signed in to change notification settings - Fork 342
[Enhancement] use chocolatey path on system without reboot #134
Comments
WHAT?! That's awesome. |
Going to test this one- 7 week's old... |
I think rob and @Iristyle were looking at his yesterday and found that it did not work. I ran into this issue a couple weeks ago and also tried this without luck. Not sure if thats because powershell.exe does not subscribe to the broadcasts. I did find however that this:
does work. It was mentioned though that "Path" may not be enough. There could be other variables that other programs might expect (like JAVA_HOME). Also, this needs to be batch file compliant as well. I believe @Iristyle was going to implement something that would work for both ps and dos. See the Issue #153 for the details of the discussion. |
yea, i went to the authors website- http://mnaoumov.wordpress.com/2012/07/24/powershell-add-directory-to-environment-path-variable/ and right at the top, is his note...:( fail |
This is still an open issue. The above pull request only fixes Chocolatey's ability to refresh its own view but does not refresh the view of the user session. Need to add some bath flavored means of refreshing a normal command line. Also need to provide a means of refreshing PS users most likely via their $Profile. |
The initial workings for this are in b87541a - we'll see what other things crop up. |
I'm excited about this one, need it for some complicated packages that depend on the hg and 7zip command line packages first, to enable installing itself (hggit). |
Hey, guys. What if I'm running chocolatey from the existing PowerShell session? It seems that PowerShell starts the new What can I do to refresh the caller PowerShell session environment? Maybe there should be an alternative Ew, and then we have to reimplement the whole |
@ForNeVeR We already have the powershell refresh in and once the commands become aliases back to the module methods, you will see this happen automatically as there will be no call out to a batch and then back into powershell. |
Thank you for response, that's a good news. |
Fixed in a09e158 |
…md.exe This adds a command RefreshEnv.cmd to the bin files, so that one can update environment variables out of band. There is zero chance it will work once chocolatey.cmd calls exit /b %ERRORLEVEL% as exiting the batch effectively destroys any updates to local environmental changes. The way it currently works is effectively the same as using setlocal due to the use of exit. Since this command can be called out of band, it should be called out of band, whenever the user wants to refresh their environment variables they can call this. Note this only works in cmd.exe shell. There is no current way to update a powershell session other than importing the helper functions as a module and running Update-SessionEnvironment.
* stable: (chocolatey-archiveGH-460) Fix for "Package depending on newer chocolatey is installed using existing chocolatey" (chocolatey-archiveGH-459) Fix for "Cannot find Update-SessionInformation" (maint) formatting (chocolatey-archiveGH-153)(chocolatey-archiveGH-134) Update PATH on cmd.exe (maint) ensure powershell module loading preference is on
The current state is that unless you import the chocolateyinstaller module, you won't automatically get path updates. Importing the module isn't recommended at this time but some folks are experimenting with it. With cmd.exe you can just call RefreshEnv after an install that would update something in your environment and it will update your session's environment. |
With an assist from this - http://poshcode.org/2049... if an option is specified... thoughts?
user path currently is good, and minimal priveledges, etc...
The text was updated successfully, but these errors were encountered: