diff --git a/server/desktop/src/main/java/dev/slimevr/desktop/Main.kt b/server/desktop/src/main/java/dev/slimevr/desktop/Main.kt index 121217f3b..3156f1785 100644 --- a/server/desktop/src/main/java/dev/slimevr/desktop/Main.kt +++ b/server/desktop/src/main/java/dev/slimevr/desktop/Main.kt @@ -244,7 +244,6 @@ fun provideBridges( ) yield(linuxBridge) } - LogManager.info("Socket Dir ${OperatingSystem.socketDirectory}") yield( UnixSocketBridge( server, diff --git a/server/desktop/src/main/java/dev/slimevr/desktop/games/vrchat/RegEdit.kt b/server/desktop/src/main/java/dev/slimevr/desktop/games/vrchat/RegEdit.kt index 8f9e60799..8385f26b9 100644 --- a/server/desktop/src/main/java/dev/slimevr/desktop/games/vrchat/RegEdit.kt +++ b/server/desktop/src/main/java/dev/slimevr/desktop/games/vrchat/RegEdit.kt @@ -84,7 +84,7 @@ class RegEditWindows : AbstractRegEdit() { keysMap[it.key.replace("""_h\d+$""".toRegex(), "")] = it.value.toString() } } catch (e: Exception) { - LogManager.severe("[RegEdit] Error reading Values from registry: ${e.message}") + LogManager.severe("[RegEdit] Error reading values from registry", e) } return keysMap } diff --git a/server/desktop/src/main/java/dev/slimevr/desktop/install/drivers/InstallerUtils.kt b/server/desktop/src/main/java/dev/slimevr/desktop/install/drivers/InstallerUtils.kt index 9ad47037f..3aae4d621 100644 --- a/server/desktop/src/main/java/dev/slimevr/desktop/install/drivers/InstallerUtils.kt +++ b/server/desktop/src/main/java/dev/slimevr/desktop/install/drivers/InstallerUtils.kt @@ -11,6 +11,6 @@ fun executeShellCommand(vararg command: String): String? = try { process.waitFor() } } catch (e: IOException) { - LogManager.warning("Error executing shell command: ${e.message}") + LogManager.warning("Error executing shell command", e) null } diff --git a/server/desktop/src/main/java/dev/slimevr/desktop/install/drivers/Windows.kt b/server/desktop/src/main/java/dev/slimevr/desktop/install/drivers/Windows.kt index b92d1e02c..65ccaeca8 100644 --- a/server/desktop/src/main/java/dev/slimevr/desktop/install/drivers/Windows.kt +++ b/server/desktop/src/main/java/dev/slimevr/desktop/install/drivers/Windows.kt @@ -30,41 +30,28 @@ class Windows { val regEdit = RegEditWindows() val regQuery = regEdit.getKeyByPath(WinReg.HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Steam App 250820") val steamVRLocation = regQuery["InstallLocation"] - if (steamVRLocation == null) { - LogManager.warning("Error installing SteamVR driver.") + if (steamVRLocation == null || !steamVRLocation.contains("SteamVR")) { + LogManager.warning("Can't find SteamVR, unable to install SteamVR driver") return } - if (!steamVRLocation.contains("SteamVR")) { - LogManager.warning("SteamVR not installed, cannot install SlimeVR Steam driver.") - return - } - var vrPathRegContents = executeShellCommand("${steamVRLocation}\\bin\\win64\\vrpathreg.exe", "finddriver", "slimevr") + + val pathRegPath = "${steamVRLocation}\\bin\\win64\\vrpathreg.exe" + val vrPathRegContents = executeShellCommand(pathRegPath, "finddriver", "slimevr") if (vrPathRegContents == null) { - LogManager.warning("Error installing SteamVR driver.") + LogManager.warning("Error installing SteamVR driver") return } - var isDriverRegistered = vrPathRegContents.contains("slimevr") - if (isDriverRegistered) { - LogManager.info("steamVR driver is already registered. Skipping...") + if (vrPathRegContents.contains("slimevr")) { return } - LogManager.info("Installing SteamVR Driver") - executeShellCommand( - "${steamVRLocation}\\bin\\win64\\vrpathreg.exe", - "adddriver", - "${path}\\${WINDOWS_STEAMVR_DRIVER_DIRECTORY}", - ) - vrPathRegContents = executeShellCommand("${steamVRLocation}\\bin\\win64\\vrpathreg.exe", "finddriver", "slimevr") - if (vrPathRegContents == null) { - LogManager.warning("Error installing SteamVR driver.") + + executeShellCommand(pathRegPath, "adddriver", "${path}\\${WINDOWS_STEAMVR_DRIVER_DIRECTORY}") + + if (executeShellCommand(pathRegPath, "finddriver", "slimevr")?.contains("slimevr") != true) { + LogManager.warning("Failed to install SlimeVR driver") return } - isDriverRegistered = vrPathRegContents.contains("slimevr") - if (!isDriverRegistered) { - LogManager.warning("Server couldn't install SlimeVR driver.") - return - } - LogManager.info("SteamVR driver successfully installed.") + LogManager.info("SteamVR driver successfully installed") } companion object {