From 8737905e93f9c983715dc89f98186224f8c8ec81 Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Thu, 7 Aug 2025 13:10:11 -0400 Subject: [PATCH] feat: make GUI install optional on Windows --- README.md | 6 +++++- scripts/install.ps1 | 24 ++++++++++++++++++------ 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 163fe7c..0abe272 100644 --- a/README.md +++ b/README.md @@ -118,7 +118,7 @@ See `docs/ARCHITECTURE.md` and [Nostr Setup](docs/nostr_setup.md) for details. ### Quick Installer Use the automated installer to download SeedPass and its dependencies in one step. -The scripts also install the correct BeeWare backend for your platform automatically. +The scripts can also install the BeeWare backend for your platform when requested (use `-IncludeGui` on Windows). If the GTK `gi` bindings are missing, the installer attempts to install the necessary system packages using `apt`, `yum`, `pacman`, or Homebrew. @@ -136,6 +136,10 @@ Make sure the command ends right after `-b beta` with **no trailing parenthesis* ```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)) ``` +*Install with the optional GUI:* +```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)) -IncludeGui +``` Before running the script, install **Python 3.11** or **3.12** from [python.org](https://www.python.org/downloads/windows/) and tick **"Add Python to PATH"**. You should also install the [Visual Studio Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/) with the **C++ build tools** workload so dependencies compile correctly. 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. diff --git a/scripts/install.ps1 b/scripts/install.ps1 index 91b389f..1cadfeb 100644 --- a/scripts/install.ps1 +++ b/scripts/install.ps1 @@ -2,10 +2,12 @@ # SeedPass Universal Installer for Windows # # Supports installing from a specific branch using the -Branch parameter. -# Example: .\install.ps1 -Branch beta +# Use -IncludeGui to install the optional BeeWare GUI backend. +# Example: .\install.ps1 -Branch beta -IncludeGui param( - [string]$Branch = "main" # The git branch to install from + [string]$Branch = "main", # The git branch to install from + [switch]$IncludeGui # Install BeeWare GUI components ) # --- Configuration --- @@ -255,14 +257,24 @@ if ($LASTEXITCODE -ne 0) { Write-Error "Dependency installation failed." } -& "$VenvDir\Scripts\python.exe" -m pip install -e .[gui] +if ($IncludeGui) { + & "$VenvDir\Scripts\python.exe" -m pip install -e .[gui] +} else { + & "$VenvDir\Scripts\python.exe" -m pip install -e . +} if ($LASTEXITCODE -ne 0) { Write-Error "Failed to install SeedPass package" } -Write-Info "Installing BeeWare GUI backend..." -& "$VenvDir\Scripts\python.exe" -m pip install toga-winforms -if ($LASTEXITCODE -ne 0) { Write-Warning "Failed to install GUI backend" } +if ($IncludeGui) { + Write-Info "Installing BeeWare GUI backend..." + try { + & "$VenvDir\Scripts\python.exe" -m pip install toga-winforms + if ($LASTEXITCODE -ne 0) { throw "toga-winforms installation failed" } + } catch { + Write-Warning "Failed to install GUI backend. Install Microsoft C++ Build Tools from https://visualstudio.microsoft.com/visual-cpp-build-tools/ and rerun the installer." + } +} # 5. Create launcher script Write-Info "Creating launcher script..."