From b4c2ab51eae75408317976a2ba47168e54cb8b62 Mon Sep 17 00:00:00 2001 From: the-sane <3657071+the-sane@users.noreply.github.com> Date: Thu, 24 Oct 2024 13:08:22 -0400 Subject: [PATCH] Detect launcher updates and wait for them to complete --- lib/sc-launch.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/sc-launch.sh b/lib/sc-launch.sh index d7f458d..942eb45 100755 --- a/lib/sc-launch.sh +++ b/lib/sc-launch.sh @@ -45,14 +45,22 @@ wine_exec="wine" # Run optional prelaunch and postexit scripts ############################################# # To use, update the game install paths here, then create the scripts with your desired actions in them -# Replace the trap line below with the one provided here +# Replace the trap line in the section below with the example provided here # # "$HOME/Games/star-citizen/sc-prelaunch.sh" -# trap "wineserver -k; $HOME/Games/star-citizen/sc-postexit.sh" EXIT +# trap "update_check; wineserver -k; $HOME/Games/star-citizen/sc-postexit.sh" EXIT +############################################# +# It's a trap! +############################################# # Kill the wine prefix when this script exits # This makes sure there will be no lingering background wine processes -trap "wineserver -k" EXIT +update_check() { + while winedbg --command "info proc" | grep -qi setup; do + sleep 2 + done +} +trap "update_check; wineserver -k" EXIT ################# # Launch the game