Skip to content

Commit 2389fd8

Browse files
authored
ci: WoA NSIS install smoke tests and remove resedit afterPack hook (#557)
* chore: remove resedit longPathAware Windows afterPack hook - Drop electron-builder afterPack, mesh-client-long-path.manifest.xml, and the resedit devDependency; packaged apps use stock Electron PEs. - Simplify verify-win-packaging to existence/size checks only (no PE parse). - Rename packaging contract test to windows-packaging.contract.test.ts and assert afterPack/resedit are absent; remove troubleshooting longPathAware bullet. longPathAware did not help pnpm build paths and PE rewrites did not fix WoA NSIS installs; removing the hook reduces packaging risk with no loss to split x64/arm64 NSIS artifacts. * chore: bump deps * ci: add WoA NSIS install smoke tests and diagnostics - Add test-win-nsis-install.mjs for silent x64/arm64 install checks with NSIS /LOG= output and optional 7z probe to isolate extract vs copy. - Run x64 install on windows-latest after dist:win; arm64 repro on windows-11-arm from build artifacts in build and release workflows. - Add NSIS customFinish guard (resources/installer.nsh) when Mesh-client.exe is missing after install. - Expand WoA troubleshooting with install log, Event Viewer, and policy steps. - Bump electron-builder to ^26.15.4 and extend packaging contract tests. WoA users report partial NSIS installs; CI now reproduces install on native ARM and captures logs before we apply a targeted NSIS fix.
1 parent 0186397 commit 2389fd8

13 files changed

Lines changed: 418 additions & 207 deletions

.github/workflows/build.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,20 @@ jobs:
6868
- name: Build
6969
run: ${{ matrix.build_script }}
7070

71+
- name: Smoke test x64 NSIS install
72+
if: matrix.os == 'windows-latest'
73+
run: node scripts/test-win-nsis-install.mjs --arch x64
74+
75+
- name: Upload Windows install failure logs
76+
if: failure() && matrix.os == 'windows-latest'
77+
uses: actions/upload-artifact@v7
78+
with:
79+
name: mesh-client-win-x64-install-logs-${{ github.sha }}
80+
path: |
81+
${{ runner.temp }}/mesh-client-install-x64.log
82+
if-no-files-found: ignore
83+
retention-days: 7
84+
7185
- name: Upload macOS Artifact
7286
if: matrix.os == 'macos-latest'
7387
uses: actions/upload-artifact@v7
@@ -104,3 +118,33 @@ jobs:
104118
# Per-arch NSIS installers: Mesh-client Setup {version}.exe + {version}-arm64.exe
105119
release/*.exe
106120
retention-days: 30
121+
122+
win-arm64-install:
123+
name: Smoke test arm64 NSIS install (WoA)
124+
needs: build
125+
runs-on: windows-11-arm
126+
permissions:
127+
contents: read
128+
steps:
129+
- name: Checkout code
130+
uses: actions/checkout@v6
131+
132+
- name: Download Windows build artifact
133+
uses: actions/download-artifact@v7
134+
with:
135+
name: mesh-client-windows-${{ github.sha }}
136+
path: release
137+
138+
- name: Smoke test arm64 NSIS install (7z probe + install)
139+
run: node scripts/test-win-nsis-install.mjs --arch arm64 --probe-7z
140+
141+
- name: Upload arm64 install failure logs
142+
if: failure()
143+
uses: actions/upload-artifact@v7
144+
with:
145+
name: mesh-client-win-arm64-install-logs-${{ github.sha }}
146+
path: |
147+
${{ runner.temp }}/mesh-client-install-arm64.log
148+
${{ runner.temp }}/mesh-client-7z-probe/**
149+
if-no-files-found: ignore
150+
retention-days: 7

.github/workflows/release.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,20 @@ jobs:
6363
# dist:*:publish scripts run electron-builder with --publish always
6464
run: ${{ matrix.build_script }}
6565

66+
- name: Smoke test x64 NSIS install
67+
if: matrix.os == 'windows-latest'
68+
run: node scripts/test-win-nsis-install.mjs --arch x64
69+
70+
- name: Upload Windows install failure logs
71+
if: failure() && matrix.os == 'windows-latest'
72+
uses: actions/upload-artifact@v7
73+
with:
74+
name: mesh-client-win-x64-install-logs-${{ github.sha }}
75+
path: |
76+
${{ runner.temp }}/mesh-client-install-x64.log
77+
if-no-files-found: ignore
78+
retention-days: 7
79+
6680
# Keep artificates for 30 days when we manually build
6781
- name: Upload macOS Artifact
6882
if: matrix.os == 'macos-latest'
@@ -107,3 +121,33 @@ jobs:
107121
release/win-arm64-unpacked/**/*
108122
release/win-x64-unpacked/**/*
109123
retention-days: 30
124+
125+
win-arm64-install:
126+
name: Smoke test arm64 NSIS install (WoA)
127+
needs: release
128+
runs-on: windows-11-arm
129+
permissions:
130+
contents: read
131+
steps:
132+
- name: Checkout code
133+
uses: actions/checkout@v6
134+
135+
- name: Download Windows build artifact
136+
uses: actions/download-artifact@v7
137+
with:
138+
name: mesh-client-windows-${{ github.sha }}
139+
path: release
140+
141+
- name: Smoke test arm64 NSIS install (7z probe + install)
142+
run: node scripts/test-win-nsis-install.mjs --arch arm64 --probe-7z
143+
144+
- name: Upload arm64 install failure logs
145+
if: failure()
146+
uses: actions/upload-artifact@v7
147+
with:
148+
name: mesh-client-win-arm64-install-logs-${{ github.sha }}
149+
path: |
150+
${{ runner.temp }}/mesh-client-install-arm64.log
151+
${{ runner.temp }}/mesh-client-7z-probe/**
152+
if-no-files-found: ignore
153+
retention-days: 7

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ patches/
1919
*.desktop
2020
*.metainfo.xml
2121
resources/win/*.xml
22+
*.nsh
2223

2324
# CodeQL MaD — Prettier line-wrap breaks yamllint indentation for barrier tuples
2425
.github/codeql/extensions/**/*.yml

docs/troubleshooting.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,34 @@ See [development-environment.md](development-environment.md) for OS-specific pre
1616

1717
**Cause**
1818

19-
Older releases shipped a **universal** NSIS installer (x64 + arm64 in one `.exe`). On **native Windows 11 ARM**, that installer can partially extract support files while failing to copy the main executable.
19+
On **native Windows 11 ARM**, the arm64 NSIS installer can partially extract support files while failing to copy the main executable. CI builds the exe correctly (it is inside the installer's `app-arm64.7z`); the failure happens at **install time**, not during packaging.
20+
21+
Older releases also shipped a **universal** NSIS installer (x64 + arm64 in one `.exe`), which made arch selection worse — use the split **`-arm64.exe`** installer on WoA hardware.
2022

2123
**Fix**
2224

2325
1. Delete the broken install folder: `%LOCALAPPDATA%\Programs\Mesh-client\`
2426
2. Download the **arm64** installer from [GitHub Releases](https://github.com/Colorado-Mesh/mesh-client/releases): `Mesh-client Setup {version}-arm64.exe` (not the x64-only `Mesh-client Setup {version}.exe`).
2527
3. Re-run the installer. Confirm `Mesh-client.exe` exists in the install folder and the app appears in **Installed apps**.
2628

29+
**Diagnostic checklist (if the exe is still missing)**
30+
31+
Capture this before opening a GitHub issue — it helps isolate NSIS extract vs copy vs policy blocks:
32+
33+
1. **NSIS install log** — run the installer from Command Prompt or PowerShell with logging:
34+
```bat
35+
"Mesh-client Setup {version}-arm64.exe" /LOG=%USERPROFILE%\Desktop\mesh-install.log
36+
```
37+
After failure, open `mesh-install.log` and search for `Mesh-client.exe`, `CopyFiles`, or `error`.
38+
2. **Event Viewer****Windows Logs → Application** during the install window; note any errors from `MsiInstaller`, `Application Error`, or antivirus agents.
39+
3. **Controlled folder access****Windows Security → Virus & threat protection → Ransomware protection**; if enabled, try temporarily allowing the installer or install to a short path such as `C:\mc-test` (see step 5).
40+
4. **Install path** — confirm `%LOCALAPPDATA%` is on a local NTFS volume, not OneDrive-redirected or sync-rooted.
41+
5. **Custom install directory** — test a short path:
42+
```bat
43+
"Mesh-client Setup {version}-arm64.exe" /D=C:\mc-test /LOG=%USERPROFILE%\Desktop\mesh-install.log
44+
```
45+
6. **Clean tree** — ensure no leftover `Mesh-client` folder or running `Mesh-client.exe` from a prior partial install before re-running the installer.
46+
2747
**Workaround before a fixed release**
2848

2949
Download a CI or release artifact's `win-arm64-unpacked` folder and run `Mesh-client.exe` directly (portable, no installer).
@@ -319,7 +339,6 @@ CI builds avoid both issues by using short paths and clean agents; local Windows
319339
2. **Enable long paths in Git** (helps clones/checkouts): `git config --global core.longpaths true`, then re-clone or ensure no stuck long paths in the worktree.
320340
3. **Enable Win32 long paths in Windows** (Windows 10 1607+): this option is **not** available as a normal toggle in **Settings**; enable it via **Local Group Policy**_Computer Configuration → Administrative Templates → System → Filesystem → Enable Win32 long paths_, or set the registry DWORD **`LongPathsEnabled = 1`** under `HKLM\SYSTEM\CurrentControlSet\Control\FileSystem` (admin rights; reboot may be required). See [Microsoft: Maximum Path Length Limitation](https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation).
321341
4. **`pnpm run dist:win`** already runs a **hoisted** `pnpm install` to shorten `node_modules` depth before packaging; if **`pnpm install`** / **`pnpm run rebuild`** fails earlier with this error, try the short path and long-path OS settings first, or temporarily: `pnpm install --config.node-linker=hoisted` from a short root path.
322-
5. **Packaged app (`dist:win`)**: the build embeds a Windows application manifest with **`longPathAware`** so the installed **Mesh-client.exe** can use long paths when the machine has long paths enabled (registry / policy). That helps **runtime** paths inside the app; it does **not** shorten **`node_modules`** during **`pnpm install`** on the build machine—CI and developers still benefit from short clone paths for native rebuilds.
323342

324343
### Database schema newer than this app (downgrade blocked)
325344

electron-builder.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
appId: com.mesh-client.app
22
productName: Mesh-client
3-
afterPack: scripts/electron-builder-after-pack.cjs
43
directories:
54
buildResources: resources
65
output: release
@@ -77,3 +76,4 @@ win:
7776
icon: resources/icons/win/colorado-mesh.ico
7877
nsis:
7978
buildUniversalInstaller: false
79+
include: resources/installer.nsh

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,9 @@
131131
"@typescript-eslint/parser": "^8.61.1",
132132
"@vitejs/plugin-react": "^6.0.2",
133133
"@vitest/coverage-v8": "^4.1.9",
134-
"concurrently": "^9.2.1",
134+
"concurrently": "^9.2.3",
135135
"electron": "^41.8.0",
136-
"electron-builder": "^26.15.3",
136+
"electron-builder": "^26.15.4",
137137
"esbuild": "^0.28.1",
138138
"eslint": "^10.5.0",
139139
"eslint-config-prettier": "^10.1.8",
@@ -158,7 +158,6 @@
158158
"react-dom": "^19.2.7",
159159
"react-leaflet": "^5.0.0",
160160
"recharts": "^3.8.1",
161-
"resedit": "^1.7.2",
162161
"sort-package-json": "^3.7.1",
163162
"tailwindcss": "^4.3.1",
164163
"typescript": "^6.0.3",

0 commit comments

Comments
 (0)