From 627ed64b938a4a4808d4a44acd478ead6d426280 Mon Sep 17 00:00:00 2001 From: GloriousEggroll Date: Wed, 24 Jan 2024 12:05:12 -0700 Subject: [PATCH] try to autoset game install path if one isnt set --- gamelauncher.sh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/gamelauncher.sh b/gamelauncher.sh index b6d05ae..679affd 100755 --- a/gamelauncher.sh +++ b/gamelauncher.sh @@ -19,14 +19,18 @@ export PROTONPATH="$PROTONPATH" export ULWGL_ID="$GAMEID" export STEAM_COMPAT_APP_ID="$GAMEID" numcheck='^[0-9]+$' -if [[ $(cat $ULWGL_ID | cut -d "-" -f 2) =~$numcheck ]]; then +if [[ $(cat $ULWGL_ID | cut -d "-" -f 2) =~ $numcheck ]]; then export STEAM_COMPAT_APP_ID=$(cat $ULWGL_ID | cut -d "-" -f 2) fi export SteamAppId="$STEAM_COMPAT_APP_ID" -export STEAM_COMPAT_TOOL_PATHS='' export STEAM_COMPAT_LIBRARY_PATHS='' -export STEAM_COMPAT_MOUNTS='' -export STEAM_COMPAT_INSTALL_PATH="$PROTONPATH" + +if [[ -z $STEAM_COMPAT_INSTALL_PATH ]]; then + exepath="$(readlink -f "$1")" + gameinstallpath="${exepath%/*}" + export STEAM_COMPAT_INSTALL_PATH="$gameinstallpath" +fi + export STEAM_COMPAT_CLIENT_INSTALL_PATH='' export STEAM_COMPAT_DATA_PATH="$WINEPREFIX" export STEAM_COMPAT_SHADER_PATH="$STEAM_COMPAT_DATA_PATH"/shadercache @@ -37,6 +41,11 @@ export FONTCONFIG_PATH='' export EXE="$1" shift 1 export LAUNCHARGS="$@" + me="$(readlink -f "$0")" here="${me%/*}" + +export STEAM_COMPAT_TOOL_PATHS="$PROTONPATH:$here" +export STEAM_COMPAT_MOUNTS="$PROTONPATH:$here" + $here/ULWGL --verb=waitforexitandrun -- "$PROTONPATH"/proton waitforexitandrun "$EXE" "$1" "$2" "$3"