From b3194fdbee8c51fe3cd7231bfa22f016f36573ea Mon Sep 17 00:00:00 2001 From: Vito Van Date: Wed, 7 Aug 2024 17:53:22 +0800 Subject: [PATCH] fix: damaged application on macos-14 arm64 https://www.reddit.com/r/macsysadmin/comments/13vu7f3/app_is_damaged_and_cant_be_opened_error_on_ventura/kh9fpdk/ user has to do `xattr -d com.apple.quarantine /Applications/Calm.app` --- s/usr/macos/bundle.lisp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/s/usr/macos/bundle.lisp b/s/usr/macos/bundle.lisp index 10a84d9..1986077 100644 --- a/s/usr/macos/bundle.lisp +++ b/s/usr/macos/bundle.lisp @@ -5,7 +5,10 @@ (defun make-bundle (app-name bundle-id app-version dist-dir app-icon) (let* ((ori-plist (str:from-file (merge-pathnames "s/usr/macos/app-Info.plist" *calm-env-calm-home*))) - (app-dir (merge-pathnames (str:concat app-name ".app/") *calm-env-app-dir*)) + ;; use --app instead of .app to avoid damaged application bundle on newer version of macOS + (app-dir (merge-pathnames (str:concat app-name "--app/") *calm-env-app-dir*)) + ;; we rename the folder to .app in the end + (final-app-dir (merge-pathnames (str:concat app-name ".app/") *calm-env-app-dir*)) (app-content-dir (merge-pathnames "Contents/" app-dir)) (app-receipt-dir (merge-pathnames "_MASReceipt/" app-content-dir)) (app-resources-dir (merge-pathnames "Resources/" app-content-dir)) @@ -38,7 +41,10 @@ dist-dir-abs app-macos-dir) ;; copy icon - (u:copy-file app-icon-abs (merge-pathnames "icon.icns" app-resources-dir))) + (u:copy-file app-icon-abs (merge-pathnames "icon.icns" app-resources-dir)) + ;; rename app dir + (u:copy-dir app-dir final-app-dir) + (uiop:delete-directory-tree app-dir)) (u:calm-log-fancy "~%Application Bundle created: ~A.app~%" app-name))