valheimPlus / ValheimPlus

A HarmonyX Mod aimed at improving the gameplay and quality of life of the game Valheim.
http://valheim.plus
GNU Affero General Public License v3.0
967 stars 236 forks source link

[Problem] Cannot identify executable type (got )! #741

Closed tebbeh-dev closed 1 year ago

tebbeh-dev commented 1 year ago

Describe the bug Cannot identify executable type (got )! image

A clear and concise description of what the bug is and how you found it. Cannot start the server from fresh steamcmd install and fresh ValheimPlus install. Without ValheimPlus it runs fine but ./start_server_bepinex.sh give me Cannot identify executable type (got )!

To Reproduce I cannot explain it better, must be other that have the same problem. Valheim server runs fine but when i try ValheimPlus it gives me this error. I link both files to compare.

Original: `#!/bin/bash export templdpath=$LD_LIBRARY_PATH export LD_LIBRARY_PATH=./linux64:$LD_LIBRARY_PATH export SteamAppId=892970

echo "Starting server PRESS CTRL-C to exit"

./valheim_server.x86_64 -name "My server" -port 2456 -world "Dedicated" -password "secret"

export LD_LIBRARY_PATH=$templdpath `

ValheimPlus:

`

!/bin/sh

executable_name="valheim_server.x86_64"

server_name="ValheimPlus" server_password="password" server_port=2456 server_world="world" server_public=1 server_savedir="$HOME/.config/unity3d/IronGate/Valheim"

export VALHEIM_PLUS_SCRIPT="$(readlink -f "$0")" export VALHEIM_PLUS_PATH="$(dirname "$VALHEIM_PLUS_SCRIPT")"

export DOORSTOP_ENABLE=TRUE

export DOORSTOP_INVOKE_DLL_PATH="${VALHEIM_PLUS_PATH}/BepInEx/core/BepInEx.Preloader.dll"

export DOORSTOP_CORLIB_OVERRIDE_PATH="${VALHEIM_PLUS_PATH}/unstripped_corlib"

if [ ! -x "$1" -a ! -x "${VALHEIM_PLUS_PATH}/$executable_name" ]; then echo "Please open start_server_bepinex.sh in a text editor and provide the correct executable." exit 1 fi

doorstop_libs="${VALHEIM_PLUS_PATH}/doorstop_libs" arch="" executable_path="" lib_postfix=""

os_type=$(uname -s) case $os_type in Linux) executable_path="${VALHEIM_PLUS_PATH}/${executable_name}" lib_postfix="so" ;; Darwin) executable_name="$(basename "${executable_name}" .app)" real_executable_name="$(defaults read "${VALHEIM_PLUS_PATH}/${executable_name}.app/Contents/Info" CFBundleExecutable)" executable_path="${VALHEIM_PLUS_PATH}/${executable_name}.app/Contents/MacOS/${real_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

executable_type=$(LD_PRELOAD="" 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

doorstoplibname=libdoorstop${arch}.${lib_postfix} export LD_LIBRARY_PATH="${doorstop_libs}":"${LD_LIBRARY_PATH}" export LD_PRELOAD="$doorstop_libname":"${LD_PRELOAD}" export DYLD_LIBRARY_PATH="${doorstop_libs}" export DYLD_INSERT_LIBRARIES="${doorstop_libs}/$doorstop_libname"

export templdpath="$LD_LIBRARY_PATH" export LD_LIBRARY_PATH="${VALHEIM_PLUS_PATH}/linux64":"${LD_LIBRARY_PATH}" export SteamAppId=892970

for arg in "$@" do case $arg in -name) server_name=$2 shift 2 ;; -password) server_password=$2 shift 2 ;; -port) server_port=$2 shift 2 ;; -world) server_world=$2 shift 2 ;; -public) server_public=$2 shift 2 ;; -savedir) server_savedir=$2 shift 2 ;; esac done

"${VALHEIM_PLUS_PATH}/${executable_name}" -name "${server_name}" -password "${server_password}" -port "${server_port}" -world "${server_world}" -public "${server_public}" -savedir "${server_savedir}"

export LD_LIBRARY_PATH=$templdpath `

tebbeh-dev commented 1 year ago

Quoting solution from BepInEx "Judging from the message (specifically the file: not found), your server install is probably missing file program. For Debian-based distros that don't have it installed by default, you should be able to apt-get install file to install it."

so my problem was basic linux knowledge!