You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f27686a
Browse filesBrowse the repository at this point in the historyBrowse files
fix(desktop): install Windows updates without the installer UI (#225)
## Related Issue
No linked issue — reported directly: on Windows, **Restart to update**
opened the installer wizard and asked the user to click through Next /
Next / Install.
## Problem
`installDownloadedUpdateNow()` called `autoUpdater.quitAndInstall()`
with no arguments. In electron-updater 6.8.9 that means `isSilent =
false`, so `NsisUpdater.doInstall` spawns the setup with only
`--updated` — the assisted NSIS installer UI — and relaunch falls to
`autoRunAppAfterInstall` instead of `isForceRunAfter`.
A silent installer also reports nothing back, so an install that does
not take effect would be invisible. The existing startup receipt proved
success only.
## What changed
- **Silent install.** `quitAndInstall(true, true)` →
`Pythinker-x.y.z-x64-Setup.exe --updated /S --force-run`. No window, and
the app relaunches itself. Behaviourally unchanged on macOS:
`MacUpdater.quitAndInstall()` takes no such flags.
- **Failure receipt.** `reconcileStartupReceipt` now returns `{
settings, failedInstallVersion }`. A pending install version that does
not match the running version opens the app in `status: 'error'` with a
message naming both versions; the next check clears it. Success
detection is unchanged.
- **`nsis.allowElevation: false`.** Soft hardening: it stops a normally
launched installer from offering the all-users path, whose per-machine
installs are the only ones that still hit `UAC_RunElevated` on update.
It is not a guarantee — an installer started as Administrator still
offers both modes. A hard per-user policy would need a
`customInstallMode` macro in `build/installer.nsh`, which is a larger
decision and not part of this change.
Verified against the pinned `app-builder-lib` 26.15.3 NSIS templates
rather than documentation: the assisted installer honours `/S` and only
then applies `--force-run` (`installSection.nsh`), the directory the
user chose is read back from the HKCU `InstallLocation` so no `/D=` is
needed (`multiUser.nsh`), and elevation under `/S` is gated on an
existing per-machine installation (`installer.nsi`).
Not changed: `autoDownload` stays `false` and `autoInstallOnAppQuit`
stays `false`. Downloading and installing remain two deliberate user
actions, and closing the app is still not consent to install.
## Checklist
- [x] I have read the
[CONTRIBUTING](https://github.com/PyModel/pythinker-code/blob/main/CONTRIBUTING.md)
document.
- [ ] I have linked a related issue (external PRs: the issue must have a
maintainer's `/approve`).
- [x] I have added tests that prove my feature works.
- [x] Ran `gen-changesets` skill, or this PR needs no changeset.
- [x] Ran `gen-docs` skill, or this PR needs no doc update.
### Tests
`updater.spec.ts` asserted only `toHaveBeenCalledOnce()`, which passes
with or without the flags. Added `toHaveBeenCalledWith(true, true)` —
which also makes the eventual electron-updater v7 migration to `{
isSilent, isForceRunAfter }` explicit — plus two failure-receipt tests,
and flipped the two existing `allowElevation` expectations. Reverting
all three product values fails exactly 4 tests; 172 pass as shipped.
### Still to do
A Windows VM pass: install the current release into a non-default
directory, then update. The invariant is that the app stays at the
previously selected `InstallLocation` with no second installation under
the default per-user Programs directory, and relaunches on its own after
the installer finishes.
0 commit comments