From 980bbcd3c3fae2dd9ce4ab5fe41f8d3386ce04b2 Mon Sep 17 00:00:00 2001 From: tw93 Date: Thu, 26 Feb 2026 11:47:46 +0800 Subject: [PATCH] fix(uninstall): improve LaunchServices path detection for macOS 14+ - Add fallback paths for lsregister tool - Check executable permission before using path --- lib/uninstall/batch.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/uninstall/batch.sh b/lib/uninstall/batch.sh index 138d815..a7a298a 100755 --- a/lib/uninstall/batch.sh +++ b/lib/uninstall/batch.sh @@ -12,7 +12,19 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" # Batch uninstall with a single confirmation. get_lsregister_path() { - echo "/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister" + local -a candidates=( + "/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister" + "/System/Library/CoreServices/Frameworks/LaunchServices.framework/Support/lsregister" + ) + local candidate="" + for candidate in "${candidates[@]}"; do + if [[ -x "$candidate" ]]; then + echo "$candidate" + return 0 + fi + done + echo "" + return 0 } # High-performance sensitive data detection (pure Bash, no subprocess)