网上找的...
System.Type oType = System.Type.GetTypeFromProgID("WindowsInstaller.Installer");
Installer inst = System.Activator.CreateInstance(oType) as Installer;
Database DB = inst.OpenDatabase(msipath, MsiOpenDatabaseMode.msiOpenDatabaseModeReadOnly);
string str = "SELECT * FROM Property WHERE Property = 'ProductCode'";
WindowsInstaller.View thisView = DB.OpenView(str);
WindowsInstaller.Record thisRecord = thisView.Fetch(); //这一行提示异常
thisView.Execute(thisRecord);
string result = thisRecord.get_StringData(2);
return result;
出现问题了