Click to See Complete Forum and Search --> : How can i Get version from a .exe install package


DDRinDOOL
November 11th, 2003, 12:59 AM
How can I get the Version information from a Install Package.
The package is wrapped by InstallShield, and MsiGetFileVersion()
can only get version of InstallShield from which the .exe file is wrapped.
you can see the "real" version info by RightClicking , Property, and selecting "Version " Tab.
How can I get this?
3x a lot!
~~Bow~~

hankdane
November 11th, 2003, 12:52 PM
You can see my recent article, Versioning in Windows (http://www.codeguru.com/win32/Versioning.html). The information that shows up in Explorer properties is using the same method.

However, version information is usually stored in the tables inside the msi file. Open the msi file with Orca, and see if you can locate the version information you are looking for inside.

DDRinDOOL
November 12th, 2003, 02:44 AM
Thanks a lot!
however , I still have problems.
First, ->dwProductVersionMS and ->dwProductVersionLS can only
convert to version info in Major.Minor mode, can I get
xxxx.xxxx.xxxx.xxxx Mode?
I use
int minor2 = lpFFI->dwFileVersionLS & 0xf;
int minor1 = (lpFFI->dwFileVersionLS >> 16) & 0xf;
int major2 = lpFFI->dwFileVersionMS &0xf;
int major1 = (lpFFI->dwFileVersionMS >> 16) & 0xf;
but failed.

Seconde, I use InstallShield wrapped file, I can't get correct
version info from that. And ,It's wrapped by InstallShield ,can I access MSI table ? What is Orca?
3x
bow~~

hankdane
November 12th, 2003, 06:44 PM
Failed how? Anyway, the CVersionInfo class does this for you, or you can look at the code. Your approach looks correct but I can't see immediately what is wrong.

Orca comes with the Platform SDK, look for Orca.msi. It's a tool for modifying or viewing MSI files. You can read the version information from the File table, either through Orca or your own MSI calls. However, it's good to validate with Orca that you are reading the correct values, so I would install it regardless.