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

Got a problem you cannot solve? Try here.
Post Reply
cmead
Posts: 8
Joined: Tue May 01, 2007 8:33 am

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

Post 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
jweksej
Posts: 93
Joined: Wed Sep 27, 2006 4:54 am

Post 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
cmead
Posts: 8
Joined: Tue May 01, 2007 8:33 am

Post 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
kcchenkd
Posts: 4
Joined: Fri Apr 21, 2006 1:06 pm

Post by kcchenkd »

hi jarek,

How can i pass version info as command line parameters?

Thanks.
cmead
Posts: 8
Joined: Tue May 01, 2007 8:33 am

Post 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.
kcchenkd
Posts: 4
Joined: Fri Apr 21, 2006 1:06 pm

Post 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.
cmead
Posts: 8
Joined: Tue May 01, 2007 8:33 am

Post by cmead »

On my 'project options'/'compiler variables' page, I have:

PRODUCTVERSION 0.0.000.0

In my code, I use: #PRODUCTVERSION#
kcchenkd
Posts: 4
Joined: Fri Apr 21, 2006 1:06 pm

Post by kcchenkd »

Thanks, it works,

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

Thanks for your help
Post Reply