forked from irlbunny/OculusKiller
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
133 additions
and
32 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
using Microsoft.Win32; | ||
using OculusKiller.Utilities; | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace OculusKiller.RuntimeManagement | ||
{ | ||
public static class OpenXRRuntimeChecker | ||
{ | ||
private const string OpenXRKeyPath = @"SOFTWARE\Khronos\OpenXR\1"; | ||
|
||
public static void CheckAndLogRuntimes() | ||
{ | ||
try | ||
{ | ||
// Log available runtimes | ||
var availableRuntimes = GetAvailableRuntimes(); | ||
ErrorLogger.Log("Available OpenXR Runtimes:"); | ||
foreach (var runtime in availableRuntimes) | ||
{ | ||
ErrorLogger.Log(runtime); | ||
} | ||
|
||
// Log active runtime | ||
var activeRuntime = GetActiveRuntime(); | ||
ErrorLogger.Log($"Active OpenXR Runtime: {activeRuntime}"); | ||
} | ||
catch (Exception e) | ||
{ | ||
ErrorLogger.LogError(e); | ||
} | ||
} | ||
|
||
private static List<string> GetAvailableRuntimes() | ||
{ | ||
var runtimes = new List<string>(); | ||
using (var key = Registry.LocalMachine.OpenSubKey($@"{OpenXRKeyPath}\AvailableRuntimes")) | ||
{ | ||
if (key != null) | ||
{ | ||
foreach (var valueName in key.GetValueNames()) | ||
{ | ||
var runtimePath = key.GetValue(valueName) as string; | ||
if (!string.IsNullOrEmpty(runtimePath)) | ||
{ | ||
runtimes.Add(runtimePath); | ||
} | ||
} | ||
} | ||
} | ||
return runtimes; | ||
} | ||
|
||
private static string GetActiveRuntime() | ||
{ | ||
using (var key = Registry.LocalMachine.OpenSubKey(OpenXRKeyPath)) | ||
{ | ||
if (key != null) | ||
{ | ||
return key.GetValue("ActiveRuntime") as string; | ||
} | ||
} | ||
return "No active runtime found."; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters