(GH-252) PATH exceeding 2048 breaks choco. Use %systemroot% in place of %windir%. #251
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue: #252
%windir% is broken when %path% exceeds 2048 chars, but %systemroot% continues to work.
I found this issue due to cygwin rewriting my PATH to larger than 2048 I believe...
when I echo %windir%, it just prints %windir%.
when I echo %systemroot%, it prints C:\Windows.
I found this from the superuser ticket.
http://superuser.com/questions/719459/strange-path-issue-in-windows-7-goes-null-after-being-set
http://allgeekallthetime.blogspot.com/2012/01/path-over-2048-chars-kills-windir.html
The user experiences something like this:
XXX not upgraded. An error occurred during installation: Unable to find suitable location for PowerShell. Searched the following locations: '%windir%\SysNative\WindowsPowerShell\v1.0\powershell.exe; %windir%\System32\WindowsPowerShell\v1.0\powershell.exe; powershell.exe'
Which is a little confusing, because running powershell.exe works fine. I leave it to the merger to decide if %systemroot% should replace the %windir%, the fix supplied simply adds %systemroot% in addition to %windir%...this works fine too.
Thanks for choco.
--dave