Archive: LogicLib.nsh portability stuff


LogicLib.nsh portability stuff
Hi all,

I got a bug report about certain of the examples failing to build on debian (http://bugs.debian.org/319936).

One of those is LogicLib.nsi. Looking at the problems, it seems certain parts rely on stuff available on Windows only.

In 2.08 LogicLib.nsh, the following lines seem like they should be replaced with commands in the NSIS language:

702: !define ${_Switch}Tmp "$%TMP%\${__LINE__}.tmp" ; Get a name for a temporary file
703: !system `echo # logiclib temp file > "${${_Switch}Tmp}"` ; and create it
720: !system `echo !insertmacro _== $\`${${_Switch}Var}$\` $\`${_a}$\` ${_label} "" >> "${${_Switch}Tmp}"`
752: !system `del "${${_Switch}Tmp}"` ; and clear it up
Specifically, there needs to be a build-time $TEMP, and a way to create/write/delete files at build time.

For now I'll change these to use the Linux equivalents on debian, but it would be good if these were more portable in 2.09. The echo !insertmacro line seems a bit tricky tho.

Also, the filename chosen is a bit of a security risk - the filename should be random, not pre-determined, otherwise an attacker could insert some commands into that file between calling _Switch and _Case. Other option might be to place these commands into a variable instead of a file.

Please submit a bug report (or a patch, if you have one).


Added 2 patches, one for all the examples, and one for the LogicLib portability stuff - the resulting LogicLib.nsh won't work on windows though.