eternalcodes / EternalJK

Effort to maintain and improve OpenJK
GNU General Public License v2.0
60 stars 23 forks source link

Launching the .app doesn't work on macOS Catalina, but directly running binary does #110

Closed ddasilva closed 3 years ago

ddasilva commented 3 years ago

Operating system and version: macOS Catalina, Version 10.15.5 (19F101) EternalJK: Apr 11 2020 macosx-x86_64 Apr 11 2020

Description of the bug (and if possible, steps to reproduce the bug): Downloaded the JOF portable version, and installed eternaljk on top of it. Opening the .app file for eternaljk doesn't work (get error, see below). However, if I run the binary on the command line (eternaljk.x86_64.app/Contents/MacOS/eternaljk.x86_64) it does work.

Screen Shot 2020-09-30 at 12 16 20 PM

What did you expect to happen instead? I expected the .app to not crash and instead launch the game.

naomiaan commented 3 years ago

I'm not familiar with the "JOF portable version", is that a file you downloaded outside of the releases on this repo?

Catalina (10.15) introduced some pretty strict security features, it could be because it's an unsigned .app. Looking at this crash report, it looks like the OS translocated the app to /private/var/folders to run it in a place where it would have limited access to the rest of the system in the event that it was malicious. It stands to reason that you would be receiving an EXC_BAD_ACCESS / KERN_INVALID_ADDRESS since the application would be attempting to access system memory from a "sandboxed" location.

The reason it runs when you execute the binary within the application directly is because you're bypassing the Catalina .app security protections and running it wherever it is.

A little more information about how macOS 10.15+ runs .apps: https://eclecticlight.co/2019/10/10/how-catalina-handles-app-first-run/

Is there a reason you want to run the "JOF portable" version and not just install EternalJK on your Mac?

ddasilva commented 3 years ago

Thanks @naomiaan, I figured it was something as much.

The portable version is the one they packaged onthe JoF clan website (ctrl+f portable): https://jofacademy.eu/ The reason I used that was because the only version I own is the Steam version, and it won't let me download the software on my Mac.

Do you have a better way to get the JKA assets on mac?

naomiaan commented 3 years ago

@ddasilva, as it turns out I do! :) I'm working on a PR to update the EternalJK README to include these instructions.

Installing and running the EternalJK client on macOS 10.15 (Catalina) or newer:

  1. Download the latest release for macOS.
  2. Create a new directory named Jedi Academy in /Users/<ACCOUNT>/Library/Application Support.
  3. (a) If you purchased the game through Steam: browse the local game files, right-click Star Wars Jedi Knight: Jedi Academy and select "Show Package Contents" and copy the contents of the Contents directory into the new directory you created in the previous step. (b) If you purchased the game somewhere else, you'll need to copy the contents of the GameData directory into the new directory you created in the previous step.
  4. Extract the contents of the EternalJK release you downloaded in Step 1 into the Jedi Academy directory you created in Step 2.
  5. Run EternalJK. You will need to allow the application to run in the "General" tab of Settings > Security & Privacy.

Please let me know if that gives you enough information to get it installed. If you have any questions, don't hesitate to ping me so I can update the instructions. The JOF portable may also have some custom .pk3 files or configs bundled with it, so make sure you copy those over as well if you want to keep them. If you install this way, once you launch it, you can use spotlight (⌘ + Space) and type EternalJK to launch quickly in the future.

ddasilva commented 3 years ago

Thanks. I didn't realize steam actually downloaded the game files because it gave this huge red banner about MacOS not supporting 32-bit programs...