Search code examples
vb.netinstallationdetectionmsxml

How to: Programmatically detect if MSXML parser (version 3+) is installed or not


Can anyone help me out, how to detect if MSXML parser is installed on a machine or not. I looked for a registry entry,but unable to get one. I am writing a VB.NET application. Thanks in advance :)


Solution

  • One way you can do it is to create an instance of one of the MSXML objects in your code. e.g.

    Dim t As Type
    Dim o As Object

    ' If this code causes an exception the object doesn't exist t = Type.GetTypeFromProgID("MSXML2.DOMDocument") o = Activator.CreateInstance(t); System.Runtime.InteropServices.Marshal.ReleaseComObject(o)

    I apologize if my vb.net code is bad :)