Page 1 of 1

Can a compiler variable (or regular var) come from a file?

Posted: Wed May 23, 2007 4:53 pm
by cmead
I was hoping to be able to read a version string from a text file external to InstallAware and use it as a compiler variable or regular variable. I want to do this in order to share the version string between my product and the installer (which is in a text file).

Does anyone know a way to do this?

Thanks in advance,
Chris

Posted: Mon Jun 04, 2007 2:59 pm
by jweksej
I've done it in external batch files. The file is read and then IA is called and version info is passed as command line parameters. If you are interested in details, let me know.
Jarek

Posted: Mon Jun 04, 2007 5:23 pm
by cmead
Thanks Jarek,
I solved it the same way... using the command line build for IA to override my default compiler constant values.
Cheers,
Chris

Posted: Mon Jun 18, 2007 7:10 am
by kcchenkd
hi jarek,

How can i pass version info as command line parameters?

Thanks.

Posted: Mon Jun 18, 2007 8:13 am
by cmead
Just use miabuild.exe to pass compiler constants. The values that you pass will overwrite whatever is set inside the IDE. Something like this:

miabuild.exe projFile.mpr PRODUCTVERSION=1.2.3.4

where you have a PRODUCTVERSION compiler constant.

Posted: Mon Jun 18, 2007 8:39 am
by kcchenkd
Thanks Chris,

then how do i set install product version to that complier constant? I had try to put something like $PRODUCTVERSION$ on Product version on project properties page, but it does not work.

Thanks.

Posted: Mon Jun 18, 2007 8:53 am
by cmead
On my 'project options'/'compiler variables' page, I have:

PRODUCTVERSION 0.0.000.0

In my code, I use: #PRODUCTVERSION#

Posted: Mon Jun 18, 2007 9:29 am
by kcchenkd
Thanks, it works,

I don't know why I use "$" instead of "#" before.

Thanks for your help