From 7d32974673e78ae680532b196ea2987a90d6bcb3 Mon Sep 17 00:00:00 2001 From: Ethan Dickson Date: Thu, 13 Mar 2025 14:28:06 +1100 Subject: [PATCH 1/3] chore(pkgbuild): delete existing app during preinstall, `spctl --assess` during postinstall --- pkgbuild/scripts/postinstall | 4 ++++ pkgbuild/scripts/preinstall | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/pkgbuild/scripts/postinstall b/pkgbuild/scripts/postinstall index b7dd1bd..5e2320b 100755 --- a/pkgbuild/scripts/postinstall +++ b/pkgbuild/scripts/postinstall @@ -3,6 +3,10 @@ RUNNING_MARKER_FILE="/tmp/coder_desktop_running" VPN_MARKER_FILE="/tmp/coder_vpn_was_running" +# Before this script, or the user opens the app, make sure +# Gatekeeper has ingested the notarization ticket. +spctl -avvv "/Applications/Coder Desktop.app" + # Restart Coder Desktop if it was running before if [ -f "$RUNNING_MARKER_FILE" ]; then echo "Starting Coder Desktop..." diff --git a/pkgbuild/scripts/preinstall b/pkgbuild/scripts/preinstall index 66c54e9..83271f3 100755 --- a/pkgbuild/scripts/preinstall +++ b/pkgbuild/scripts/preinstall @@ -35,4 +35,11 @@ echo "Asking com.coder.Coder-Desktop to quit..." osascript -e 'if app id "com.coder.Coder-Desktop" is running then' -e 'quit app id "com.coder.Coder-Desktop"' -e 'end if' echo "Done." +APP="/Applications/Coder Desktop.app" +if [ -d "$APP" ]; then + echo "Deleting Coder Desktop..." + rm -rf "$APP" + echo "Done." +fi + exit 0 From db36d6d9339a1f7defe303e93929e7756dd6a525 Mon Sep 17 00:00:00 2001 From: Ethan Dickson Date: Thu, 13 Mar 2025 14:36:11 +1100 Subject: [PATCH 2/3] spctl assess extesnsion --- pkgbuild/scripts/postinstall | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgbuild/scripts/postinstall b/pkgbuild/scripts/postinstall index 5e2320b..db35355 100755 --- a/pkgbuild/scripts/postinstall +++ b/pkgbuild/scripts/postinstall @@ -6,6 +6,10 @@ VPN_MARKER_FILE="/tmp/coder_vpn_was_running" # Before this script, or the user opens the app, make sure # Gatekeeper has ingested the notarization ticket. spctl -avvv "/Applications/Coder Desktop.app" +# spctl can't assess non-apps, so this will always return a non-zero exit code, +# but the error message implies at minimum the signature of the extension was +# checked. +spctl -avvv "/Applications/Coder Desktop.app/Contents/Library/SystemExtensions/com.coder.Coder-Desktop.VPN.systemextension" || true # Restart Coder Desktop if it was running before if [ -f "$RUNNING_MARKER_FILE" ]; then From 5c1ba7709541c958cba1a0e3278abe1a104e8c82 Mon Sep 17 00:00:00 2001 From: Ethan Dickson Date: Thu, 13 Mar 2025 14:36:52 +1100 Subject: [PATCH 3/3] typo --- pkgbuild/scripts/postinstall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgbuild/scripts/postinstall b/pkgbuild/scripts/postinstall index db35355..8018af9 100755 --- a/pkgbuild/scripts/postinstall +++ b/pkgbuild/scripts/postinstall @@ -3,7 +3,7 @@ RUNNING_MARKER_FILE="/tmp/coder_desktop_running" VPN_MARKER_FILE="/tmp/coder_vpn_was_running" -# Before this script, or the user opens the app, make sure +# Before this script, or the user, opens the app, make sure # Gatekeeper has ingested the notarization ticket. spctl -avvv "/Applications/Coder Desktop.app" # spctl can't assess non-apps, so this will always return a non-zero exit code,