diff --git a/docs/11-packaging-and-updates.md b/docs/11-packaging-and-updates.md index bf526f8..a87b877 100644 --- a/docs/11-packaging-and-updates.md +++ b/docs/11-packaging-and-updates.md @@ -310,7 +310,13 @@ It says so. **Also ship a standalone uninstaller script** in the DMG for the user who already dragged the app to the Trash and then found the volumes. It is `Uninstall xBot.command`, copied from -`scripts/uninstall-xbot.command`, and it mirrors `AppState.uninstall()` step for step. ⚠️ Yes, this is a terminal — it is the one place the no-terminal +`scripts/uninstall-xbot.command`, and it mirrors `AppState.uninstall()` step for step. + +**It is signed with the same identity as the app**, in `create-dmg.sh`, so the DMG's notarization +covers it. A `.command` keeps its signature in extended attributes, which both the copy and the disk +image preserve. Unsigned, it arrives quarantined and macOS refuses it as coming from an unidentified +developer — and the person meeting that has already trashed the app, so there is no second path to +their volumes. ⚠️ Yes, this is a terminal — it is the one place the no-terminal promise yields, because the alternative is orphaned data with no way to remove it. It is documented on the website, not in the app. diff --git a/scripts/create-dmg.sh b/scripts/create-dmg.sh index 23a5f11..1633ab6 100755 --- a/scripts/create-dmg.sh +++ b/scripts/create-dmg.sh @@ -30,6 +30,17 @@ ln -s /Applications "${STAGE}/Applications" cp "${ROOT}/scripts/uninstall-xbot.command" "${STAGE}/Uninstall xBot.command" chmod +x "${STAGE}/Uninstall xBot.command" +# Signed like anything else that ships, when there is an identity to sign with. +# +# A .command carries its signature in extended attributes rather than inside the file, and both `cp` +# and the disk image preserve those. Unsigned, it arrives quarantined from a download and macOS +# refuses it as coming from an unidentified developer — which, for the person who already trashed +# the app and wants their volumes back, is a dead end with no second path. +if [[ -n "${MACOS_SIGNING_IDENTITY:-}" ]]; then + codesign --force --timestamp --sign "${MACOS_SIGNING_IDENTITY}" \ + "${STAGE}/Uninstall xBot.command" +fi + hdiutil create -volname "${VOLUME}" -srcfolder "${STAGE}" -ov -format UDZO "${DMG}" rm -rf "${STAGE}"