Updated registry logic in RegEdit.kt

Moved installer registry checks to RegEdit.kt
This commit is contained in:
HannahPadd
2026-03-09 14:26:37 +01:00
parent e087d76781
commit a554b46263
12 changed files with 28 additions and 3 deletions

0
.husky/pre-commit Executable file → Normal file
View File

0
gradlew vendored Executable file → Normal file
View File

0
gradlew.bat vendored Executable file → Normal file
View File

0
gui/scripts/check-missing.js Executable file → Normal file
View File

0
gui/scripts/convert-fluent.js Executable file → Normal file
View File

0
gui/scripts/gitversion.mjs Executable file → Normal file
View File

0
gui/scripts/license-list.mjs Executable file → Normal file
View File

View File

View 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()
}

View File

@@ -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 =

View File

@@ -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