From 758713ac549ef851d8760f2c6dcd2e085676204a Mon Sep 17 00:00:00 2001 From: Eamonn Rea Date: Sat, 17 Dec 2022 17:14:03 +0000 Subject: [PATCH] Don't remove user-created symlinks for game prefixes For #692 --- steamtinkerlaunch | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/steamtinkerlaunch b/steamtinkerlaunch index b6ec3611..789a6245 100755 --- a/steamtinkerlaunch +++ b/steamtinkerlaunch @@ -6,7 +6,7 @@ PREFIX="/usr" PROGNAME="SteamTinkerLaunch" NICEPROGNAME="Steam Tinker Launch" -PROGVERS="v11.12.20221215-2" +PROGVERS="v11.12.20221217-1" PROGCMD="${0##*/}" SHOSTL="stl" GHURL="https://github.com" @@ -10699,10 +10699,16 @@ function redirectSCDP { else writelog "INFO" "${FUNCNAME[0]} - Using regular $CODA '$STEAM_COMPAT_DATA_PATH'" if [ -L "$STEAM_COMPAT_DATA_PATH" ]; then - rm "${STEAM_COMPAT_DATA_PATH}/used_by-$AID" 2>/dev/null - writelog "INFO" "${FUNCNAME[0]} - '$STEAM_COMPAT_DATA_PATH' is a symlink. Removing it, as REDIRCOMPDATA is $REDIRCOMPDATA" - rm "$STEAM_COMPAT_DATA_PATH" - mkProjDir "$STEAM_COMPAT_DATA_PATH" + if [ -f "${STEAM_COMPAT_DATA_PATH}/used_by-$AID" ]; then + rm "${STEAM_COMPAT_DATA_PATH}/used_by-$AID" 2>/dev/null + writelog "INFO" "${FUNCNAME[0]} - '$STEAM_COMPAT_DATA_PATH' is a symlink. Removing it, as REDIRCOMPDATA is $REDIRCOMPDATA" + rm "$STEAM_COMPAT_DATA_PATH" + mkProjDir "$STEAM_COMPAT_DATA_PATH" + else + # See STL issue #692 for background on the above removing logic removing valid user prefixes + writelog "INFO" "${FUNCNAME[0]} - '$STEAM_COMPAT_DATA_PATH' is a symlink, but we don't have a 'used_by-$AID' file in this game's prefix -- Assuming this is a user-created symlink and not removing" + writelog "INFO" "${FUNCNAME[0]} - User-created symlinks are valid on Steam Deck to work around some Steam Client bugs" + fi fi fi fi