From 89f222747895a45ad09b17036085b6edf647d1e0 Mon Sep 17 00:00:00 2001 From: Web-Benefits <78207756+webenefits@users.noreply.github.com> Date: Fri, 24 Jul 2026 06:43:12 +0200 Subject: [PATCH] fix(uninstall): remove ~/.local/bin launcher wrappers reliably (#569) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit uninstall.sh only removed ~/.local/bin/vocalinux when it was a symlink ([ -L ]), but a repo/dev install writes a real file there, and ~/.local/bin/vocalinux-gui was never removed — both were left behind. - Remove both wrappers via safe_remove in remove_application_files (handles files and symlinks). - safe_remove also handles dangling symlinks (-e follows links and is false for a dead link, so also test -L). - verify_uninstallation checks both wrappers. - Drop the redundant symlink-only block in remove_curl_install_files. Co-authored-by: Alexander --- uninstall.sh | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/uninstall.sh b/uninstall.sh index 459a53a..8b4685f 100755 --- a/uninstall.sh +++ b/uninstall.sh @@ -55,8 +55,10 @@ get_vocalinux_pids() { safe_remove() { local path="$1" local description="$2" - - if [ -e "$path" ]; then + + # -e follows symlinks (false for a broken link), so also test -L to catch + # dangling symlinks left behind by an install. + if [ -e "$path" ] || [ -L "$path" ]; then print_info "Removing $description: $path" rm -rf "$path" && { print_success "Successfully removed $description" @@ -244,12 +246,10 @@ remove_curl_install_files() { # Remove cloned repository safe_remove "$CURL_INSTALL_DIR" "cloned repository" - - # Remove symlink in ~/.local/bin - if [ -L "$CURL_BIN_DIR/vocalinux" ]; then - safe_remove "$CURL_BIN_DIR/vocalinux" "vocalinux symlink" - fi - + + # Launcher scripts/symlinks in ~/.local/bin are removed in + # remove_application_files() (they exist for both curl and repo installs). + # Remove activation script in ~/.local/bin safe_remove "$CURL_BIN_DIR/activate-vocalinux.sh" "activation script in ~/.local/bin" } @@ -258,7 +258,13 @@ remove_curl_install_files() { remove_application_files() { # Remove local activation script (if running from repo) safe_remove "activate-vocalinux.sh" "local activation script" - + + # Remove launcher wrappers in ~/.local/bin created by install.sh. These are + # regular files in a repo/dev install and may be symlinks in a curl install; + # safe_remove handles both (and dangling symlinks). + safe_remove "$CURL_BIN_DIR/vocalinux" "vocalinux launcher script" + safe_remove "$CURL_BIN_DIR/vocalinux-gui" "vocalinux-gui launcher script" + # Remove desktop entry safe_remove "$DESKTOP_DIR/vocalinux.desktop" "desktop entry" @@ -356,11 +362,13 @@ verify_uninstallation() { ((ISSUES++)) fi - # Check if symlink still exists - if [ -L "$CURL_BIN_DIR/vocalinux" ]; then - print_warning "Vocalinux symlink still exists: $CURL_BIN_DIR/vocalinux" - ((ISSUES++)) - fi + # Check if launcher wrappers (files or symlinks) still exist + for launcher in vocalinux vocalinux-gui; do + if [ -e "$CURL_BIN_DIR/$launcher" ] || [ -L "$CURL_BIN_DIR/$launcher" ]; then + print_warning "Launcher script still exists: $CURL_BIN_DIR/$launcher" + ((ISSUES++)) + fi + done # Check if desktop entry still exists if [ -f "$DESKTOP_DIR/vocalinux.desktop" ]; then