Archive: Dynamic OutFile based on GetDllVersionLocal


Dynamic OutFile based on GetDllVersionLocal
Hi, I'm looking to generate the OutFile name based on the result of a GetDllVersionLocal call, I've made a function that gets the version fomated how I want and places it in $0, but it doesn't seem I can call functions outside sections, and this wouldn't be done on the remote system, its only local.

The logic is that I want the OutFile to be named "Setup App 1.0.0.exe", but want to automate this. I saw an example on the wiki on how to specify it externally on the command line, but that would still require me getting the version number from somewhere else.

Any ideas? Thanks!


you can't generally mix runtime and compile time commands.

Your best bet - short of a third party utility - is to (compile and) run one installer that uses GetDllVersionLocal on the file you need, and writes out the single line:
'OutFile <result of that GetDllVersionLocal call>' to, say 'outfile.nsc' ('c' for 'clipping' - I dunno, you pick something).

Then in your main installer script, include that file where you would otherwise have the 'OutFile' instruction.

Done! Have coffee :)

You can launch that first 'installer' (that does nothing more than get the version and writes out the little file for inclusion) from the first installer using !execute or !system, so you wouldn't have to worry about running that manually.