Archive: Large string robust solutions


Large string robust solutions
I recently ran into the 1024 character string size limit, detailed here (among other places):

http://nsis.sourceforge.net/Talk:Env...remove_entries
http://nsis.sourceforge.net/Special_Builds

While I know of the special build above (for 8192 length strings), this does not entirely satisfy my needs. For example, in an open source project, an unsuspecting developer might try to build my installer with a normal copy of NSIS and run into the 1024 limit. Also, it may theoretically be possible for environment variables longer than 8192 characters to exist (according to http://support.microsoft.com/?kbid=830473 , the limit is around 32k, although cmd in current versions of Windows will ignore variables longer than 8k).

Is there a way to robustly handle the case where I don't necessarily know that NSIS was specially configured to handle 8192? E.g. can I either check at installer build time that we are using a large strings NSIS, or can I get the string length limit in NSIS dynamically and check it against the environment variable length.

If these have been answered elsewhere, links would be appreciated. (My searches have revealed only the special builds and discussions above, with no mentions of robust solutions.)

Thanks in advance.


Check ${NSIS_MAX_STRLEN} with !if and throw an !error.

Stu


Thanks, works great!