Page 1 of 1

Copy the Product Version from another exe

Posted: Wed Sep 03, 2014 2:42 pm
by MorganeJ
Hi,

I'm new using Installaware.
I searched for several hours the solution on your forum but I was not able to find how to do what I would like to achieve.
I would like to:
- read the Product Version of a "3rd party library" executable (visible in Properties > Details on the explorer on UsedExecutable.exe file)
- copy it inside the Product Version of my installer ($VERSION$ I supposed ?)

How can I do that ?

Thank you for your help,

Morgane

Re: Copy the Product Version from another exe

Posted: Thu Sep 04, 2014 9:32 am
by FrancescoT
Dear Morgane,

it is possible to get the version of an EXE file or a Dll using the "GetFileVersionInfo" WIN API via "Call DLL Function" script command.
http://msdn.microsoft.com/en-us/library/windows/desktop/ms647003(v=vs.85).aspx

However, It is not possible to use the value returned from the above function, to assign the Product Version of your installer at Runtime.
This due the fact that "Project Version" must be resolved at Compile Time.

Regards

Re: Copy the Product Version from another exe

Posted: Thu Sep 04, 2014 2:24 pm
by MorganeJ
Dear FrancescoT,

Thanks a lot for your answer.
The GetFileVersionInfo was what I wanted.
About the Compile Time, does it mean that the only way to set the Product Version of my installer is using the compiler variable and hardcode the product version of the exe ?

Re: Copy the Product Version from another exe

Posted: Fri Sep 05, 2014 11:08 am
by FrancescoT
Dear Morgane,

About the Compile Time, does it mean that the only way to set the Product Version of my installer is using the compiler variable and hardcode the product version of the exe ?

Not exactly.

I mean that the PRODUCTCODE value must be resolved at COMPILE TIME. Generally this is defined in the project properties of the IA IDE and in this case, its value is hard-coded with the project.

Alternatively, it can be assigned using a custom COMPILER variable and for this purpose, I suggest you have a look at the sample available with the following link ... it demonstrates exactly how to achieve this.
http://www.installaware.com/forum/viewtopic.php?f=2&t=8927

Please note, it is possible to automate the build process using the "MIABUILD" command line tool ...and the tool accepts compiler variables with command line. Please refer to IA documentation for more details.

Regards

Re: Copy the Product Version from another exe

Posted: Thu Sep 11, 2014 9:18 am
by MorganeJ
Dear Francesco,

Thanks a lot for the information, I will try to get it working.
Thank you for your help!

Re: Copy the Product Version from another exe

Posted: Thu Sep 11, 2014 11:53 am
by FrancescoT
:D