I am using Inno Setup to generate the installer of my application. How can set the version number of the setup.exe (VersionInfoVersion
) generated by Inno to match with the version number of my application automatically? Now every time I deploy a new version of my application I need to update the version number manually.
Now I'm doing this:
[Setup]
VersionInfoVersion=1.2.2.0 //writting the value manually
I want something like this:
[Setup]
VersionInfoVersion={Get the version of my app}
In case you have a pure webinstaller, the accepted solution won't work, because you simply won't have an application.exe to get the version number from.
I'm using Nant and a
build.xml
file with version number properties, which i manually bump, before i'm rebuilding the innosetup installers.My *.iss files contain a special token @APPVERSION@, which is replaced with the version number during the build process. This is done via a copy operation with an applied filterchain, see below.
InnoSetup Script (*.iss)
nant build.xml:
Another way to do it by using a command line argument :
and you just call your script as follow from a cmd :
It emulate
#define MyAppVersion="10.0.0.1"
in the iss script.If you are using CakeBuild, you can pass this argument as
I had some problems with getting this to work, so just contributing my solution.
app.iss:
Config.txt:
You can use the Inno Setup Preprocessor
GetFileVersion
function like this