Skip to content

Linux run_bepinex.sh fails when cwd is different and executable_name is relative #1189

@Sodium-Aluminate

Description

@Sodium-Aluminate

What happened?

~/games/silksong$ ls latest/Hollow\ Knight\ Silksong/game/Hollow\ Knight\ Silksong
'latest/Hollow Knight Silksong/game/Hollow Knight Silksong'*
~/games/silksong$ # silksong game bin is in ~/games/silksong/latest/Hollow Knight Silksong/game/Hollow Knight Silksong
~/games/silksong$ 
~/games/silksong$ 
~/games/silksong$ cat BepInEx_latest/run_bepinex.sh |grep "^executable_name"
executable_name='../latest/Hollow Knight Silksong/game/Hollow Knight Silksong'
~/games/silksong$ # it should be "~/games/silksong/BepInEx_latest/../latest/Hollow Knight Silksong/game/Hollow Knight Silksong" and should be work
~/games/silksong$ bash BepInEx_latest/run_bepinex.sh 
Please set executable_name to a valid name in a text editor or as the first command line parameter
~/games/silksong$ # failed.
~/games/silksong$ 
~/games/silksong$ 
~/games/silksong$ # maybe this script is using cwd? so let's try "~/games/silksong/./latest/Hollow Knight Silksong/game/Hollow Knight Silksong"
~/games/silksong$ vim BepInEx_latest/run_bepinex.sh 
~/games/silksong$ cat BepInEx_latest/run_bepinex.sh |grep "^executable_name"
executable_name='./latest/Hollow Knight Silksong/game/Hollow Knight Silksong'
~/games/silksong$ LANG="" bash BepInEx_latest/run_bepinex.sh 
BepInEx_latest/run_bepinex.sh: line 123: cd: /home/sodiumaluminate/games/silksong/BepInEx_linux_x64_5.4.23.4/./latest/Hollow Knight Silksong/game: No such file or directory
The executable "//Hollow Knight Silksong" is not compiled for x86 or x64 (might be ARM?)
If you think this is a mistake (or would like to encourage support for other architectures)
Please make an issue at https://github.com/NeighTools/UnityDoorstop
Got: cannot open `//Hollow Knight Silksong' (No such file or directory)
~/games/silksong$ # we pass the first check but still something wrong. 
~/games/silksong$ 
~/games/silksong$ 
~/games/silksong$ # change it back and try to run this script in "~/games/silksong/BepInEx_latest/"
~/games/silksong$ vim BepInEx_latest/run_bepinex.sh 
~/games/silksong$ cat BepInEx_latest/run_bepinex.sh |grep "^executable_name"
executable_name='../latest/Hollow Knight Silksong/game/Hollow Knight Silksong'
~/games/silksong$ cd BepInEx_latest/
~/games/silksong/BepInEx_latest$ bash run_bepinex.sh 
[UnityMemory] Configuration Parameters - Can be set up in boot.config
    "memorysetup-bucket-allocator-granularity=16"
...(game starts normally)

Steps to reproduce

  1. Set executable_name in run_bepinex.sh to a relative path (e.g., ../latest/Hollow Knight Silksong/game/Hollow Knight Silksong).

  2. Open a terminal in a different directory than where run_bepinex.sh is located.

  3. Run the script: ./path/to/run_bepinex.sh.

  4. Observe that the script fails with the message:

    Please set executable_name to a valid name in a text editor or as the first command line parameter
    
  5. Repeat steps 2–3 in the same directory as run_bepinex.sh.

  6. Observe that the script runs successfully.

BepInEx Distribution

Stable from GitHub

Log outputs

(no outputs——BepInEx not started at all)

Environment

- OS: archlinux
- BepInEx: `BepInEx_linux_x64_5.4.23.4`
- Game: silksong

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions