diff --git a/README.md b/README.md index 6768656..0ed38ec 100644 --- a/README.md +++ b/README.md @@ -91,6 +91,19 @@ Before running the script, install **Python 3.11** or **3.12** from [python.org] The Windows installer will attempt to install Git automatically if it is not already available. It also tries to install Python 3 using `winget`, `choco`, or `scoop` when Python is missing and recognizes the `py` launcher if `python` isn't on your PATH. If these tools are unavailable you'll see a link to download Python directly from . When Python 3.13 or newer is detected without the Microsoft C++ build tools, the installer now attempts to download Python 3.12 automatically so you don't have to compile packages from source. **Note:** If this fallback fails, install Python 3.12 manually or install the [Microsoft Visual C++ Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/) and rerun the installer. +### Uninstall + +Run the matching uninstaller if you need to remove a previous installation or clean up an old `seedpass` command: + +**Linux and macOS:** +```bash +bash -c "$(curl -sSL https://raw.githubusercontent.com/PR0M3TH3AN/SeedPass/main/scripts/uninstall.sh)" +``` + +**Windows (PowerShell):** +```powershell +Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; $scriptContent = (New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/PR0M3TH3AN/SeedPass/main/scripts/uninstall.ps1'); & ([scriptblock]::create($scriptContent)) +``` ### Manual Setup diff --git a/docs/docs/content/index.md b/docs/docs/content/index.md index d9f63c1..81aaab2 100644 --- a/docs/docs/content/index.md +++ b/docs/docs/content/index.md @@ -94,6 +94,20 @@ isn't on your PATH. If these tools are unavailable you'll see a link to download the installer now attempts to download Python 3.12 automatically so you don't have to compile packages from source. **Note:** If this fallback fails, install Python 3.12 manually or install the [Microsoft Visual C++ Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/) and rerun the installer. +### Uninstall + +Run the matching uninstaller if you need to remove a previous installation or clean up an old `seedpass` command: + +**Linux and macOS:** +```bash +bash -c "$(curl -sSL https://raw.githubusercontent.com/PR0M3TH3AN/SeedPass/main/scripts/uninstall.sh)" +``` + +**Windows (PowerShell):** +```powershell +Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; $scriptContent = (New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/PR0M3TH3AN/SeedPass/main/scripts/uninstall.ps1'); & ([scriptblock]::create($scriptContent)) +``` + *Install the beta branch:* ```powershell Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; $scriptContent = (New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/PR0M3TH3AN/SeedPass/main/scripts/install.ps1'); & ([scriptblock]::create($scriptContent)) -Branch beta diff --git a/scripts/uninstall.ps1 b/scripts/uninstall.ps1 new file mode 100644 index 0000000..1eccb40 --- /dev/null +++ b/scripts/uninstall.ps1 @@ -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." + diff --git a/scripts/uninstall.sh b/scripts/uninstall.sh new file mode 100644 index 0000000..d7872b3 --- /dev/null +++ b/scripts/uninstall.sh @@ -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 "$@" +