Add uninstall scripts for all platforms

This commit is contained in:
thePR0M3TH3AN
2025-07-11 09:37:07 -04:00
parent e8e7e67fc3
commit a32bfd4523
4 changed files with 113 additions and 0 deletions

41
scripts/uninstall.ps1 Normal file
View File

@@ -0,0 +1,41 @@
#
# SeedPass Uninstaller for Windows
#
# Removes the SeedPass application files but preserves user data under ~/.seedpass
$AppRootDir = Join-Path $env:USERPROFILE ".seedpass"
$InstallDir = Join-Path $AppRootDir "app"
$LauncherDir = Join-Path $InstallDir "bin"
$LauncherName = "seedpass.cmd"
function Write-Info { param([string]$Message) Write-Host "[INFO] $Message" -ForegroundColor Cyan }
function Write-Success { param([string]$Message) Write-Host "[SUCCESS] $Message" -ForegroundColor Green }
function Write-Warning { param([string]$Message) Write-Host "[WARNING] $Message" -ForegroundColor Yellow }
function Write-Error { param([string]$Message) Write-Host "[ERROR] $Message" -ForegroundColor Red }
Write-Info "Removing SeedPass installation..."
if (Test-Path $InstallDir) {
Remove-Item -Recurse -Force $InstallDir
Write-Info "Deleted '$InstallDir'"
} else {
Write-Info "Installation directory not found."
}
$LauncherPath = Join-Path $LauncherDir $LauncherName
if (Test-Path $LauncherPath) {
Remove-Item -Force $LauncherPath
Write-Info "Removed launcher '$LauncherPath'"
} else {
Write-Info "Launcher not found."
}
Write-Info "Attempting to uninstall any global 'seedpass' package with pip..."
try {
pip uninstall -y seedpass | Out-Null
} catch {
try { pip3 uninstall -y seedpass | Out-Null } catch {}
}
Write-Success "SeedPass uninstalled. User data under '$AppRootDir' was left intact."

45
scripts/uninstall.sh Normal file
View File

@@ -0,0 +1,45 @@
#!/bin/bash
#
# SeedPass Uninstaller for Linux and macOS
#
# Removes the SeedPass application files but preserves user data under ~/.seedpass
set -e
APP_ROOT_DIR="$HOME/.seedpass"
INSTALL_DIR="$APP_ROOT_DIR/app"
LAUNCHER_PATH="$HOME/.local/bin/seedpass"
print_info() { echo -e "\033[1;34m[INFO]\033[0m $1"; }
print_success() { echo -e "\033[1;32m[SUCCESS]\033[0m $1"; }
print_warning() { echo -e "\033[1;33m[WARNING]\033[0m $1"; }
print_error() { echo -e "\033[1;31m[ERROR]\033[0m $1"; }
main() {
if [ -d "$INSTALL_DIR" ]; then
print_info "Removing installation directory '$INSTALL_DIR'..."
rm -rf "$INSTALL_DIR"
else
print_info "Installation directory not found."
fi
if [ -f "$LAUNCHER_PATH" ]; then
print_info "Removing launcher script '$LAUNCHER_PATH'..."
rm -f "$LAUNCHER_PATH"
else
print_info "Launcher script not found."
fi
print_info "Attempting to uninstall any global 'seedpass' package with pip..."
if command -v pip &> /dev/null; then
pip uninstall -y seedpass >/dev/null 2>&1 || true
elif command -v pip3 &> /dev/null; then
pip3 uninstall -y seedpass >/dev/null 2>&1 || true
fi
print_success "SeedPass uninstalled."
print_warning "User data in '$APP_ROOT_DIR' was left intact."
}
main "$@"