Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Avoiding bundle self-modification

Apple recommends to stop bundle self-modification as soon as possible:


"If you used custom resource rules because your program modifies itself

as it is running, you should stop doing this as soon as possible. If you

transport such a modified app to another computer by web download,

email, AirDrop, etc., the modified copy at the receiving end will be

quarantined. This will trigger the Gatekeeper check the first time the

app is run on the receiving machine, and the app will not be allowed to

run because of the broken signature."


https://developer.apple.com/library/archive/technotes/tn2206/_index.html#//apple_ref/doc/uid/DTS40007919-CH1-TNTAG401


Q1: My question is about the standard practice of saving the data outside the bundle. Namely, how to handle program removal. When the data is saved inside the bundle, removing the bundle means also removing the data. But when data is saved into ~/Library/Application Support, it means we need some kind of uninstaller and instead of a single bundle we have a directory containing both the bundle and its uninstaller. When installed in /Applications this directory is displayed as two applications in Launchpad: the main bundle and the uninstaller, which doesn't look nice to me. Or is it ok? What's the standard way to handle situations like this one? Perhaps it's somehow possible to make macOS silently call the uninstaller when the user removes the main bundle from the Launchpad?


Q2: I've also read somewhere (cannot find the link atm) that with the upcoming macOS Catalina the bundle signatures will be periodically checked by the OS, so self-modifying bundles may have issues running even without being sent over the internet. Is it true?


Thanks

Posted on Aug 14, 2019 2:25 AM

Reply
Question marked as Best reply

Posted on Aug 14, 2019 3:14 AM

I believe this question belongs to the development forums rather than here. So I cross-posted it there: https://forums.developer.apple.com/message/376986

1 reply

Avoiding bundle self-modification

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.