From e29faa95c3958727ea21720b77ad5ad2a645fa67 Mon Sep 17 00:00:00 2001 From: kpreisser Date: Sun, 10 Oct 2021 11:11:48 +0200 Subject: [PATCH] Don't check for presence of "d3dcompiler_47.dll" when running as ARM64, because that file isn't present in the CEF Redist for this architecture. Issue #2944 --- CefSharp/DependencyChecker.cs | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/CefSharp/DependencyChecker.cs b/CefSharp/DependencyChecker.cs index 25e8c09d89..79475ac79b 100644 --- a/CefSharp/DependencyChecker.cs +++ b/CefSharp/DependencyChecker.cs @@ -5,7 +5,13 @@ using System; using System.Collections.Generic; using System.IO; +#if NETCOREAPP +using System.Linq; +#endif using System.Reflection; +#if NETCOREAPP +using System.Runtime.InteropServices; +#endif using System.Text; namespace CefSharp @@ -21,6 +27,11 @@ public static class DependencyChecker /// public const string LocalesPackFile = @"locales\en-US.pak"; + /// + /// File name of the Direct3D Compiler DLL. + /// + private const string D3DCompilerDll = "d3dcompiler_47.dll"; + /// /// List of Cef Dependencies /// @@ -60,7 +71,8 @@ public static class DependencyChecker // Note: Without these components HTML5 accelerated content like 2D canvas, 3D CSS and WebGL will not function. "libEGL.dll", "libGLESv2.dll", - "d3dcompiler_47.dll", + // The D3D Compiler isn't included in the win-arm64 redist; we remove it in the static constructor. + D3DCompilerDll, //Crashpad support "chrome_elf.dll" }; @@ -99,6 +111,17 @@ public static class DependencyChecker #endif }; +#if NETCOREAPP + static DependencyChecker() + { + // win-arm64 doesn't ship with a copy of the D3D Compiler, it's included with the OS. + if (RuntimeInformation.ProcessArchitecture is Architecture.Arm64) + { + CefOptionalDependencies = CefOptionalDependencies.Where(x => x != D3DCompilerDll).ToArray(); + } + } +#endif + /// /// CheckDependencies iterates through the list of Cef and CefSharp dependencines /// relative to the path provided and returns a list of missing ones