Setting an install's Product Version programatically

Got a problem you cannot solve? Try here.
Post Reply
ken rentz
Posts: 71
Joined: Mon Jan 23, 2006 5:33 pm
Contact:

Setting an install's Product Version programatically

Post by ken rentz »

Is it possible to set a project's product version by a compiler variable or other means? We are trying to automate the generation of our installs, and having to update the product version from the GUI makes this difficult at best.
Alex_Ronquillo
Site Admin
Posts: 364
Joined: Mon Jul 30, 2007 11:51 am
Location: USA
Contact:

Post by Alex_Ronquillo »

Sure, you can use Compiler Variables for the version field. Just remember to dereference the variable in the form #Variable#
Alejandro Ronquillo
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
MortSkil
Posts: 59
Joined: Mon Oct 30, 2006 3:27 am
Location: Trondheim, Norway

Post by MortSkil »

If I enter e.g. #MY_VERSION# into the Product Version field in Project Properties, a message pops up:
Incorrect Product Version Value
Only numbers and periods are allowed in this field.
I guess this would be safely ignored, because the following procedure works:

In Compiler Variables, I have defined MY_VERSION and assigned it a default value.

Then, I build the IA project with the following command line:
miabuild.exe myproject.mpr /b=0 MY_VERSION=1.2.3.456
and the build completed successfully, with the expected version indicated when I open properties for the generated installer exe.
ken rentz
Posts: 71
Joined: Mon Jan 23, 2006 5:33 pm
Contact:

Post by ken rentz »

You're right. If we ignore the error message, everything seems to work all right.

It would be nice if we could get a confirmation that the error message is actually a bug. I've never liked writing code that relies on quirks that could be fixed at any moment.
Alex_Ronquillo
Site Admin
Posts: 364
Joined: Mon Jul 30, 2007 11:51 am
Location: USA
Contact:

Post by Alex_Ronquillo »

If you read the help file contents topic "Using Compiler Variables" you will see:
You can always use compiler variables where regular string expressions are allowed, even if regular (script) variables have been prohibited.
Therefore the error message cannot be considered a bug
Alejandro Ronquillo
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
Post Reply