Page 1 of 1

Setting an install's Product Version programatically

Posted: Tue Sep 04, 2007 4:35 pm
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.

Posted: Tue Sep 04, 2007 5:50 pm
by Alex_Ronquillo
Sure, you can use Compiler Variables for the version field. Just remember to dereference the variable in the form #Variable#

Posted: Wed Sep 05, 2007 7:19 am
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.

Posted: Fri Sep 07, 2007 4:55 pm
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.

Posted: Fri Sep 07, 2007 5:12 pm
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