RobertvanderHulst
Posts: 22
Joined: Wed Mar 04, 2009 4:09 pm

Automatically update file version number in registry string

I need to write a registry string with a value that looks like

Code: Select all

"<SomeInfo>, Version=<VersionNumber of FIle in MSI>, <Some more info>"
At this moment I am using [ProductVersion] and I am trying to keep the version of the installer and file in sync, but I would prefer to use
the real version of the file

Is there a way that I can automatically read the version number of the file (on the development machine or in the MSI package)
and include it in the registry string contents.

Robert van der Hulst
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Automatically update file version number in registry string

Hi,

Indeed, using a custom action is the only solution. Unfortunately Windows Installer doesn't offer support for reading the version of a file inside the package.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
RobertvanderHulst
Posts: 22
Joined: Wed Mar 04, 2009 4:09 pm

Re: Automatically update file version number in registry string

cosmin wrote:Hi,

Indeed, using a custom action is the only solution. Unfortunately Windows Installer doesn't offer support for reading the version of a file inside the package.
I understand. However, this could also be an option for Advanced Installer.
It could read the version of the file before it creates the MSI (it already does, because it shows the version on the Files & Folders page) and automatically assign
it to a property.

What do you think of that ?

Robert
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Automatically update file version number in registry string

Hi Robert,

You can check out our command line for Set Version. You can use the -fromfile option to set your installer's version from a file.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
RobertvanderHulst
Posts: 22
Joined: Wed Mar 04, 2009 4:09 pm

Re: Automatically update file version number in registry string

Gabriel,
GabrielBarbu wrote:Hi Robert,
You can check out our command line for Set Version. You can use the -fromfile option to set your installer's version from a file.
I don't want to update the Installer version. I want to get the version from a particular file in the MSI and include that version number in a registry string.
We are creating a Visual Studio Package, and VS wants to have the version number of an assembly as part of a string in the registry.
For example
Our product is version 1.2.0
The file is version 1.2.3.456
The registry string needs to contain the value 1.2.3.456

Robert
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Automatically update file version number in registry string

Hello,

For the moment, the custom action provided by Andrew appears to do the job.
We will take into consideration implementing it in a future version of Advanced Installer.

Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/

Return to “Common Problems”