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

macOS: Untranslocate the app bundle's path for the updater #8915

Merged
merged 3 commits into from
Jul 6, 2021

Conversation

OatmealDome
Copy link
Member

Starting in macOS Sierra, if an app is downloaded from the Internet, the system may "translocate" an app's bundle to a read-only container elsewhere on the filesystem and execute it from there. This is done to protect against a trusted application's resources from being hijacked to load untrusted code. More information is available here (with many thanks to Patrick Wardle).

Unfortunately, this has the side-effect of breaking the updater, as it'll attempt to find the updater app bundle from the read-only container. So, GetBundleDirectory() has been changed to "untranslocate" the app bundle's path if necessary. The APIs used to do this were briefly public in Xcode 8 beta 1, but they were made private in a later beta. There is no other way to untranslocate a path (as far as I know). The headers are still open source, however.

Also, this PR includes a fix for https://bugs.dolphin-emu.org/issues/11784. The updater's working directory is now created in the OS's standard temp directory, and the log file is placed in User/Logs.

Source/Core/Common/FileUtil.cpp Outdated Show resolved Hide resolved
Source/Core/Common/FileUtil.cpp Outdated Show resolved Hide resolved
@OatmealDome
Copy link
Member Author

Addressed comments.

@OatmealDome
Copy link
Member Author

Finally got around to rebasing. Should fix at least one of the issues plaguing the macOS updater right now (app not launching if downloaded from the Internet). Tested on an Intel MacBook Pro, but should still be OK on an M1.

@leoetlino leoetlino merged commit 27c560f into dolphin-emu:master Jul 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants