Fixed EnviromentVariables in NativePaths for all device providers

This commit is contained in:
DarthAffe committed 2022-03-31 22:23:22 +02:00
1 parent 437ec50345
commit b3145a70d9
6 files changed
+26 -14

No files matched your search

@@ -32,7 +32,9 @@ internal static class _WootingSDK
if (_dllHandle != IntPtr.Zero) return;
// HACK: Load library at runtime to support both, x86 and x64 with one managed dll
List<string> possiblePathList = Environment.Is64BitProcess ? WootingDeviceProvider.PossibleX64NativePaths : WootingDeviceProvider.PossibleX86NativePaths;
List<string> possiblePathList = (Environment.Is64BitProcess ? WootingDeviceProvider.PossibleX64NativePaths : WootingDeviceProvider.PossibleX86NativePaths)
.Select(Environment.ExpandEnvironmentVariables)
.ToList();
string? dllPath = possiblePathList.FirstOrDefault(File.Exists);
if (dllPath == null) throw new RGBDeviceException($"Can't find the Wooting-SDK at one of the expected locations:\r\n '{string.Join("\r\n", possiblePathList.Select(Path.GetFullPath))}'");