Skip to content

Commit

Permalink
Fix Steam Runtime crash due to renamed executable
Browse files Browse the repository at this point in the history
`pressure-vessel-launch` was renamed to `steam-runtime-launch-client`
in steam-runtime-tools v0.20220420.0. The renamed executable in turn is
currently used in the beta version of Steam Linux Runtime, which causes
a crash if the new name is not checked for.

Fixes #146
  • Loading branch information
Matoking committed May 1, 2022
1 parent eb897c6 commit 2e09057
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).


## [Unreleased]
### Fixed
- Fix bwrap crashing on newer Steam Runtime installations due to renamed executable

## [1.8.1] - 2022-03-20
### Added
- Prompt the user to update Flatpak permissions if inaccessible paths are detected
Expand Down
23 changes: 22 additions & 1 deletion src/protontricks/data/scripts/wine_launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,27 @@ if [[ -n "$PROTONTRICKS_BACKGROUND_WINESERVER"
fi

if [[ -z "$PROTONTRICKS_FIRST_START" ]]; then
if [[ "$PROTONTRICKS_STEAM_RUNTIME" = "bwrap" ]]; then
# Check if the launch script is named 'pressure-vessel-launch' or
# 'steam-runtime-launch-client'. The latter name is newer and used
# since steam-runtime-tools v0.20220420.0
launch_script=""
script_names=('pressure-vessel-launch' 'steam-runtime-launch-client')
for name in "${script_names[@]}"; do
if [[ -f "$STEAM_RUNTIME_PATH/pressure-vessel/bin/$name" ]]; then
launch_script="$STEAM_RUNTIME_PATH/pressure-vessel/bin/$name"
log_info "Found Steam Runtime launch client at $launch_script"
fi
done

if [[ "$launch_script" = "" ]]; then
echo "Launch script could not be found, aborting..."
exit 1
fi

export STEAM_RUNTIME_LAUNCH_SCRIPT="$launch_script"
fi

# Try to detect if wineserver is already running, and if so, copy a few
# environment variables from it to ensure our own Wine processes
# are able to run at the same time without any issues.
Expand Down Expand Up @@ -152,7 +173,7 @@ elif [[ "$PROTONTRICKS_STEAM_RUNTIME" = "bwrap" ]]; then
done
fi

exec "$STEAM_RUNTIME_PATH"/pressure-vessel/bin/pressure-vessel-launch \
exec "$STEAM_RUNTIME_LAUNCH_SCRIPT" \
--share-pids --socket="$PROTONTRICKS_TEMP_PATH/launcher.sock" \
--env=PROTONTRICKS_INSIDE_STEAM_RUNTIME=1 \
--pass-env-matching="*" -- "$PROTONTRICKS_PROXY_SCRIPT_PATH" "$@"
Expand Down

0 comments on commit 2e09057

Please sign in to comment.