mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2025-12-13 10:08:31 +00:00
Merge pull request #167 from DarthAffe/SDK/Razer
Change default binary search paths for razer
This commit is contained in:
commit
81ad871f94
@ -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);
|
||||
|
||||
@ -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>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user