Archive: Manipulate the PATH environmental variable with NSIS


Manipulate the PATH environmental variable with NSIS
Hello,

On the web, I found many examples describing how to edit the PATH environmental variable through NSIS (i.e. http://nsis.sourceforge.net/Path_man...on_in_run-time). However, considering that NSIS has a limitation on the size of a string (1024 bytes), I was wondering if it's safe to edit the system PATH environment variable directly through NSIS by editing the registry entry or if it's better to use an external DLL that handles all the editing and to which simply pass the path to add/remove. All the examples I found seem to don't consider the limit to the string size. So, is the size limit a real problem?

Thank you.


Guglielmo


...However, considering that NSIS has a limitation on the size of a string (1024 bytes)...
The large string version bumps that limit up to 8192 bytes.

The size limit is a problem if the path sting is more than 1024 characters. If you think that may occur, try the special build that goes up to 8192 characters (I think) or, indeed, use a DLL (or a system call - if one exists).


That's what I thought :-(... OK, I will probabilly go with an external DLL..

Thanks guys for the replay