PDA

View Full Version : Cannot get product version from setup.exe



alkemist
10-30-2009, 04:27 PM
When I read the Setup.exe product version within my application, I get the Installshield version of 16.0.0.0 instead of the product version defined within the General Tab. The file version is correctly showing as 16.0.0.400; so how do I get the product version information?

I am using the GetFileVersionInfo and VerQueryValue functions.

Sample code from Microsoft can be found at http://support.microsoft.com/kb/139491

Ajay Ladsaria
11-12-2009, 01:36 PM
You may want to try and get your product's version a different way. For example, if you are trying to get the version after your product has been installed, then you could check the MSI Uninstall registry key pertaining to your product:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{YourInstallProductCode}
DisplayVersion REG_SZ

Or you could try using a MSI API to get the version:
MsiGetProductInfo Function
http://msdn.microsoft.com/en-us/library/aa370130(VS.85).aspx

If you are trying to get the version from a custom action during the install, then you could try using MsiGetProperty (C++ DLL) or Session.Property (VBScript).

scottd72
07-29-2010, 11:08 AM
I have the same problem/question.

Using GetFileVersionInfo and then VerQueryValue to retrieve the dwProductVersionMS and dwProductVersionLS values always returns 16.0.0.0. I get the correct product versions of any other exe I test, just not the Installshield Setup.exe.

I'm trying to find the product version of the setup.exe before it is installed, so I don't think using MsiGetProductInfo will help me.

So how can I get the correct product version from the setup.exe?

Thanks.