Skip to content
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

RefreshEnv.cmd doesn't set the correct PATH #1227

Closed
miau opened this issue Apr 1, 2017 · 1 comment
Closed

RefreshEnv.cmd doesn't set the correct PATH #1227

miau opened this issue Apr 1, 2017 · 1 comment

Comments

@miau
Copy link

miau commented Apr 1, 2017

RefreshEnv.cmd sets the PATH environment variable with a trailing space. Then a new application that adds user PATH can't be launched.

>cinst -y visualstudiocode
Chocolatey v0.10.3
(snip)
Installing visualstudiocode...
visualstudiocode has been installed.
Environment Vars (like PATH) have changed. Close/reopen your shell to
 see the changes (or in powershell/cmd.exe just type `refreshenv`).
 The install of visualstudiocode was successful.
  Software installed to 'C:\Program Files (x86)\Microsoft VS Code\'

Chocolatey installed 1/1 packages. 0 packages failed.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

>refreshenv
Refreshing environment variables from registry for cmd.exe. Please wait...Finished..

>code
'code' is not recognized as an internal or external command,
operable program or batch file.

>echo [%path%]
[(snip);C:\Program Files (x86)\Microsoft VS Code\bin ]

It seems that there is an unnecessary space before >> despite a caution.

echo/set Path=%%Path_HKLM%%;%%Path_HKCU%% >> "%TEMP%\_env.cmd"

@ferventcoder
Copy link
Member

Thanks for noting this. Will look to fix for 0.10.6

@ferventcoder ferventcoder added this to the 0.10.6 milestone Apr 1, 2017
@ferventcoder ferventcoder self-assigned this Apr 4, 2017
ferventcoder added a commit that referenced this issue Apr 7, 2017
Surround setting environment variables with quotes so that they are
able to work with spaces.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants