Skip to content
This repository has been archived by the owner on Aug 9, 2023. It is now read-only.

Commit

Permalink
goodbye vrpathreg....
Browse files Browse the repository at this point in the history
you wont be missed.
  • Loading branch information
Ella authored and Ella committed May 24, 2021
1 parent 8ce6e92 commit 88ade20
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion k2vr-installer-gui/Pages/Install.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,20 @@ await Task.Run(() =>
Logger.Log("Registering OpenVR driver...", false);
string driverPath = Path.Combine(App.state.GetFullInstallationPath(), "KinectToVR");
Process.Start(App.state.vrPathReg, "adddriver \"" + driverPath + "\"").WaitForExit();
// Process.Start(App.state.vrPathReg, "adddriver \"" + driverPath + "\"").WaitForExit();
var openVrPathsJSON = JsonConvert.DeserializeObject<dynamic>(File.ReadAllText(Environment.ExpandEnvironmentVariables(Path.Combine("%LocalAppData%", "openvr", "openvrpaths.vrpath"))));
try
{
JArray DriverList = openVrPathsJSON["external_drivers"];
DriverList.Add(driverPath);
openVrPathsJSON["external_drivers"] = DriverList;
JsonFile.Write((Environment.ExpandEnvironmentVariables(Path.Combine("%LocalAppData%", "openvr", "openvrpaths.vrpath"))), openVrPathsJSON, 3, ' ');
Logger.Log("Done!");
}
catch (Exception)
{
Logger.Log("Couldn't add to VRPaths...");
}
Logger.Log("Checking...", false);
var openVrPaths = OpenVrPaths.Read();
if (!openVrPaths.external_drivers.Contains(driverPath))
Expand Down

0 comments on commit 88ade20

Please sign in to comment.