mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-04-06 02:01:58 +02:00
Added installation of udev rules to updater
This commit is contained in:
46
updater/desktop/69-slimevr-devices.rules
Normal file
46
updater/desktop/69-slimevr-devices.rules
Normal file
@@ -0,0 +1,46 @@
|
||||
# Copyright 2025 Eiren Rain and SlimeVR Contributors
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
## QinHeng
|
||||
# CH340
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1A86", ATTRS{idProduct}=="7522", MODE="0660", TAG+="uaccess"
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1A86", ATTRS{idProduct}=="7523", MODE="0660", TAG+="uaccess"
|
||||
# CH341
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1A86", ATTRS{idProduct}=="5523", MODE="0660", TAG+="uaccess"
|
||||
# CH343
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1A86", ATTRS{idProduct}=="55D3", MODE="0660", TAG+="uaccess"
|
||||
# CH9102x
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1A86", ATTRS{idProduct}=="55D4", MODE="0660", TAG+="uaccess"
|
||||
|
||||
## Silabs
|
||||
# CP210x
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="10C4", ATTRS{idProduct}=="EA60", MODE="0660", TAG+="uaccess"
|
||||
|
||||
## Espressif
|
||||
# ESP32-S3 / ESP32-C3 / ESP32-C5 / ESP32-C6 / ESP32-C61 / ESP32-H2 / ESP32-P4
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="303A", ATTRS{idProduct}=="1001", MODE="0660", TAG+="uaccess"
|
||||
# ESP32-S2
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="303A", ATTRS{idProduct}=="0002", MODE="0660", TAG+="uaccess"
|
||||
|
||||
## FTDI
|
||||
# FT232BM/L/Q, FT245BM/L/Q
|
||||
# FT232RL/Q, FT245RL/Q
|
||||
# VNC1L with VDPS Firmware
|
||||
# VNC2 with FT232Slave
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", MODE="0660", TAG+="uaccess"
|
||||
|
||||
## SlimeVR
|
||||
# smol slime dongle
|
||||
SUBSYSTEM=="usb", ATTR{idVendor}=="1209", ATTR{idProduct}=="7690", MODE="0660", TAG+="uaccess"
|
||||
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="1209", ATTRS{idProduct}=="7690", MODE="0660", TAG+="uaccess"
|
||||
@@ -4,9 +4,13 @@ import java.nio.file.Paths
|
||||
|
||||
class Linux {
|
||||
|
||||
val path = Paths.get("").toAbsolutePath().toString()
|
||||
|
||||
fun updateLinux() {
|
||||
updateLinuxSteamVRDriver()
|
||||
updateServer()
|
||||
//feeder()
|
||||
updateUdev()
|
||||
//updateServer()
|
||||
}
|
||||
|
||||
//TODO: tell user in gui to add steamvr launch arguments
|
||||
@@ -22,10 +26,7 @@ class Linux {
|
||||
println("${Paths.get("").toAbsolutePath()}/$LINUXSTEAMVRDRIVERDIRECTORY/slimevr")
|
||||
executeShellCommand("${System.getProperty("user.home")}/.steam/steam/steamapps/common/SteamVR/bin/vrpathreg.sh",
|
||||
"adddriver",
|
||||
"${Paths.get(
|
||||
"",
|
||||
).toAbsolutePath()
|
||||
}/$LINUXSTEAMVRDRIVERDIRECTORY/slimevr"
|
||||
"${path}/$LINUXSTEAMVRDRIVERDIRECTORY/slimevr"
|
||||
)
|
||||
} else {
|
||||
println("steamVR driver is already registered. Skipping...")
|
||||
@@ -39,16 +40,21 @@ class Linux {
|
||||
println("Removing driver from steamvr")
|
||||
executeShellCommand("${System.getProperty("user.home")}/.steam/steam/steamapps/common/SteamVR/bin/vrpathreg.sh",
|
||||
"removedriver",
|
||||
"${Paths.get(
|
||||
"",
|
||||
).toAbsolutePath()
|
||||
}/$LINUXSTEAMVRDRIVERDIRECTORY/slimevr"
|
||||
"${path}/$LINUXSTEAMVRDRIVERDIRECTORY/slimevr"
|
||||
)
|
||||
} else {
|
||||
println("steamVR driver isn't registered. Skipping...")
|
||||
}
|
||||
}
|
||||
|
||||
fun feeder() {
|
||||
println("Downloading feeder")
|
||||
downloadFile(LINUXFEEDERURL, LINUXFEEDERNAME)
|
||||
println("Unzipping feeder")
|
||||
unzip(LINUXFEEDERNAME, LINUXFEEDERDIRECTORY)
|
||||
executeShellCommand("${path}/${LINUXFEEDERDIRECTORY}/SlimeVR-Feeder-App", "--install")
|
||||
}
|
||||
|
||||
fun updateServer() {
|
||||
println("Downloading Server")
|
||||
downloadFile(LINUXSERVERURL, LINUXSERVERNAME)
|
||||
@@ -56,7 +62,13 @@ class Linux {
|
||||
|
||||
//TODO: Probably best to just ask the user in the ui to update udev if i can't access usb devices. Also does the steam frame have udev?
|
||||
fun updateUdev() {
|
||||
|
||||
val res = executeShellCommand("pkexec", "cp", "${path}/69-slimevr-devices.rules", "/etc/udev/rules.d/69-slimevr-devices.rules")
|
||||
if (res.contains("Error")) {
|
||||
println("Error installing udev rules")
|
||||
}
|
||||
else {
|
||||
println("Successfully installed udev rules")
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
@@ -64,11 +76,11 @@ class Linux {
|
||||
private const val LINUXSTEAMVRDRIVERURL = "https://github.com/SlimeVR/SlimeVR-OpenVR-Driver/releases/latest/download/slimevr-openvr-driver-x64-linux.zip"
|
||||
private const val LINUXSTEAMVRDRIVERNAME = "slimevr-openvr-driver-x64-linux.zip"
|
||||
private const val LINUXSTEAMVRDRIVERDIRECTORY = "slimevr-openvr-driver-x64-linux"
|
||||
private const val LINUXFEEDERURL = "https://github.com/SlimeVR/SlimeVR-Feeder-App/releases/latest/download/SlimeVR-Feeder-App-linux64.zip"
|
||||
private const val LINUXFEEDERNAME = "SlimeVR-Feeder-App-linux64.zip"
|
||||
private const val LINUXFEEDERDIRECTORY = "SlimeVR-Feeder-App-linux64"
|
||||
private const val LINUXFEEDERURL = "https://github.com/SlimeVR/SlimeVR-Feeder-App/releases/latest/download/SlimeVR-Feeder-App-linux.zip"
|
||||
private const val LINUXFEEDERNAME = "SlimeVR-Feeder-App-Linux.zip"
|
||||
private const val LINUXFEEDERDIRECTORY = "SlimeVR-Feeder-App-Linux"
|
||||
private const val LINUXSERVERURL = "https://github.com/SlimeVR/SlimeVR-Server/releases/latest/download/SlimeVR-amd64.appimage"
|
||||
private const val LINUXSERVERNAME = "SlimeVR-amd64.appimage"
|
||||
private const val LINUXSERVERDIRECTORY = "slimevr-win64"
|
||||
private const val LINUXSERVERDIRECTORY = "slimevr-linux"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ class Updater {
|
||||
//if (!shouldUpdate) {
|
||||
// return
|
||||
//}
|
||||
|
||||
println(os)
|
||||
if (os.contains("linux")) {
|
||||
println("Running linux updater")
|
||||
val linuxUpdater = Linux()
|
||||
|
||||
@@ -4,11 +4,15 @@ import java.nio.file.Paths
|
||||
|
||||
class Windows {
|
||||
|
||||
val path = Paths.get("").toAbsolutePath().toString()
|
||||
|
||||
fun updateWindows() {
|
||||
// First check if everything is already installed. Install it if it isn't
|
||||
usbDrivers()
|
||||
slimeServer()
|
||||
steamVRDriver()
|
||||
//feeder()
|
||||
//Turn off updater stuff not needed for the steam release
|
||||
//slimeServer()
|
||||
}
|
||||
|
||||
fun usbDrivers() {
|
||||
@@ -17,7 +21,6 @@ class Windows {
|
||||
val ch341ser = installedDriversList.contains("ch341ser.inf")
|
||||
val ch343ser = installedDriversList.contains("ch343ser.inf")
|
||||
val silabser = installedDriversList.contains("silabser.inf")
|
||||
val path = Paths.get("").toAbsolutePath().toString()
|
||||
|
||||
if (ch341ser && ch343ser && silabser) {
|
||||
println("drivers already installed!")
|
||||
@@ -33,7 +36,15 @@ class Windows {
|
||||
// downloading slime server
|
||||
downloadFile(WINDOWSSERVERURL, WINDOWSSERVERNAME)
|
||||
println("extracting")
|
||||
unzip(WINDOWSSERVERNAME, WINDOWSSERERDIRECTORY)
|
||||
unzip(WINDOWSSERVERNAME, WINDOWSSERVERDIRECTORY)
|
||||
}
|
||||
|
||||
fun feeder() {
|
||||
println("Downloading feeder")
|
||||
downloadFile(WINDOWSFEEDERURL, WINDOWSFEEDERNAME)
|
||||
println("Unzipping feeder")
|
||||
unzip(WINDOWSFEEDERNAME, WINDOWSFEEDERDIRECTORY)
|
||||
executeShellCommand("${path}\\${WINDOWSFEEDERDIRECTORY}\\SlimeVR-Feeder-App.exe", "--install")
|
||||
}
|
||||
|
||||
fun steamVRDriver() {
|
||||
@@ -68,6 +79,7 @@ class Windows {
|
||||
}
|
||||
|
||||
fun updateWindowsGui() {
|
||||
|
||||
}
|
||||
|
||||
companion object {
|
||||
@@ -76,8 +88,9 @@ class Windows {
|
||||
private const val WINDOWSSTEAMVRDRIVERDIRECTORY = "slimevr-openvr-driver-win64"
|
||||
private const val WINDOWSFEEDERURL = "https://github.com/SlimeVR/SlimeVR-Feeder-App/releases/latest/download/SlimeVR-Feeder-App-win64.zip"
|
||||
private const val WINDOWSFEEDERNAME = "SlimeVR-Feeder-App-win64.zip"
|
||||
private const val WINDOWSFEEDERDIRECTORY = "SlimeVR-Feeder-App-win64"
|
||||
private const val WINDOWSSERVERURL = "https://github.com/SlimeVR/SlimeVR-Server/releases/latest/download/SlimeVR-win64.zip"
|
||||
private const val WINDOWSSERVERNAME = "slimevr-win64.zip"
|
||||
private const val WINDOWSSERERDIRECTORY = "slimevr-win64"
|
||||
private const val WINDOWSSERVERDIRECTORY = "slimevr-win64"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user