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:
[Setup]Also you are creating bat file containing the following line:
VersionInfoVersion = 1.0.0.$WCREV$
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:
[Setup]Then you are building installer with the help of OurProgram_version.iss script. And the resulting file will have the version number you need.
VersionInfoVersion = 126.96.36.199
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.