Browse Source

MsXmlInstalled counter

Source commit: 84cc0cfcdc172732da503134aee8faa67e62add0
Martin Prikryl 1 year ago
parent
commit
5ec4b5f3e2
1 changed files with 13 additions and 0 deletions
  1. 13 0
      source/windows/WinMain.cpp

+ 13 - 0
source/windows/WinMain.cpp

@@ -20,6 +20,7 @@
 #include "WinApi.h"
 #include <DateUtils.hpp>
 #include <StrUtils.hpp>
+#include <Xml.Win.msxmldom.hpp>
 //---------------------------------------------------------------------------
 #pragma package(smart_init)
 //---------------------------------------------------------------------------
@@ -632,6 +633,18 @@ void __fastcall UpdateStaticUsage()
   Configuration->Usage->Set(L"PowerShellVersion", GetPowerShellVersionStr());
   Configuration->Usage->Set(L"PwshVersion", GetPowerShellCoreVersionStr());
 
+  bool MsXmlInstalled;
+  try
+  {
+    TMSXMLDOMDocumentFactory::CreateDOMDocument();
+    MsXmlInstalled = true;
+  }
+  catch (...)
+  {
+    MsXmlInstalled = false;
+  }
+  Configuration->Usage->Set(L"MsXmlInstalled", MsXmlInstalled);
+
   UnicodeString ParentProcess = GetAncestorProcessName();
   // do not record the installer as a parent process
   if (!ParentProcess.IsEmpty() &&