The following code might be helpful. But remember that you first need to add the COM link to the Microsoft Windows Installer object library and add the WindowsInstaller namespace to your code. The following function may be required.
public static string GetMsiInfo( string msiPath, string Info) { string retVal = string.Empty; Type classType = Type.GetTypeFromProgID( "WindowsInstaller.Installer" ); Object installerObj = Activator.CreateInstance( classType ); Installer installer = installerObj as Installer;
If you need a version, specify the name of the MSI file you want, for example
string version = GetMsiInfo( "d:\product.msi", "ProductVersion" );
source share