Skip to content

Commit

Permalink
Fix generating Native Steam Linux Runtime command when it is not inst…
Browse files Browse the repository at this point in the history
…alled

Native games will crash if 'Steam Linux Runtime 1.0 (Scout)' is not installed,
this is because SteamTinkerLaunch incorrectly tries to fall back to generating
a wrong command and does not properly return the empty SLRCMD variable. This
leads to generating the launch command incorrectly, as STL thinks the SLR
is installed and is valid.

To fix this, we do an extra check to ensure the Proton SLR command is only
generated when we're using the Proton SLR, and which avoids us falling
back on the Proton SLR codepath when NATIVE_SLRCMD is not set. It is
incorrect to assume that because the NATIVE_SLRCMD is not set that we're
using Proton, we should only fall back to using PROTON_SLRCMD if we actually
set the PROTON_SLRCMD earlier.
  • Loading branch information
sonic2kk committed Dec 27, 2023
1 parent 9366dd4 commit 5bcbe32
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions steamtinkerlaunch
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
PREFIX="/usr"
PROGNAME="SteamTinkerLaunch"
NICEPROGNAME="Steam Tinker Launch"
PROGVERS="v14.0.20231212-1"
PROGVERS="v14.0.20231227-1 (fix-native-slr-missing)"
PROGCMD="${0##*/}"
PROGINTERNALPROTNAME="Proton-stl"
SHOSTL="stl"
Expand Down Expand Up @@ -20779,6 +20779,7 @@ function getRequireToolAppidPath {

# Function to get SLR to append to game/program launch
# Primarily used to set SLRCMD so it can be appended, but also sets the reaper command
# TODO: refactor to use early returns and less indentation where possible
function setSLRReap {
# This function has gotten a bit messy with all the override options, but these are used to allow setSLRReap to be re-used outside of regular game launches such as for Vortex.

Expand Down Expand Up @@ -20881,9 +20882,15 @@ function setSLRReap {
if [ -n "${NATIVE_SLRCMD[*]}" ]; then
writelog "INFO" "${FUNCNAME[0]} - Building Steam Linux Runtime command for native game"
SLRCMD=("${PROTON_SLRCMD[@]}" "${NATIVE_SLRCMD[@]}") # Not really "Proton" for native games, but naming is hard
else
elif [ -n "${PROTON_SLRCMD[*]}" ]; then
writelog "INFO" "${FUNCNAME[0]} - Building Steam Linux Runtime command for Proton game"
SLRCMD=("${PROTON_SLRCMD[@]}")
else
if [ "${REQUIRED_APPID}" = "${SLRAID}" ]; then # Assume native when REQUIRED_APPID is set to the native Linux SLRAID
writelog "WARN" "${FUNCNAME[0]} - No native linux Steam Linux Runtime found, game will not use Steam Linux Runtime"
else # If not native, can only be Proton
writelog "WARN" "${FUNCNAME[0]} - No Proton Steam Linux Runtime found, game will not use Steam Linux Runtime"
fi
fi
fi
fi
Expand Down

0 comments on commit 5bcbe32

Please sign in to comment.