1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- #!/bin/sh
- if [ -z "$1" ]; then echo "Please open run.sh in a text editor and configure executable name. Comment or remove this line when you're done." && exit 1; fi
- executable_name="";
- export DOORSTOP_ENABLE=TRUE;
- export DOORSTOP_INVOKE_DLL_PATH=${PWD}/BepInEx/core/BepInEx.Preloader.dll;
- LD_PRELOAD_BAK=$LD_PRELOAD;
- export LD_PRELOAD="";
- doorstop_libs=${PWD}/doorstop_libs;
- arch="";
- executable_path="";
- lib_postfix="";
- os_type=`uname -s`;
- case $os_type in
- Linux*) executable_path=${PWD}/${executable_name};
- lib_postfix="so";;
- Darwin*) executable_path=${PWD}/${executable_name}.app/Contents/MacOS/${executable_name};
- lib_postfix="dylib";;
- *) echo "Cannot identify OS (got $(uname -s))!";
- echo "Please create an issue at https://github.com/BepInEx/BepInEx/issues.";
- exit 1;;
- esac
- if [ -n "$1" ]; then
- case $os_type in
- Linux*) executable_path=$1;;
- Darwin*) executable_name=`basename "$1" .app`;
- executable_path=$1/Contents/MacOS/$executable_name;;
- esac
- fi
- executable_type=`file -b "${executable_path}"`;
- case $executable_type in
- *64-bit*) arch="x64";;
- *32-bit*|*i386*) arch="x86";;
- *) echo "Cannot identify executable type (got ${executable_type})!";
- echo "Please create an issue at https://github.com/BepInEx/BepInEx/issues.";
- exit 1;;
- esac
- doorstop_libname=libdoorstop_${arch}.${lib_postfix};
- export LD_LIBRARY_PATH=${doorstop_libs}:${LD_LIBRARY_PATH};
- export LD_PRELOAD=${doorstop_libs}/$doorstop_libname:$LD_PRELOAD_BAK;
- export DYLD_LIBRARY_PATH=${doorstop_libs};
- export DYLD_INSERT_LIBRARIES=${doorstop_libs}/$doorstop_libname;
- "${executable_path}"
|