views:

47

answers:

1

I have a nsis script to create an installer package of a tool in .NET, and works fine.

The problem is that I want to integrate it in my build system (currently using NANT, but migrating to rake using ironruby)

The version for the product is stored in a txt file which is read to generate the assemblyinfo, currently the build system autoupdates the build version number, but major and minor numbers are changed by hand.

I want the script to generate an installer executable with the version number in the installers filename, and also in the installer screens, but I don't know how to pass variables as arguments to the NSIS file.

A solution I'm considering is create a template of the NSIS script with some placeholders, and using ruby (though rake) to change those place holders with the appropiate version numbers, and then generate the installer, but seems like a dirty hack to me.

Does anyone has a better suggestion?

A: 

I'd say you have two options:

  • Pass the version numbers as arguments to the compiler: makensis /Dbuild=1234 myscript.nsi (You can then use ${build} in your script)
  • Generate a .nsh with some !define's in it on the fly and !include this .nsh in your script
Anders
I think the first option will be fine.Thanks!
Ricky AH