Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How determine if MSXML6 is installed in a system using Delphi?

Tags:

xml

delphi

msxml

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

like image 416
Salvador Avatar asked Mar 23 '12 20:03

Salvador


1 Answers

you can check if the CLSID exist in the registry using the CLSIDFromProgID function, for MSXML the CLSID is Msxml2.DOMDocument.6.0

Check this sample 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.
like image 129
RRUZ Avatar answered Oct 14 '22 08:10

RRUZ