How can I determine if MSXML6 is installed on a system using delphi?

I have an application that depends on MSXML6 , on most machines when deploying the application, this package is already installed, but in a few cases MSXML6 is not installed, the question is, how can I check if MSXML 6 is installed?

+3


source to share


1 answer


you can check if CLSID exists in registry using CLSIDFromProgID function , for MSXML CLSID -Msxml2.DOMDocument.6.0

Check this example app



uses
  ActiveX,
  SysUtils;

{
        Msxml2.DOMDocument.2.6
        Msxml2.DOMDocument.3.0
        Msxml2.DOMDocument.4.0
        Msxml2.DOMDocument.5.0
        Msxml2.DOMDocument.6.0
}
var
  clsid: TCLSID;
begin
  try
    if Succeeded(CLSIDFromProgID('Msxml2.DOMDocument.6.0', clsid)) then
     Writeln('MSXML 6.0 Installed')
    else
     Writeln('MSXML 6.0 Not Installed');
  except
    on E: Exception do
      Writeln(E.ClassName, ': ', E.Message);
  end;
  Readln;
end.

      

+6


source







All Articles