mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2025-12-13 10:08:31 +00:00
Change default binary search paths for razer
This commit is contained in:
parent
d69c3a96dd
commit
2e79d672b5
@ -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
|
// HACK: Load library at runtime to support both, x86 and x64 with one managed dll
|
||||||
List<string> possiblePathList = Environment.Is64BitProcess ? RazerDeviceProvider.PossibleX64NativePaths : RazerDeviceProvider.PossibleX86NativePaths;
|
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))}'");
|
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);
|
_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.
|
/// Gets a modifiable list of paths used to find the native SDK-dlls for x86 applications.
|
||||||
/// The first match will be used.
|
/// The first match will be used.
|
||||||
/// </summary>
|
/// </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>
|
/// <summary>
|
||||||
/// Gets a modifiable list of paths used to find the native SDK-dlls for x64 applications.
|
/// Gets a modifiable list of paths used to find the native SDK-dlls for x64 applications.
|
||||||
/// The first match will be used.
|
/// The first match will be used.
|
||||||
/// </summary>
|
/// </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 />
|
/// <inheritdoc />
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user