fix: Fix uninstall failure on permission-protected files (#89)#90
Open
LouXiaXiaoHei wants to merge 1 commit into
Open
fix: Fix uninstall failure on permission-protected files (#89)#90LouXiaXiaoHei wants to merge 1 commit into
LouXiaXiaoHei wants to merge 1 commit into
Conversation
When uninstalling an app, Finder AppleScript deletion would fail on permission-protected files with only a "Grant Full Disk Access" message. Now failed files are retried with administrator privileges (matching the orphan deletion pattern), and apps whose .app bundle is successfully deleted are removed from the installed apps list. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
darkbringer1
approved these changes
May 12, 2026
| Logger.shared.log("Attempting admin-privileged removal for \(failedURLs.count) files", level: .info) | ||
| DispatchQueue.global(qos: .userInitiated).async { | ||
| let adminSuccess = self.removeWithAdminPrivileges(failedURLs) | ||
| DispatchQueue.main.async { |
There was a problem hiding this comment.
Suggested change
| DispatchQueue.main.async { | |
| DispatchQueue.main.async { [weak self] in | |
| guard let self else { return } |
| } | ||
| } | ||
|
|
||
| func removeSelectedFiles() { |
There was a problem hiding this comment.
if this method is called multiple times back to back, there is a race condition might happen. A flag like a isLoading/isDeleting can be kept in class level to prevent race conditions. Also a loading indicator might be used from here as well. Flag might be used to block/disable the button or show a loading indicator.
darkbringer1
suggested changes
May 12, 2026
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.
What does this PR do?
Fixes #89.
When uninstalling an app, deletion through Finder AppleScript could fail on permission-protected files and only show a "Grant Full Disk Access" message.
This PR adds a fallback retry using administrator privileges when Finder AppleScript deletion fails, matching the existing orphan deletion behavior.
It also removes the app from the installed apps list when the main
.appbundle has been successfully deleted, even if some protected related files fail to delete.Type of change
Testing
Screenshots
Not applicable.