I have an application (written in C++/Qt, but I don't think that's important for this issue). I have a valid developer profile, the application is distributed as downloadable .dmg file, it is properly signed and notarized - at least, to the best of my knowledge.
The usual way of installing it is to download from the website, open the .dmg, drag the app to Applications, and launch it. This works fine, at least when downloading with Safari. The users get no prompts or warnings of any kind, other than "The app is downloaded from Internet".
But the application also has an auto-update feature that works like this:
- Downloads the new .dmg file's contents using
QNetworkAccessManager
(via HTTP). - Writes the file to disk with
QFile
. - Runs the script that mounts the dmg with
hdiutil attach ... -noverify
. - Copies the new .app over the old one using
cp -r
. - Now the user just has to close and reopen the app.
This used to work fine up to macOS 12.6. But since Ventura (13.0), the user gets "The file is damaged and should be moved to the trash" error when opening the auto-updated app. Must be a new feature of the Gatekeeper. The file is not literally damaged, of course. Both the .app bundle and the dmg file are signed. Is there any way I can fix my auto-update function?