Sunday, March 25, 2012

Inno Setup, Part 7. Integrating Inno Setup with SVN.

It is convenient when installer gets its version number automatically. There are different systems of software versioning. For our builds we are using the following system:

major version . minor version . revision . build

First three numbers are set manually since they are being changed not very often. Last number build is taken from version control system, in our case it is SVN.
Let’s discuss what we need to do for automatic versioning of Inno Setup installers.
First you need to create installer script for your program as usual, let’s call it OurProgram.iss. In its Setup section there is an additional line:
VersionInfoVersion = 1.0.0.$WCREV$
Also you are creating bat file containing the following line:

SubWCRev.exe . OurProgram.iss OurProgram_version.iss

When you need to make the installer, you are launching this bat file first. It will generate OurProgram_version.iss Inno Setup script. SubWCRev.exe program which is a part of SVN installation will substitute $WCREV$ with current build number. So in OurProgram_version.iss you will find the line like:
VersionInfoVersion =
Then you are building installer with the help of OurProgram_version.iss script. And the resulting file will have the version number you need.
The similar method for automatic versioning can be used for C++/C# exe files, we will talk about this in one of the next posts.

No comments:

Post a Comment