From 627a3a587b6c88afd6ced1300b56bd4e2b023361 Mon Sep 17 00:00:00 2001 From: Arrowmaster Date: Tue, 27 Jan 2026 20:19:07 -0500 Subject: [PATCH 1/4] run.sh: Add set -e to halt on any unexpected errors --- assets/nix/run.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/assets/nix/run.sh b/assets/nix/run.sh index c840973..b7f9483 100755 --- a/assets/nix/run.sh +++ b/assets/nix/run.sh @@ -60,6 +60,7 @@ corlib_dir="" ################################################################################ # Everything past this point is the actual script +set -e # Special case: program is launched via Steam # In that case rerun the script via their bootstrapper to ensure Steam overlay works From 9a72892f42e80dec129b667bc9c9c628e0cc5e00 Mon Sep 17 00:00:00 2001 From: Arrowmaster Date: Tue, 27 Jan 2026 20:20:27 -0500 Subject: [PATCH 2/4] run.sh: Add error and exit when Windows executable is detected --- assets/nix/run.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/assets/nix/run.sh b/assets/nix/run.sh index b7f9483..af57ea2 100755 --- a/assets/nix/run.sh +++ b/assets/nix/run.sh @@ -192,6 +192,12 @@ executable_path=$(resolve_executable_path "${executable_path}") # Figure out the arch of the executable with file file_out="$(LD_PRELOAD="" file -b "${executable_path}")" case "${file_out}" in + *PE32*) + echo "The executable is a Windows executable file. You must use Wine/Proton and BepInEx for Windows with this executable." 1>&2 + echo "Uninstall BepInEx for *nix and install BepInEx for Windows instead." 1>&2 + echo "More info: https://docs.bepinex.dev/articles/advanced/steam_interop.html#protonwine" 1>&2 + exit 1 + ;; *64-bit*) arch="x64" ;; From 4613daa94182fc9dbe9c35abb3c04cee9caface3 Mon Sep 17 00:00:00 2001 From: Arrowmaster Date: Tue, 27 Jan 2026 20:23:36 -0500 Subject: [PATCH 3/4] run.sh: Allow the rare usage of Steam launching a shell script --- assets/nix/run.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/assets/nix/run.sh b/assets/nix/run.sh index af57ea2..baffb96 100755 --- a/assets/nix/run.sh +++ b/assets/nix/run.sh @@ -198,6 +198,11 @@ case "${file_out}" in echo "More info: https://docs.bepinex.dev/articles/advanced/steam_interop.html#protonwine" 1>&2 exit 1 ;; + *shell\ script*) + # Fallback for games that launch a shell script from Steam + # default to x64, change as needed + arch="x64" + ;; *64-bit*) arch="x64" ;; From 6abda2fc58ab16e29428b7101c462177d1d28200 Mon Sep 17 00:00:00 2001 From: Arrowmaster Date: Tue, 27 Jan 2026 20:29:14 -0500 Subject: [PATCH 4/4] run.sh: Change Steam executable detection to a simpler check for a file located in the working directory --- assets/nix/run.sh | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/assets/nix/run.sh b/assets/nix/run.sh index baffb96..6992417 100755 --- a/assets/nix/run.sh +++ b/assets/nix/run.sh @@ -62,24 +62,15 @@ corlib_dir="" # Everything past this point is the actual script set -e -# Special case: program is launched via Steam -# In that case rerun the script via their bootstrapper to ensure Steam overlay works -steam_arg_helper() { - if [ "$executable_name" != "" ] && [ "$1" != "${1%"$executable_name"}" ]; then - return 0 - elif [ "$executable_name" = "" ] && [ "$1" != "${1%.x86_64}" ]; then - return 0 - elif [ "$executable_name" = "" ] && [ "$1" != "${1%.x86}" ]; then - return 0 - else - return 1 - fi -} +# Special case: program is launched via Steam on Linux +# In that case rerun the script via their bootstrapper to delay adding Doorstop to LD_PRELOAD +# This is required until https://github.com/NeighTools/UnityDoorstop/issues/88 is resolved for a in "$@"; do if [ "$a" = "SteamLaunch" ]; then rotated=0; max=$# while [ $rotated -lt $max ]; do - if steam_arg_helper "$1"; then + # Test if argument is prefixed with the value of $PWD + if [ "$1" != "${1#"${PWD%/}/"}" ]; then to_rotate=$(($# - rotated)) set -- "$@" "$0" while [ $((to_rotate-=1)) -ge 0 ]; do @@ -93,7 +84,7 @@ for a in "$@"; do rotated=$((rotated+1)) fi done - echo "Please set executable_name to a valid name in a text editor" 1>&2 + echo "Could not determine game executable launched by Steam" 1>&2 exit 1 fi done