todd_run
25th June 2005 00:21 UTC
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!
Afrow UK
25th June 2005 10:56 UTC
What does this property file look like? Can it be read using ReadINIStr?
-Stu
todd_run
27th June 2005 19:50 UTC
Yes, that was it. I passed over this time and time again while going through the docs. Thanks!
saivert
30th June 2005 06:25 UTC
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.
todd_run
30th June 2005 15:23 UTC
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!
Afrow UK
30th June 2005 16:04 UTC
Rather than use placeholders you could have just written the vars to another file and !include it in the main script.
-Stu