MacOS: App does not find data/ folder, once extracted from a .zip archive


#1

Hello there,

when my application is extracted from a .zip archive it does not work anymore. Think there is something broken with the paths. It can not find the assets.

Folder containing the app looks like this:
data/
my.app

Fun fact is that I can run the app, when I cd into the my.app/Contents/MacOS folder and run the my binary directly. Then, all paths seem to be fine and assets are there…

Had this problem before but I can’t remember the solution :slight_smile: I think it was some terminal command to run on the .app to fix some rights, that get compromised when you zip on the Mac.

Hope you guys can help + Thank you for your time!
Hans


#2

this is because of app translocation

https://lapcatsoftware.com/articles/app-translocation.html

from the command line you can fix it this way i think:

https://support.mokastudio.com/support/solutions/articles/6000184826-macos-sierra-10-12-app-translocation-gatekeeper-path-randomization

another simple option is to move the .app out of the zip folder and back. that action seems to remove the translocation.

my solution that I use for clients is to use a signed disk image – I use an app called DMG canvas where you can design the background for the dmg and sign it. I find that if clients move the app from the signed disk image app translocation goes away

Here’s an example of the DMG I make usually – I’ve found this to be helpful for situations where I can’t ask a client to do something like command line etc:


#3

Thank you so much @zach

This was exactly the command I was looking for. It did fix the app!

Also thank you very much for mentioning that DMG canvas app. Used it and works like a charm – the better way to share applications.