瀏覽代碼

MsXmlInstalled counter

Source commit: 84cc0cfcdc172732da503134aee8faa67e62add0
Martin Prikryl 1 年之前
父節點
當前提交
5ec4b5f3e2
共有 1 個文件被更改,包括 13 次插入0 次删除
  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() &&