1
0
mirror of https://github.com/DarthAffe/RGB.NET.git synced 2025-12-12 17:48:31 +00:00

Change default binary search paths for razer

This commit is contained in:
Darth Affe 2020-12-25 23:20:09 +01:00
parent d69c3a96dd
commit 2e79d672b5
2 changed files with 3 additions and 3 deletions

View File

@ -37,7 +37,7 @@ namespace RGB.NET.Devices.Razer.Native
// HACK: Load library at runtime to support both, x86 and x64 with one managed dll
List<string> possiblePathList = Environment.Is64BitProcess ? RazerDeviceProvider.PossibleX64NativePaths : RazerDeviceProvider.PossibleX86NativePaths;
string dllPath = possiblePathList.FirstOrDefault(File.Exists);
string? dllPath = possiblePathList.Select(Environment.ExpandEnvironmentVariables).FirstOrDefault(File.Exists);
if (dllPath == null) throw new RGBDeviceException($"Can't find the Razer-SDK at one of the expected locations:\r\n '{string.Join("\r\n", possiblePathList.Select(Path.GetFullPath))}'");
_dllHandle = LoadLibrary(dllPath);

View File

@ -30,13 +30,13 @@ namespace RGB.NET.Devices.Razer
/// Gets a modifiable list of paths used to find the native SDK-dlls for x86 applications.
/// The first match will be used.
/// </summary>
public static List<string> PossibleX86NativePaths { get; } = new List<string> { "x86/RzChromaSDK.dll" };
public static List<string> PossibleX86NativePaths { get; } = new List<string> { @"%systemroot%\SysWOW64\RzChromaSDK.dll" };
/// <summary>
/// Gets a modifiable list of paths used to find the native SDK-dlls for x64 applications.
/// The first match will be used.
/// </summary>
public static List<string> PossibleX64NativePaths { get; } = new List<string> { "x64/RzChromaSDK.dll", "x64/RzChromaSDK64.dll" };
public static List<string> PossibleX64NativePaths { get; } = new List<string> { @"%systemroot%\System32\RzChromaSDK.dll", @"%systemroot%\System32\RzChromaSDK64.dll" };
/// <inheritdoc />
/// <summary>