Conversation
Every post-install failure was reported as "the privileged helper appears to not be installed", with no indication of the cause. - Keep the underlying reason in postInstallStepsNotPerformed and show it in the alert (unless the user declined to install the helper). - SMJobBless returns before launchd starts the helper, and the version check ran once right away, so a slow start looked like a failed install. Retry the check a few times, stopping if cancelled. - If the helper still can't be reached after installing, say so and name the likely cause: the app and helper are signed by different teams (e.g. a local build next to a helper from the released app). SMJobBless's invalid-signature error gets a similar explanation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CFErrorDomainLaunchd error 4 (kSMErrorAuthorizationFailure) was shown raw as "The operation couldn't be completed. (CFErrorDomainLaunchd.4)". It means macOS didn't authorize the install, e.g. the administrator prompt was cancelled, so say that and how to retry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Compare against the launchd error domain string instead of the deprecated kSMErrorDomainLaunchd constant. - Mark the helper error strings as manually managed in the string catalog, like the other keys only used through localizeString, so Xcode doesn't flag them as stale. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
After consenting to install the privileged helper, users could get:
with no indication of why. Three changes:
performPostInstallStepsAsyncreplaced every failure with this generic message. The underlying reason is now carried inpostInstallStepsNotPerformed(..., reason:)and appended to the alert (not when the user simply declined).SMJobBlessreturns before launchd has started the job, and the version check ran immediately once, so a slow start was reported as "not installed". The check now retries a few times (500 ms apart) and stops if the task is cancelled.HelperClientError.unreachableAfterInstallexplaining the likely cause: the app and helper are signed by different teams (the helper'sSMAuthorizedClientsrejects the app, e.g. a local development build next to a helper installed by the released app).SMJobBless'skSMErrorInvalidSignaturegets a similar explanation, andkSMErrorAuthorizationFailure(shown raw as "CFErrorDomainLaunchd.4" before) explains that macOS didn't authorize the install, e.g. the administrator prompt was cancelled.New strings:
HelperClient.error.AuthorizationFailed,HelperClient.error.InvalidSignature,HelperClient.error.UnreachableAfterInstall(English only for now).Tests
test_InstallHelper_RetriesUntilNewlyInstalledHelperAnswerstest_InstallHelper_ThrowsWithReasonWhenInstalledHelperIsUnreachabletest_PostInstallStepsError_IncludesUnderlyingReason🤖 Generated with Claude Code