Talk:Environmental Variables: append, prepend, and remove entries

From NSIS Wiki

I have had reports of my installer overwriting the entire system path, rather than appending to it.

Has anyone else seen this happen ?

I can't reproduce the bug, but it has happened to at least two people from 2000 odd downloads of my software.

[edit] Maximum string length

Yes I also had reports concerning this problem and managed to reproduce it with a system path of more than 1024 characters, which is longer than the default maximum string length in NSIS. There should be error handling in EnvVarUpdate to prevent this. However, to correctly adapt the path, you will need to build NSIS with a greater string maximum length anyway (a special build with 8192 bytes is available).

Froesccn 12:56, 12 February 2009 (UTC)

Thanks Froesccn. I could reproduce it with >1024 paths as well. I rebuilt using the large string version of NSIS and the problem went away. I guess a note of this should be made pretty clear in the wiki page ? Using the short string version of NSIS and this code will result in the system path being cleared. Not fun explaining that to a user.

[edit] Installer/Uninstaller Examples

Where do the examples go in the installer script? Inside of the Section/SectionEnd? sag47

donate
ads