Skip to content
This repository has been archived by the owner on Feb 19, 2019. It is now read-only.

Chocolatey incorrectly adds things to PATH multiple times #591

Closed
DanTup opened this issue Oct 19, 2014 · 4 comments
Closed

Chocolatey incorrectly adds things to PATH multiple times #591

DanTup opened this issue Oct 19, 2014 · 4 comments

Comments

@DanTup
Copy link

DanTup commented Oct 19, 2014

My path currently looks like this:

M:\Apps\dart-sdk\bin;C:\Users\Danny\AppData\Roaming\Pub\Cache\bin;M:\Apps\dart-sdk\bin;C:\Users\Danny\AppData\Roaming\Pub\Cache\bin;M:\Apps\dart-sdk\bin;C:\Users\Danny\AppData\Roaming\Pub\Cache\bin;

My install script looks like this:

Install-ChocolateyPath "$installDir\bin"
Install-ChocolateyPath "${env:USERPROFILE}\AppData\Roaming\Pub\Cache\bin"
$env:Path = "$($env:Path);$installDir\bin;${env:USERPROFILE}\AppData\Roaming\Pub\Cache\bin"

As I understand it, the bottom line doesn't save anything back to PATH in Windows, it's only for the current session. This makes me think that Install-ChocolateyPath is adding things to path when they already exist.

@DanTup DanTup changed the title Incorrectly adds things to path Chocolatey incorrectly adds things to PATH multiple times Oct 19, 2014
@DanTup
Copy link
Author

DanTup commented Oct 19, 2014

Example:

PS M:\Coding> cinst dart-sdk
PATH environment variable does not have M:\Apps\dart-sdk\bin in it. Adding...
PATH environment variable does not have C:\Users\Danny\AppData\Roaming\Pub\Cache\bin in it. 

PS M:\Coding> cinst dart-sdk -force
PATH environment variable does not have M:\Apps\dart-sdk\bin in it. Adding...
PATH environment variable does not have C:\Users\Danny\AppData\Roaming\Pub\Cache\bin in it. Adding...

@ferventcoder
Copy link
Contributor

Curious about the actual PATH - like in the registry or in Control Panel -> System.
Both PowerShell and Cmd.exe are very limited in their ability to refresh environment variables.

@DanTup
Copy link
Author

DanTup commented Oct 20, 2014

The path I pasted was copied from the Windows Advanced System Settings -> Environment Variables section.

I think this is reliably reproducible if you run the commands I included (cinst dart-sdk then cinst dart-sdk -force).

@ferventcoder
Copy link
Contributor

This is fixed by chocolatey/choco#303 I believe, and further fixed by chocolatey/choco#699

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants