cpack NSIS feature request: allow reading extra commands from file (in stead of string variables)
Populating CPACK_NSIS_EXTRA_INSTALL_COMMANDS
and friends is very complicated, because each backslash and double quote has to be escaped. And within the cmake
environment it seems the strings are interpreted at least twice. And the NSIS escape rules are different from the cmake escape rules.
In the end it's mainly trial and error to get the right number of backslashes.
If there was an option CPACK_NSIS_EXTRA_INSTALL_FILE
where the content of that file would be inserted verbatim into the generated .nsi
file that would make life a lot easier.
I've tried using file(READ)
and similar methods to read CPACK_NSIS_EXTRA_INSTALL_COMMANDS
but that doesn't help: the strings are still interpreted by cmake
and cpack
at various points.
And using NSIS !include
has the problem that I don't know the (relative) pathnames to use to refer to "my" .nsi
file.