#!/bin/bash # GenMail installer for macOS. Double-click this file to run it. # # Downloads the current build, installs it to /Applications, and launches # it -- a one-click convenience over grabbing the .dmg and dragging it # into Applications yourself. The build is signed with a real Apple # Developer ID certificate and notarized, so Gatekeeper already accepts # it without any quarantine workaround; the `xattr -cr` below is now just # a harmless no-op kept for anyone still running an older, unnotarized # build. Plain, readable bash -- nothing hidden, matches the rest of this # project's source-available approach. set -euo pipefail DMG_URL="https://magicmail.boo/downloads/GenMail_0.1.0_aarch64.dmg" APP_NAME="GenMail.app" INSTALL_DIR="/Applications" TMP_DMG="$(mktemp -t genmail).dmg" cleanup() { if [ -n "${MOUNT_POINT:-}" ] && [ -d "$MOUNT_POINT" ]; then hdiutil detach "$MOUNT_POINT" -quiet -force >/dev/null 2>&1 || true fi rm -f "$TMP_DMG" } trap cleanup EXIT echo "== GenMail installer ==" echo echo "Downloading..." curl -fL --progress-bar "$DMG_URL" -o "$TMP_DMG" echo "Mounting..." MOUNT_POINT="$(hdiutil attach "$TMP_DMG" -nobrowse -readonly | awk -F'\t' '/\/Volumes\// {print $NF; exit}')" if [ -z "$MOUNT_POINT" ] || [ ! -d "$MOUNT_POINT/$APP_NAME" ]; then echo "Couldn't find $APP_NAME in the downloaded disk image." >&2 exit 1 fi echo "Installing to $INSTALL_DIR..." rm -rf "${INSTALL_DIR:?}/$APP_NAME" cp -R "$MOUNT_POINT/$APP_NAME" "$INSTALL_DIR/" echo "Clearing the quarantine flag (this is the actual Gatekeeper fix)..." xattr -cr "$INSTALL_DIR/$APP_NAME" echo echo "Installed. Launching GenMail..." open "$INSTALL_DIR/$APP_NAME"