From f6232a5ca4dbebe51e4ea6d5e3169167c162b31c Mon Sep 17 00:00:00 2001 From: Camila Ayres Date: Wed, 2 Sep 2026 15:05:42 +0200 Subject: [PATCH] fix(osx): refresh stale FinderSync pluginkit registration on install. Existing registration from a previous install is dropped and added again rather than left untouched. pluginkit -a doesn't work when the identifier is already registered, which can leave a stale UUID/path cached in the PlugInKit database after the appex on disk has been replaced by a newer build (e.g. installing over an existing client), causing the FinderSyncBroker to fail to spawn. So the result is a not working Finder extension. Assisted-by: Claude:claude-sonnet-5 Signed-off-by: Camila Ayres --- admin/osx/post_install.sh.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/admin/osx/post_install.sh.cmake b/admin/osx/post_install.sh.cmake index b82ad2f784c2b..610c069b84462 100644 --- a/admin/osx/post_install.sh.cmake +++ b/admin/osx/post_install.sh.cmake @@ -30,6 +30,14 @@ elif [ ! -x "$(command -v pluginkit)" ]; then else echo "$LOG_PREFIX registering extension for user '$CONSOLE_USER' (uid $CONSOLE_UID)" + # Force remove any stale registration first (failure is expected on first install). + run_as_console_user pluginkit -r "$APPEX"; rc=$? + if [ "$rc" -eq 0 ]; then + echo "$LOG_PREFIX pluginkit -r succeeded for $APPEX" + else + echo "$LOG_PREFIX pluginkit -r returned $rc for $APPEX (expected if nothing was registered yet)" + fi + # Add it to the DB. This happens automatically too, but we push a bit harder (#3463). run_as_console_user pluginkit -a "$APPEX"; rc=$? if [ "$rc" -eq 0 ]; then