LetsMove icon indicating copy to clipboard operation
LetsMove copied to clipboard

Fix for DMG and Downloads folder detection in macOS Sierra

Open JeremyAgost opened this issue 8 years ago • 6 comments

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.

JeremyAgost avatar Dec 02 '16 00:12 JeremyAgost

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?

andypotion avatar Sep 06 '17 08:09 andypotion

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.

JeremyAgost avatar Sep 06 '17 12:09 JeremyAgost

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.

tengyifei avatar Oct 18 '18 09:10 tengyifei

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

JeremyAgost avatar Oct 19 '18 14:10 JeremyAgost

@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.

tengyifei avatar Oct 24 '18 07:10 tengyifei

Any update on this?

abemedia avatar Aug 05 '20 18:08 abemedia