Skip to content

Conversation

@astiob
Copy link
Contributor

@astiob astiob commented Oct 30, 2023

This targets master. v5-lts version: #693

Description

This modifies run_bepinex*.sh to support both old and new versions of Steam, as well as to support paths that contain spaces (which were supported in v5-lts but not in master).

An additional, simple fix for a generic shell-script issue is also included.

Motivation and Context

Recently, Steam apparently changed the way it executes the game, inserting -- arguments where they didn’t exist before. So #562 and #563 modified run_bepinex*.sh to match this change by hardcoding the two added arguments. As noted in #562 (review), this presumably made it impossible to run BepInEx in older versions of Steam.

This pull request teaches the code in run_bepinex*.sh to handle the -- arguments in a special way, achieving the desired effect both in old Steam where they’re absent and in new Steam where they’re present.

Further, the shell script now uses exec instead of call; exit (thus allowing, for example, killed-by-signal status to be passed through to the invoker in case it matters, not to mention a minor efficiency improvement).

How Has This Been Tested?

I’ve tested the new code in an isolated shell script (in openSUSE’s bash 4.4.23 and Ubuntu’s dash 0.5.11, both invoked as sh), but I have not tested an actual Steam setup.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project. (This is probably irrelevant for the shell scripts? But I tried to make it consistent with the other code in the same files.)
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@astiob astiob force-pushed the SteamLaunch/master branch from 2acaca1 to bc454fc Compare November 7, 2023 21:52
@astiob
Copy link
Contributor Author

astiob commented Nov 7, 2023

Dropped a commit that was meant to make the [ invocation safer because it wasn’t nearly as useful as I had thought, in the sense that the invocation is safe enough as it is.

@js6pak
Copy link
Member

js6pak commented Dec 28, 2023

Is this the correct place to update the script? Isn't https://github.com/NeighTools/UnityDoorstop/blob/master/assets/nix/run.sh the canonical version?
We might want to pull the script from doorstop automatically in the build script and just set the defaults values instead copying the whole thing here.

@astiob
Copy link
Contributor Author

astiob commented Dec 28, 2023

Good question. I don’t know; I saw #562 updating the script here (these updates not reflected in the linked version) but in a suboptimal way, so I wanted to improve that update. I’m happy to follow whatever chosen process.

@ManlyMarco ManlyMarco merged commit 4901521 into BepInEx:master Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants