Archive: Using an external property file at compile time


Using an external property file at compile time
I swear I saw a quick and easy way to use an external property file to set variables in a .nsh file. Of course, I didn't pay enough attention to really understand it, or to make a note of where I found it.

I already have a property file that I use with an ant script - I'd love to have my nsh script use this same info. Is it possible? If so, how?

Thanks in advance!


What does this property file look like? Can it be read using ReadINIStr?

-Stu


Yes, that was it. I passed over this time and time again while going through the docs. Thanks!


ReadINIStr is actually a run-time command so in order to use it at compile time you must write a new "installer" which performs the compile-time tasks and call this using !system in your script. Maybe have the "installer" create a .nsh file.


I actually I wrote the NSIS script with placeholders for the variables. I use ant to replace the placeholders and then to call makensis. This ended up being very convenient since it works with other parts of the build as well (no more trying to come up with a single property file with a format that works for multiple purposes).

Thanks all!


Rather than use placeholders you could have just written the vars to another file and !include it in the main script.

-Stu