View Full Version : Query MSI Database for File Version

05-25-2005, 09:37 AM
I'm writing a Custom Action DLL in C++ that needs to report the version of a file being installed before the file is actually installed.

:confused: Can this be done? How? Any code examples? :confused:

I've tried using the API call MsiGetFileVersion..

MsiGetFileVersion(szFileName, *szFileVersion, &dwBuffer, 0, 0);

..but I get an error when compiling that says..

Error: Unresolved external MsiGetFileVersionA :eek:

06-01-2005, 09:57 AM
That API might be intended for files already on the target system; to read the version from the File table at run time, perhaps see this InstallShield newsletter article: http://www.installshield.com/news/newsletter/0302-articles/msiaccess.asp.

06-13-2005, 08:40 PM
Need to reference MSI.lib and some header files, I think MSIQUERY.h