Yes, this is very likely the completely wrong way to do things but I would like to ask regardless.
Currently with windows/linux I can perform an in-situ upgrade of an application by performing a download of the binary 'foo' and then doing a rename-and-replace and subsequently requesting the licencee to restart the program and all is good.
With macOS, as the binary is within the foo.app ( Contents/macOS/foo ) I imagine I cannot perform a similar operation without breaking the signing of the foo.app itself?
....or, can I individually sign the binary foo for macOS and perform the same type of operation?
- Download new foo as foo.new
- rename current foo.app/Content/macOS/foo -> foo.old
- rename foo.new -> foo
- Restart application
Again, I know this is very likely an un-macOS way of performing the task but as you can imagine with supporting cross-platform development it's usually easier to maintain a consistent method even if it's "not ideal".
There is no meaningful concept of "the binary". The entire app bundle is signed. If you change any part of the app bundle, you must also replace the signature with a valid one for the new bundle.
Replacing an entire app is a bit tricky as there are OS-level complications. The recommendations I've seen here on the forums are to duplicate the existing app bundle, swap out the parts, then move the new app bundle into place.
But that's really a lot of pointless work. Just post a new app bundle and let the user replace the old one with the new one.