LostArtefacts / TRX

Open source re-implementation of Tomb Raider I and Tomb Raider II, along with additional enhancements and bugfixes
https://lostartefacts.dev/
GNU General Public License v3.0
588 stars 38 forks source link

Can't seem to install on MacOS #1359

Open ziaddemir opened 6 months ago

ziaddemir commented 6 months ago

Followed the instructions but get an error message when I try to launch the application. I do seem to be missing some files (I unpacked the Steam version's GAME.GOG using The Unarchiver) but I assumed those were specifically for the Expansion Pack.) See screenshots for the error message and my folder structure. I'm on an M2 Pro Macbook Pro and MacOS 14.4.1. Using the latest .dmg (tested the pre-release and a couple older versions as well, same result.)

image image image

walkawayy commented 6 months ago

I also had this issue. We will have to investigate what's broken. Sorry about that.

ziaddemir commented 6 months ago

I'm not sure why this worked, but I was able to install with the following steps:

  1. Mount the installer
  2. Before dragging into the Applications folder, first double-click the app and open it. It will launch, then quit by itself after the Eidos logo since the game data hasn't been inserted yet.
  3. Right-click the app, click "Show Package Contents," navigate to Content -> Resources. You don't have to do anything here, just opening the folder is enough.
  4. Drag the app into the Applications folder, then add your game files following the instructions on Github. The game should launch fine now.

I'm suspecting this has something to do with MacOS permissions? Hope this helps in narrowing down a possible fix.

eikehein commented 6 months ago

So the reason for this is going to be roughly something like this:

  1. When you download a file from the internet, macOS automatically attaches a hidden attribute to the file (the com.apple.quarantine xattr)
  2. When you try to open the file, the macOS Gatekeeper feature steps in an does two things:
    • Show you a warning dialog about # 1 which you can OK
    • If the file is code-signed and notarized (which our .dmg and app bundle are), it verifies that the signature is correct and matches the file contents
  3. If # 2 is successful, the xattr is removed

That probably means if you modify the app bundle before running it for the first time, the signature verification will fail and the quarantine attrib doesn't get removed. If you run it first and the xattr gets dropped, you can modify the bundle afterwards. There's also ways to override Gatekeeper if your user account has admin privs, etc.

We have to change the install instructions accordingly. However, a better long-term solution is supporting to find & access the game data from outside the .app bundle to avoid the need to modify it, which of course would also make updating much easier and cleaner.

eikehein commented 6 months ago

I've now confirmed the above experimentally - running first before copying in the data is fine, copying in before first run causes the verification to fail and the "app is damaged" popup.