diff options
| author | Christophe Besson <cbesson@gmail.com> | 2026-09-11 14:17:50 +0200 |
|---|---|---|
| committer | Christophe Besson <cbesson@gmail.com> | 2026-09-11 17:51:51 +0200 |
| commit | bca6fc3f0884fcdb0455b502ee4495b04945baee (patch) | |
| tree | e1535db8371acd833da1147047ec38cec08823a6 /packaging/win/build-win-light.ps1 | |
| parent | 7adbf5163f0193d80bb5578dc875eba811f864bb (diff) | |
| download | meshbay-bca6fc3f0884fcdb0455b502ee4495b04945baee.tar.gz | |
feat(packaging): a Light installer target with no bundled node runtime
MeshBay Light ships the Electron client + UI only -- no PyInstaller node
freeze, no ffmpeg, no service install/autostart. Two standalone
electron-builder configs (Full via package.json's build field, Light via
electron-builder.light.yml passed with --config, which reads only that
file -- confirmed against app-builder-lib's own config loader) rather than
one config branching on a flag.
build-win-common.ps1 holds the steps both orchestrators share (Node check,
npm ci, Electron bump, sync-ui) so build-win.ps1 (Full) and the new
build-win-light.ps1 cannot drift apart; build-win.ps1 is refactored to
dot-source it with no behavior change (rebuilt and diffed byte-identical
output).
installer-light.nsh keeps the one thing Light still needs -- an
unconditional firewall rule, since the client listens too -- and none of
the service-mode/autostart machinery installer.nsh carries, which has
nothing to gate without a bundled node.
dist-light/ (Light's own electron-builder output dir) gets its own
.gitignore line since the bare dist/ rule does not match it.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Diffstat (limited to 'packaging/win/build-win-light.ps1')
| -rw-r--r-- | packaging/win/build-win-light.ps1 | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/packaging/win/build-win-light.ps1 b/packaging/win/build-win-light.ps1 new file mode 100644 index 0000000..5a8a06e --- /dev/null +++ b/packaging/win/build-win-light.ps1 @@ -0,0 +1,85 @@ +<# +.SYNOPSIS + Build the Windows "Light" installer: Electron client + UI only, no + bundled node. + +.DESCRIPTION + The counterpart of build-win.ps1 (Full) for anyone who only wants to + *use* MeshBay -- join groups, chat, browse, download, stream, cast -- + without ever hosting content from this machine. See + C:\Users\admin\devel\light-client.md for the evaluation this + implements: a member never needs a local node to begin with (identity + keys are per node -- the *host's* node, not the joiner's), so Light is + the existing browser-only usage pattern wrapped in the Electron shell, + minus the frozen meshbay-node.exe / ffmpeg / autostart bundle. + + Steps 1-4 are identical to build-win.ps1 (build-win-common.ps1). Step 5, + PyInstaller freezing a node runtime, does not happen at all -- that is + the entire point of this target. Step 6 hands electron-builder a + standalone config (electron-builder.light.yml) instead of package.json's + `build` field: passing --config makes electron-builder read ONLY that + file (see app-builder-lib/out/util/config/load.js's getConfig -- when a + config path is given, package.json's own `build` field is never loaded, + so there is no array-merge ambiguity to worry about between the two + targets' very different extraResources). + + Output: packages/meshbay-client/dist-light/MeshBay Light-Setup-<version>.exe + (a different output directory from Full's dist/, so the two builds never + race on the same files). + +.PARAMETER NoElectronBump + Keep the pinned Electron instead of upgrading to the latest release. +#> +[CmdletBinding()] +param( + [switch]$NoElectronBump +) + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version Latest + +$WinDir = $PSScriptRoot +$Repo = (Resolve-Path (Join-Path $WinDir "..\..")).Path +$Client = Join-Path $Repo "packages\meshbay-client" +$Config = Join-Path $WinDir "electron-builder.light.yml" + +. (Join-Path $WinDir "build-win-common.ps1") + +if (-not (Test-Path $Config)) { throw "missing $Config" } + +# --- 1. Node ------------------------------------------------------------- +Assert-NodeVersion + +Push-Location $Client +try { + # --- 2. deps ------------------------------------------------------ + Invoke-NpmCi + + # --- 3. Electron: build against the latest release -------------- + Invoke-ElectronBump -NoElectronBump:$NoElectronBump -WinDir $WinDir + + # --- 4. UI ----------------------------------------------------- + Invoke-SyncUi + + # --- 5. (no node runtime -- that is what makes this "Light") ----- + + # --- 6. installer --------------------------------------- + Step "electron-builder --win nsis --config electron-builder.light.yml" + & npx electron-builder --win nsis --config $Config + if ($LASTEXITCODE -ne 0) { throw "electron-builder failed" } +} +finally { + Pop-Location +} + +$setup = Get-ChildItem (Join-Path $Client "dist-light") -Filter "*Setup*.exe" -ErrorAction SilentlyContinue | + Sort-Object LastWriteTime | Select-Object -Last 1 +Write-Host "" +if ($setup) { + Write-Host "OK installer: $($setup.FullName)" -ForegroundColor Green + Write-Host (" ({0:N0} MB)" -f ($setup.Length / 1MB)) +} +else { + Write-Host "!! no *Setup*.exe found in $Client\dist-light" -ForegroundColor Red + exit 1 +} |