dmd installer clobbers PATH on Windows (sometimes)

Brad Anderson eco at gnuk.net
Mon Aug 1 12:12:43 PDT 2011


On Mon, Aug 1, 2011 at 12:54 PM, Brad Anderson <eco at gnuk.net> wrote:

> I can make a pull request. I do think we should do what we can to have the
> person that rolls the release (Walter?) use the special build though. That
> way nearly everyone can benefit from the convenient PATH update in the
> installer.  We programmers tend to have very large PATH variables and it'd
> be unfortunate if many D users received an error message whenever they
> installed and were forced to update their PATH manually (although that's
> clearly an improvement over the current situation).
>

Pull request made.  I have not tested it as I'm not familiar with the dmd
build process and don't have time at the moment to figure it out. I can test
some other day if necessary.


>
>

> On Mon, Aug 1, 2011 at 12:35 PM, Ary Manzana <ary at esperanto.org.ar> wrote:
>
>> On 8/1/11 2:58 PM, Brad Anderson wrote:
>>
>>> The NSIS script used to update the environment
>>> variable (EnvVarUpdate) has the following warning [1]:
>>>
>>> "Warning this code will replace paths rather than append if the existing
>>> path exceeds the maximum string length in the NSIS build you are using.
>>> Some setup crash can also occurs."
>>>
>>> The default maximum string length is 1024.  There is a special build of
>>> NSIS [2] which has a larger maximum string length (8192) that would help
>>> avoid this problem.  There is also a patch [1] for EnvVarUpdate that
>>> detects if the PATH will be overwritten instead of appended to and tells
>>> the user to update their PATH manually.
>>>
>>> I've seen this issue complained about before online but
>>> hadn't experienced it myself until recently.  It can be a rather
>>> frustrating problem to experience as restoring your PATH isn't trivial
>>> because there is no way (that I know of) to look at what your PATH was
>>> before it was destroyed and the PATH is often updated by installers (as
>>> it is with dmd).
>>>
>>> [1]
>>> http://nsis.sourceforge.net/**Environmental_Variables:_**
>>> append,_prepend,_and_remove_**entries#Warning<http://nsis.sourceforge.net/Environmental_Variables:_append,_prepend,_and_remove_entries#Warning>
>>> [2] http://nsis.sourceforge.net/**Special_Builds<http://nsis.sourceforge.net/Special_Builds>
>>>
>>> Regards,
>>> Brad Anderson
>>>
>>
>> Hi Brad,
>>
>> IIRC I wrote the installer and I knew about the problem too because some
>> people started complaining about it but I didn't know of the solution (maybe
>> at that moment the solution was not known). So good you found it :-)
>>
>> What we can do is to copy this patched EnvVarUpdate function to the
>> installer script and use it, I think it'll be much more safe than to just
>> hope the system that runs the nsis script has the patched function or the
>> special build.
>>
>> What do you think? Could you make that change and do a pull request? (I
>> don't have a Windows machine near me anymore nor a VM).
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20110801/ffab5eb7/attachment.html>


More information about the Digitalmars-d mailing list