Suggested Mac Improvement to main.js for new users

Arpie

Well-Known Member
Oct 31, 2018
51
17
55
I'm a big keyboard/terminal user. Today, I leaned the easiest way to turn off AppTranslation that breaks ImagePack download is to move the unzipped application to another folder with the Finder.

1) Could you detect if app translation is on by checking app.getAppPath() to see if it matches /private/var/folders/.*/AppTranslocation/ (Almost certainly, looking for the substring AppTranslocation will be good enough 99% of the time, but I don't know if you need to stringify the path first.)
2) If detected, I think you should disable the ImagePack button and change the help text to point them at a Mac-specific fix like moving the app to a new folder using the Finder // Of course this is also the Gallery button so maybe a popup window and not a tooltip.
3) If they have struggled with this before, they might have mangled their ImagePack directory in a way that breaks future attempts (button hangs with "Determining Image Pack Status ..." as tooltip with no visible errors on console) Deleting the Image Pack download (rm -rf ~/Library/Application\ Support/tits/ImagePack/ worked for me)

http://lapcatsoftware.com/articles/app-translocation.html has this nice paragraph on this issue:


Under what circumstances does App Translocation occur? First, the app must have a com.apple.quarantine extended attribute. If you delete the quarantine xattr, then App Translocation does not occur, and the app will launch from where it was unarchived, like normal. Second, the app must be opened by Launch Services. This usually means Finder, but it can also mean open from Terminal, for example. If you launch the app executable directly from bash, on the other hand, App Translocation does not occur. Third, the app must not have been moved — by Finder. If you move the app, using Finder, from the app's original unarchived location to another folder, even a subfolder, e.g., ~/Downloads/Test/, then App Translocation does not occur. However, if you move the app using mv from Terminal, then App Translocation will still occur. Normally you would move the app from ~/Downloads to /Applications, and that would cause the app to be launched from /Applications like normal, but the locations of the particular folders don't seem to matter. The mere act of moving the app using Finder stops App Translocation from happening. Indeed, once you've moved the app once, it will no longer experience App Translocation again, even if you then move it back to ~/Downloads.