Skip to content

Commit 5062fc7

Browse files
committed
Prepare Windows in-app updater debug release path.
Document the zip-sidecar troubleshooting flow, add a quick menu action to open updater data/log storage, and bump the app version for reproducible update testing. Made-with: Cursor
1 parent 76e17ed commit 5062fc7

File tree

6 files changed

+73
-4
lines changed

6 files changed

+73
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ All core materials are available publicly for currently active https://www.hyper
2424
- [`api`](./api) - backend API handlers and server-side endpoints.
2525
- [`blockchain`](./blockchain) - TON/blockchain interaction logic and related helpers.
2626
- [`telegram`](./telegram) - Telegram-specific integration utilities and adapters.
27-
- [`windows`](./windows) - Electron desktop shell, NSIS installer config, and auto-update flow.
27+
- [`windows`](./windows) - Electron desktop shell, NSIS installer config, and auto-update flow. Troubleshooting in-app updates: [texts/windows-in-app-updater-debug.md](./texts/windows-in-app-updater-debug.md).
2828
- [`scripts`](./scripts) - developer/ops scripts (local run, migration, release helpers).
2929
- [`docs`](./docs) - project and operational documentation (architecture, releases, security reference, tooling).
3030
- [`research`](./research) - exploratory notes, investigations, and proposals not yet promoted to `docs/`.

backlogs/short_term_backlog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
Home on Windowd did not display after the update
12
Login screen
23
Dealing with pool count
34
Updates on launch test

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"url": "https://github.com/HyperlinksSpace/HyperlinksSpaceProgram.git"
1717
},
1818
"main": "index.js",
19-
"version": "53.0.1391",
19+
"version": "53.0.1392",
2020
"type": "module",
2121
"engines": {
2222
"node": ">=18 <=22"
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Windows in-app updater: debugging failed “quick update”
2+
3+
The packaged Windows app uses a **custom zip sidecar** path in `windows/build.cjs`. The in-app **“Update with reload”** flow stages a **portable ZIP** from GitHub, unpacks it under user data, then applies it with a helper script. It does **not** use the NSIS `.exe` download from `electron-updater`’s `update-downloaded` event on Windows (that event is ignored when the zip path is active).
4+
5+
If the UI still behaves like an old build after you used the updater dialog, use the sections below.
6+
7+
## 1. Log and data locations (on your PC)
8+
9+
All paths are under Electron **`app.getPath("userData")`**. On Windows this is usually:
10+
11+
`%APPDATA%\<app-specific folder>\`
12+
13+
For this product, the folder name typically matches the install branding (e.g. **Hyperlinks Space Program**). Exact path: use **Updates → Open update data folder…** in the app menu (opens the folder in Explorer).
14+
15+
| File / folder | Purpose |
16+
|---------------|---------|
17+
| **`main.log`** | General main-process log; lines tagged **`[updater:…]`** mirror structured updater diagnostics. |
18+
| **`hsp-update-apply.log`** | Append-only log when you click **Update with reload** and the staged zip apply runs (spawn, plan, errors). |
19+
| **`pending-update-versions\`** | Staged unpacked builds per version (`<version>\extract\…`). If a version folder exists with a valid main `.exe`, the dialog can offer install. |
20+
| **`%TEMP%\hsp-update-plan-*.json`** | Short-lived apply plan (timestamped). |
21+
| **`%TEMP%\hsp-apply-versions-*.ps1`** | Short-lived PowerShell helper for apply. |
22+
| **`%TEMP%\hsp-apply-trace.log`** | Launcher trace written before the inner apply script runs. |
23+
24+
The **Updater** window also shows a rolling activity log (last lines only); for deep investigation, prefer **`main.log`** and **`hsp-update-apply.log`**.
25+
26+
### What to search for in `main.log`
27+
28+
- `[updater:prepare] FAILED` — zip download, verify, or unpack failed.
29+
- `update-downloaded: ignored on Windows` — expected: NSIS installer finished downloading but Windows uses the zip pipeline instead.
30+
- `requestInstallNow blocked: no staged build` — UI offered reload before staging completed, or staging was cleared; check `pending-update-versions` and zip assets on GitHub.
31+
32+
## 2. GitHub release assets (maintainers)
33+
34+
The sidecar resolver (`resolveWindowsZipSidecarMeta` in `windows/build.cjs`) expects:
35+
36+
1. **`latest.yml`** — on the release (electron-updater feed; gives the target version).
37+
2. **Portable zip** whose name matches the convention: **`<productSlug>_<version>.zip`** (e.g. `HyperlinksSpaceProgram_1.2.3.zip`). The slug comes from `package.json` `build.productName` (spaces removed); see `windows/product-brand.cjs` (`portableZipPrefix`).
38+
3. **`zip-latest.yml`** (optional but recommended) — produced by the Windows cleanup script; includes **`sha512`** for the zip so the client can verify before unpack.
39+
40+
Repository used for the feed: **`HyperlinksSpace/HyperlinksSpaceProgram`** (see `UPDATE_GITHUB_OWNER` / `UPDATE_GITHUB_REPO` in `windows/build.cjs`).
41+
42+
If **`zip-latest.yml`** is missing or incomplete, the client falls back to **`latest.yml` + inferred zip name** (`<portableZipPrefix><version>.zip`). If that zip is missing or 404, prepare fails and the old build keeps running.
43+
44+
## 3. When a full `.exe` installer fixes it
45+
46+
Installing from a **new NSIS `.exe`** replaces the whole install tree. That bypasses any broken zip staging or apply step, which is why “download new installer” can succeed when the inner dialog did not fully apply an update.
47+
48+
## 4. Related code
49+
50+
- `windows/build.cjs``setupAutoUpdater`, `tryBeginVersionsPrepare`, `requestInstallNow`, `applyVersionsStagedUpdate`.
51+
- `windows/cleanup.cjs` — generating **`zip-latest.yml`** for releases.

windows/build.cjs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const {
99
ipcMain,
1010
nativeImage,
1111
nativeTheme,
12+
shell,
1213
} = require("electron");
1314

1415
/** Must match package.json `build.appId`. Call synchronously before `ready` on Windows (Electron + shell taskbar expectations). */
@@ -1831,6 +1832,22 @@ function setupAppMenu() {
18311832
}
18321833
},
18331834
},
1835+
{ type: "separator" },
1836+
{
1837+
label: "Open update data folder…",
1838+
click: () => {
1839+
const dir = app.getPath("userData");
1840+
void shell.openPath(dir).then((err) => {
1841+
if (err) {
1842+
void dialog.showMessageBox({
1843+
type: "error",
1844+
title: "Could not open folder",
1845+
message: err,
1846+
});
1847+
}
1848+
});
1849+
},
1850+
},
18341851
],
18351852
},
18361853
];

0 commit comments

Comments
 (0)