1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
|
<#
.SYNOPSIS
Build the Windows installer: Electron client + bundled Python node.
.DESCRIPTION
The Windows counterpart of packaging/build/build-client.sh. Produces a
single per-user NSIS installer (MeshBay-Setup-<version>.exe) that lays down
the Electron app and, beside it under resources/node-runtime/, the frozen
meshbay-node daemon. No hub -- a desktop machine installs client + node
(+ common, which is inside the node runtime).
This is the "Full" target. See build-win-light.ps1 for "Light" (client +
UI only, no bundled node) -- steps 1-4 below live in build-win-common.ps1,
shared by both, so they cannot drift apart.
Steps:
1. Node >= 22 check
2. npm ci (+ approve Electron's install script, download Chromium)
3. bump Electron to the latest release (Chromium CVE policy -- see
build-client.sh; skip with -NoElectronBump)
4. npm run sync-ui (copy the interface from the hub package)
5. build-node-runtime.ps1 (PyInstaller freeze of the daemon) -- Light
skips this step entirely, which is the whole difference
6. electron-builder --win nsis
.PARAMETER SkipFfmpeg
Passed through to build-node-runtime.ps1 -- skip bundling ffmpeg (fetched
and verified by default; see fetch-ffmpeg.ps1). Smaller, streaming-less
build for local iteration only.
.PARAMETER NoElectronBump
Keep the pinned Electron instead of upgrading to the latest release.
.PARAMETER SkipNodeRuntime
Reuse an existing packages/meshbay-client/node-runtime/ (faster iteration
on the electron-builder side).
#>
[CmdletBinding()]
param(
[switch]$SkipFfmpeg,
[switch]$NoElectronBump,
[switch]$SkipNodeRuntime
)
$ErrorActionPreference = "Stop"
Set-StrictMode -Version Latest
$WinDir = $PSScriptRoot
$Repo = (Resolve-Path (Join-Path $WinDir "..\..")).Path
$Client = Join-Path $Repo "packages\meshbay-client"
. (Join-Path $WinDir "build-win-common.ps1")
# --- 1. Node -------------------------------------------------------------
Assert-NodeVersion
Push-Location $Client
try {
# --- 2. deps ------------------------------------------------------
Invoke-NpmCi
# --- 3. Electron: build against the latest release --------------
# Writes package.json + package-lock.json when it bumps something, so the
# build leaves the repo dirty on purpose -- commit the new pin.
Invoke-ElectronBump -NoElectronBump:$NoElectronBump -WinDir $WinDir
# --- 4. UI -----------------------------------------------------
Invoke-SyncUi
# --- 5. node runtime ---------------------------------------
$rtExe = Join-Path $Client "node-runtime\meshbay-node.exe"
if ($SkipNodeRuntime -and (Test-Path $rtExe)) {
Step "reusing existing node-runtime/"
} else {
Step "building the bundled node (PyInstaller)"
$rtArgs = @{}
if ($SkipFfmpeg) { $rtArgs["SkipFfmpeg"] = $true }
& (Join-Path $WinDir "build-node-runtime.ps1") @rtArgs
if ($LASTEXITCODE -ne 0) { throw "build-node-runtime.ps1 failed" }
}
# --- 6. installer ---------------------------------------
Step "electron-builder --win nsis"
& npx electron-builder --win nsis
if ($LASTEXITCODE -ne 0) { throw "electron-builder failed" }
}
finally {
Pop-Location
}
$setup = Get-ChildItem (Join-Path $Client "dist") -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" -ForegroundColor Red
exit 1
}
|