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 for DMG and Downloads folder detection in macOS Sierra #60

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JeremyAgost
Copy link

Check whether the app is running under Translocation on macOS Sierra and uses the original application path instead of the path the app is running from. This fixes DMG and Downloads folder detection, which is broken when running from a Translocated path.

I applied a similar fix to the fork we use in our app, but it was ObjC++ so I had to tweak it for you guys.

…and uses the original application path instead of the path the app is running from. This fixes DMG and Download folder detection, which is broken when running from a Translocated path.
@andypotion
Copy link
Collaborator

Hi Jeremy,

I'm a bit hesitant to merge this because it's using undocumented API. LetsMove works fine even under translocation right now because translocated app is the same as the "real" app. Can you tell me why you think this is necessary?

@JeremyAgost
Copy link
Author

When Sierra was released, my team noticed that the detection of the app being in the downloads folder or a mounted disk image was not functional anymore. This appeared to be because those detection methods relied on looking at the original application launch path, which is obscured for translocated apps. The Security framework in the macOS Sierra beta SDK had documented functions for determining if an app was running translocated and finding the original launch path if so. They were removed in the release SDK (I haven’t checked if they reappeared, but I’m guessing no) but the symbols are still present and the lookup is safe.

@tengyifei
Copy link

Note that since macOS 14 Mojave, it is not possible to send Apple events to Finder without user confirmation, so the AppleScript trick doesn't work anymore for translocated apps. Perhaps using hidden Security functions is the only solution.

@JeremyAgost
Copy link
Author

What is the “AppleScript trick” used for? I don’t recall seeing that routine.

@tengyifei
Copy link

@JeremyAgost I was referring to this line:

https://github.com/potionfactory/LetsMove/blob/master/PFMoveApplication.m#L408

It seems that all other attempts at removing a translocated app fails, and this last resort was blocked in macOS 14.

@abemedia
Copy link

abemedia commented Aug 5, 2020

Any update on this?

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.

None yet

4 participants