From 57573ac2400e9477e6ac6c966db1529355f091ff Mon Sep 17 00:00:00 2001 From: the-sane <3657071+the-sane@users.noreply.github.com> Date: Mon, 25 Aug 2025 18:43:12 -0400 Subject: [PATCH] Kill wineserver before launch unless RSI Setup is running --- lib/sc-launch.sh | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/lib/sc-launch.sh b/lib/sc-launch.sh index d507ad4..26d6f4f 100755 --- a/lib/sc-launch.sh +++ b/lib/sc-launch.sh @@ -17,13 +17,13 @@ # If you do not wish to use the above .desktop files, simply run this script # from your terminal. # -# version: 1.8 +# version: 1.9 ################################################################################ -################################################################ +################################################################################ # Configure the environment # Add additional environment variables here as needed -################################################################ +################################################################################ export WINEPREFIX="$HOME/Games/star-citizen" launch_log="$WINEPREFIX/sc-launch.log" @@ -44,17 +44,17 @@ export WINEFSYNC=1 #export DXVK_HUD=fps,compiler #export MANGOHUD=1 -################################################################ +################################################################################ # Configure the wine binaries to be used # # To use a custom wine runner, set the path to its bin directory # export wine_path="/path/to/custom/runner/bin" -################################################################ +################################################################################ export wine_path="$(command -v wine | xargs dirname)" -############################################# +################################################################################ # Command line arguments -############################################# +################################################################################ # shell - Drop into a Wine maintenance shell # config - Wine configuration # controllers - Game controller configuration @@ -73,21 +73,20 @@ case "$1" in ;; esac -############################################# -# It's a trap! -############################################# -# Kill the wine prefix when this script exits -# This makes sure there will be no lingering background wine processes +################################################################################ +# Update check and cleanup +# Kill existing wine processes before launch +################################################################################ update_check() { while "$wine_path"/winedbg --command "info proc" | grep -qi "rsi.*setup"; do - sleep 2 + echo "RSI Setup process detected. Exiting."; exit 0 done } -trap "update_check; \"$wine_path\"/wineserver -k" EXIT +"$wine_path"/wineserver -k -############################################# +################################################################################ # Launch the game -############################################# +################################################################################ # To enable feral gamemode, replace the launch line below with: # gamemoderun "$wine_path"/wine "C:\Program Files\Roberts Space Industries\RSI Launcher\RSI Launcher.exe" > "$launch_log" 2>&1 #