Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions scripts/Start scripts/start_game_bepinex.sh
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ export DOORSTOP_MONO_DEBUG_SUSPEND="$debug_suspend"
# Final setup
doorstop_directory="${BASEDIR}/doorstop_libs"
doorstop_name="libdoorstop_${arch}.${lib_extension}"
doorstop_path="${doorstop_directory}/${doorstop_name}"

export LD_LIBRARY_PATH="${doorstop_directory}:${LD_LIBRARY_PATH}"
if [ -z "$LD_PRELOAD" ]; then
Expand All @@ -279,6 +280,30 @@ else
export LD_PRELOAD="${doorstop_name}:${LD_PRELOAD}"
fi

if [ "${os_type}" = "Darwin" ] && [ "${arch}" = "x64" ] && command -v arch >/dev/null 2>&1; then
exec arch -x86_64 /bin/sh -c '
doorstop_directory="$1"
doorstop_path="$2"
existing_dyld_library_path="$3"
existing_dyld_insert_libraries="$4"
shift 4

if [ -z "$existing_dyld_library_path" ]; then
export DYLD_LIBRARY_PATH="$doorstop_directory"
else
export DYLD_LIBRARY_PATH="$doorstop_directory:$existing_dyld_library_path"
fi

if [ -z "$existing_dyld_insert_libraries" ]; then
export DYLD_INSERT_LIBRARIES="$doorstop_path"
else
export DYLD_INSERT_LIBRARIES="$doorstop_path:$existing_dyld_insert_libraries"
fi

exec "$@"
' sh "$doorstop_directory" "$doorstop_path" "$DYLD_LIBRARY_PATH" "$DYLD_INSERT_LIBRARIES" "$executable_path" "$@"
fi

export DYLD_LIBRARY_PATH="${doorstop_directory}:${DYLD_LIBRARY_PATH}"
if [ -z "$DYLD_INSERT_LIBRARIES" ]; then
export DYLD_INSERT_LIBRARIES="${doorstop_name}"
Expand Down