Here's what we're going with.  Seems to work OK...
 
                Type t = 
Type.GetTypeFromProgID("WindowsInstaller.Installer");
                Installer iInstaller = 
(Installer)Activator.CreateInstance(t);
 
                string strPatchPath = null;
                string strPatchCode = null;
                string strProdCode = null;
                string strPatchXML = null;

                XmlDocument xmlMsiPatch = new XmlDocument();
                
                if (MinMsiVersion > 
Convert.ToDouble(iInstaller.Version.Substring(0, 
iInstaller.Version.IndexOf('.'))))
                {
                    MessageBox.Show("Minimum Windows Installer version " + 
MinMsiVersion + " required.  Current version is " + iInstaller.Version, 
"Windows Installer version problem...");
                }
 
                strPatchPath = "<patch to .msp>";
                strPatchXML = iInstaller.ExtractPatchXMLData(strPatchPath);
 
                xmlMsiPatch.LoadXml(strPatchXML);
 
                strPatchCode = 
xmlMsiPatch.DocumentElement.Attributes["PatchGUID"].Value;
                strProdCode = 
xmlMsiPatch.GetElementsByTagName("TargetProductCode").Item(0).InnerText;
 
                //Now check if patch is applied...
                int rtn = 0;

                dynamic ePatch = iInstaller.get_Patches(strProdCode);
  
                if (ePatch.count > 0)
                {
                    for (var i = 0; i < ePatch.count; i++)
                    {
                        if (ePatch[i] == strPatchCode)
                        { 
                            MessageBox.Show("here");
                            rtn = 1;
                        }
                    }
                }
 
Hope this helps someone!

-- 
-- 
You received this message because you are subscribed to the Google
Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML
Web Services,.NET Remoting" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/dotnetdevelopment?hl=en?hl=en
or visit the group website at http://megasolutions.net

--- 
You received this message because you are subscribed to the Google Groups 
"DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web 
Services,.NET Remoting" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to