Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix BZ process filter for macOS #568

Merged
merged 1 commit into from
Dec 7, 2024
Merged

Conversation

toebeann
Copy link
Contributor

@toebeann toebeann commented Dec 6, 2024

Changes made in this pull request

  • Added an additional process filter for the executable file used on macOS for BZ

Rationale

On macOS, while the .app for the game is named SubnauticaZero.app, this is not an executable file and is not what is typically seen by BepInEx as the name of the process. A folder with an .app extension is a special folder structure used by Apple to denote an application package. Inside of it is a metadata file that tells macOS what to do when the .app is "executed," and in the case of BZ it points to the file SubnauticaZero.app/Contents/MacOS/Subnautica Below Zero. This file is the actual executable that runs the Unity app on macOS, and is what BepInEx sees as the name of the running process. Thus, the SubnauticaZero.exe process filter does not catch this (the .exe is inconsequential - BepInEx strips file extensions when comparing process names).

As some of you may be aware, I created BZMacProcessFix to address this since not only SML/Nautilus have this issue (QMM does as well, and since it is no longer being maintained, will never work on macOS without this workaround). However it seems that in some cases this patcher is unable to fulfill its task, mainly reported by users of old macOS versions that I am unable to test on eg. 32bit Mojave. It is therefore recommended not to rely solely on this patcher, and to actually include the correct process filter for macOS in your BepInEx plugins wherever possible.

Note that no change is required for OG Subnautica as the executable on macOS is simply named Subnautica, which is covered by the Subnautica.exe process filter as file extensions are ignored when comparing.

How can we verify the macOS executable name without having access to macOS?

If you head to the Depots tab of the steamdb.info page for the game, then click the ID next to the macOS config for the game, this will take you to a file listing for the depot (https://steamdb.info/depot/848453/ as of current writing). In this file listing you can see an entry for SubnauticaZero.app/Contents/MacOS/Subnautica Below Zero, which coincidentally is the only file listed within the SubnauticaZero.app/Contents/MacOS folder. macOS application packages rely on executable files which will be referenced by the application's metadata (eg. to determine what executable to run when the application is "executed") being placed in this folder, so you can largely rely on this.

Copy link
Contributor

github-actions bot commented Dec 6, 2024

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@toebeann
Copy link
Contributor Author

toebeann commented Dec 6, 2024

I have read the CLA Document and I hereby sign the CLA

Copy link
Member

@Metious Metious left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@toebeann toebeann merged commit 2e6ed45 into master Dec 7, 2024
3 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Dec 7, 2024
@toebeann toebeann deleted the toebeann-fix-bz-macos-process branch December 7, 2024 17:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants