Setting an install's Product Version programatically

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

Setting an install's Product Version programatically

Postby ken rentz » Tue Sep 04, 2007 4:35 pm

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:

Postby Alex_Ronquillo » Tue Sep 04, 2007 5:50 pm

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

Postby MortSkil » Wed Sep 05, 2007 7:19 am

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:

Postby ken rentz » Fri Sep 07, 2007 4:55 pm

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:

Postby Alex_Ronquillo » Fri Sep 07, 2007 5:12 pm

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/


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 157 guests