您可以使用CLSIDFromProgID函数检查注册表中是否存在CLSID ,对于MSXML,CLSID是Msxml2.DOMDocument.6.0
检查此示例应用
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.
Run Code Online (Sandbox Code Playgroud)