I have a sandboxed/hardened app that is distributed outside of the MacAppStore. I want to allow the app to auto-update itself.
I currently have the ability in the app to figure out if there is a newer version which then informs the user and gives them an option to download the app (currently it downloads to ~/Downloads in the app container). The app comes as a simple zip file that only includes the app itself. Once downloaded, then NSWorkspace.shared.open(URLtoDownloadedUpdate)
will expand the zip and place the app in ~/Downloads.
What I want is it to replace the current version of the app w/ this newly downloaded version. Is this possible?
First, how do I find out where the old app is stored? And then how do I replace it with the new version when the old app is still running?
I realize many people use Sparkle to do this instead of rolling their own. I simply do not want to depend on a third party.