LetsMove
LetsMove copied to clipboard
Fix for DMG and Downloads folder detection in macOS Sierra
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.
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?
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.
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.
What is the “AppleScript trick” used for? I don’t recall seeing that routine.
@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.
Any update on this?