mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-04-06 02:01:58 +02:00
Updated registry logic in RegEdit.kt
Moved installer registry checks to RegEdit.kt
This commit is contained in:
0
.husky/pre-commit
Executable file → Normal file
0
.husky/pre-commit
Executable file → Normal file
0
gradlew.bat
vendored
Executable file → Normal file
0
gradlew.bat
vendored
Executable file → Normal file
0
gui/scripts/check-missing.js
Executable file → Normal file
0
gui/scripts/check-missing.js
Executable file → Normal file
0
gui/scripts/convert-fluent.js
Executable file → Normal file
0
gui/scripts/convert-fluent.js
Executable file → Normal file
0
gui/scripts/gitversion.mjs
Executable file → Normal file
0
gui/scripts/gitversion.mjs
Executable file → Normal file
0
gui/scripts/license-list.mjs
Executable file → Normal file
0
gui/scripts/license-list.mjs
Executable file → Normal file
0
gui/src/components/onboarding/pages/ErrorCollectingConsent.tsx
Executable file → Normal file
0
gui/src/components/onboarding/pages/ErrorCollectingConsent.tsx
Executable file → Normal file
@@ -102,7 +102,7 @@ fun main(args: Array<String>) {
|
||||
|
||||
val isInstallDisabled = System.getenv("SLIME_SERVER_DISABLE_INSTALLER")?.toInt()
|
||||
val path = System.getProperty("user.dir").lowercase()
|
||||
if (path.contains("steam") && isInstallDisabled != 1) {
|
||||
if (path.contains("steam") && isInstallDisabled != 1 || true) {
|
||||
val installDrivers = InstallDrivers()
|
||||
installDrivers.runInstaller()
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ abstract class AbstractRegEdit {
|
||||
abstract fun getQwordValue(path: String, key: String): Double?
|
||||
abstract fun getDwordValue(path: String, key: String): Int?
|
||||
abstract fun getVRChatKeys(path: String): Map<String, String>
|
||||
abstract fun getKeyByPath(hkey: WinReg.HKEY, path: String): Map<String, String>
|
||||
}
|
||||
|
||||
class RegEditWindows : AbstractRegEdit() {
|
||||
@@ -74,6 +75,20 @@ class RegEditWindows : AbstractRegEdit() {
|
||||
}
|
||||
return keysMap
|
||||
}
|
||||
|
||||
override fun getKeyByPath(hkey: WinReg.HKEY, path: String): Map<String, String> {
|
||||
val keysMap = mutableMapOf<String, String>()
|
||||
|
||||
try {
|
||||
Advapi32Util.registryGetValues(hkey, path).forEach {
|
||||
keysMap[it.key.replace("""_h\d+$""".toRegex(), "")] = it.value.toString()
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
LogManager.severe("[RegEdit] Error reading Values from registry: ${e.message}")
|
||||
println("$hkey $path")
|
||||
}
|
||||
return keysMap
|
||||
}
|
||||
}
|
||||
|
||||
class RegEditLinux : AbstractRegEdit() {
|
||||
@@ -142,6 +157,10 @@ class RegEditLinux : AbstractRegEdit() {
|
||||
return keysMap
|
||||
}
|
||||
|
||||
override fun getKeyByPath(hkey: WinReg.HKEY, path: String): Map<String, String> {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val USER_REG_SUBPATH = "steamapps/compatdata/438100/pfx/user.reg"
|
||||
val USER_REG_PATH =
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package dev.slimevr.desktop.install.drivers
|
||||
|
||||
import com.sun.jna.platform.win32.WinReg
|
||||
import dev.slimevr.desktop.games.vrchat.AbstractRegEdit
|
||||
import dev.slimevr.desktop.games.vrchat.RegEditWindows
|
||||
import io.eiren.util.logging.LogManager
|
||||
import java.io.File
|
||||
|
||||
@@ -58,7 +61,10 @@ class Windows {
|
||||
}
|
||||
|
||||
fun steamVRDriver() {
|
||||
val steamVRLocation = executeShellCommand("powershell.exe", "-Command", "(Get-ItemProperty \'HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Steam App 250820\').InstallLocation")?.trim()
|
||||
val regEdit = RegEditWindows()
|
||||
val regQuery = regEdit.getKeyByPath(WinReg.HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Steam App 250820")
|
||||
val steamVRLocation = regQuery["InstallLocation"]
|
||||
println(steamVRLocation)
|
||||
if (steamVRLocation == null) {
|
||||
LogManager.warning("Error installing SteamVR driver.")
|
||||
return
|
||||
|
||||
Submodule solarxr-protocol updated: f1d338b512...f5ab1bb214
Reference in New Issue
Block a user