From e7709e8756c6fd1511675cc77627ed7ae1d945f9 Mon Sep 17 00:00:00 2001 From: christian Date: Wed, 21 Oct 2026 21:07:41 -0400 Subject: [PATCH] Fix the damaged uninstaller that blocked every update from 1.4.35 on MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On the TV the update stopped at "Bible App cannot be closed", and uninstalling from Windows Settings showed "Installer integrity check has failed". The cause is the uninstaller, not anything running. An update runs the PREVIOUS version's uninstaller first. Versions 1.4.35-1.4.37 were built on macOS, where electron-builder can't run NSIS to write the uninstaller and rebuilds it in JavaScript (UninstallerReader) from the installer's stub — without NSIS's icon patch. makensis computes the uninstaller's CRC over the stub WITH the uninstaller icon in it, so whenever the two icons differ the result fails NSIS's integrity check. With no app icon configured, NSIS uses its two different default icons, so every Mac-built uninstaller was damaged. Verified with a reimplementation of NSIS's loadHeaders() check: the shipped installers pass; the captured uninstaller failed (0x4235c8f5 vs stored 0x90f7de2c) and passes with this fix (0xb37e533c). - build/installerIcon.ico: NSIS's own default install icon, so electron-builder uses ONE icon for installer and uninstaller (nothing looks different; the app's icon is unchanged). tools/build-win.cjs refuses to build without it. - build/installer.nsh: for installs of 1.4.35-1.4.37 only, clear the old UninstallString so the damaged uninstaller is not run; the new files are copied over the old ones and a fresh, valid uninstaller is written. Every other version keeps the normal uninstall-then-install path. - BUILD-AND-DEPLOY.md: why the icon file must stay. Co-Authored-By: Claude Opus 5.5 --- BUILD-AND-DEPLOY.md | 6 ++++++ build/installer.nsh | 29 +++++++++++++++++++++++++++++ build/installerIcon.ico | Bin 0 -> 13902 bytes tools/build-win.cjs | 13 +++++++++++++ 4 files changed, 48 insertions(+) create mode 100644 build/installerIcon.ico diff --git a/BUILD-AND-DEPLOY.md b/BUILD-AND-DEPLOY.md index 0bc6e83..eafe674 100644 --- a/BUILD-AND-DEPLOY.md +++ b/BUILD-AND-DEPLOY.md @@ -70,6 +70,12 @@ Notes: for you. The TV's updater compares versions numerically and only offers a HIGHER version. - If `WIN_CSC_LINK` / `CSC_LINK` / `CSC_KEY_PASSWORD` / `CSC_KEYCHAIN` exist in your environment, `build-win.cjs` removes them for the build (electron-builder aborts on an EMPTY `WIN_CSC_LINK`). +- **Keep `build/installerIcon.ico`.** On macOS electron-builder rebuilds the uninstaller in JavaScript + and leaves out NSIS's icon patch; if the installer and uninstaller icons differ, the uninstaller fails + NSIS's integrity check, and that version can then never be updated or uninstalled. This file makes + both use one icon (NSIS's own default, so nothing looks different). `build-win.cjs` refuses to build + without it. Versions 1.4.35–1.4.37 shipped without it; `build/installer.nsh` installs over their + damaged uninstallers instead of running them. - On Windows, if the build fails while extracting `winCodeSign` (symlink / permission errors), run the terminal as administrator or turn on Developer Mode, delete `%LOCALAPPDATA%\electron-builder\Cache\winCodeSign`, and build again. diff --git a/build/installer.nsh b/build/installer.nsh index 98ca94e..1c674c3 100644 --- a/build/installer.nsh +++ b/build/installer.nsh @@ -42,4 +42,33 @@ nsExec::Exec $2 Pop $0 Sleep 1000 + !insertmacro bibleAppSkipDamagedUninstaller SHELL_CONTEXT + !insertmacro bibleAppSkipDamagedUninstaller HKCU +!macroend + +; --------------------------------------------------------------------------------------------------- +; Versions 1.4.35 - 1.4.37 were built on macOS before build/installerIcon.ico existed, and their +; uninstallers are damaged: they fail NSIS's own integrity check ("Installer integrity check has +; failed"). electron-builder rebuilds the uninstaller in JavaScript on macOS and leaves out NSIS's +; icon patch, so whenever the installer and uninstaller icons differ (NSIS's two defaults do), the +; checksum is wrong. An update runs the PREVIOUS version's uninstaller first, so those versions could +; never be updated: the damaged uninstaller fails, and the installer reports "Bible App cannot be +; closed" (it also cannot be uninstalled from Windows Settings). +; +; For exactly those versions, the old uninstaller is not run: its UninstallString is cleared, so +; electron-builder's uninstallOldVersion finds nothing to run, and the new files are copied over the +; old ones. This installer then writes a fresh, valid uninstaller and registry entry. Every other +; version still goes through the normal uninstall-then-install path. +; --------------------------------------------------------------------------------------------------- +!macro bibleAppSkipDamagedUninstaller ROOT + ReadRegStr $3 ${ROOT} "${UNINSTALL_REGISTRY_KEY}" DisplayVersion + ${If} $3 == "1.4.35" + ${OrIf} $3 == "1.4.36" + ${OrIf} $3 == "1.4.37" + DetailPrint `Version $3's uninstaller is damaged; installing over it instead.` + DeleteRegValue ${ROOT} "${UNINSTALL_REGISTRY_KEY}" UninstallString + !ifdef UNINSTALL_REGISTRY_KEY_2 + DeleteRegValue ${ROOT} "${UNINSTALL_REGISTRY_KEY_2}" UninstallString + !endif + ${EndIf} !macroend diff --git a/build/installerIcon.ico b/build/installerIcon.ico new file mode 100644 index 0000000000000000000000000000000000000000..f8fbd5ffa910bd7e090becb3ec78fda3cfa4dd8f GIT binary patch literal 13902 zcmeHtcVJsZw)Y8P2`sR*WtXxK!tT3-fg*e%a$xx z$&%c=+$}d*l1psMvLwqz?lq3%#Mp6Sop-Kmvmp!YKHmHO`^Fy4ojYgdoS8fK&Tr=Y z0M@`dxclzAfeBBo0kENz$*zH0!R!|R@pNzf`sMPmn*eTE$K;pGMYjS>-v;p9b1V5@ z0Yu-sT7Ny5-3;*7W2^G(K}5}@K2CZV9TceKO9656O zXQV6j!K8;;U$blpW6f%GqkI2Jl&(em{y5!gvUVdqkM9C=y^=q+Zxfgw-40HtcY?Xg z9!Pe20%BZuf}8UxI1~IeoQyvWrxGln&F3cQiM$6e?kR|4Z3iBeMa6vyyvTjP3qJ}8 zAr`=kv4JF#4bC_Y-j#x4(EX;!RDiP%6WI#bx zCM0E*Q@goPT2utN`Q?x!se;nN5>Vv(fUGP4YRglgwm<~+k_?a+mw<1BFXUJILq=05 zq)K^^(i#Z?iWK0;DnTR@f>4$T74jqysgj^XD}>C(Tu5&&hqA6b=&t61qM8qirX;AX zO^0*!nV@LN2DMBC?aB=3ZWKYcRsibmY^Xk00Q#0(P;}>lytfQGG?Z`4hjvvZs5>e^ zt0{-J?n>zGs)GL3Oc?B}0PHG+Xr2nfa}*$!NI{sX2Vr&(h_bptnA-&fl{&~P?S-PM zK8pQhn-tQT8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GjXj z?L(No2stUPix+Tg`~vNnW>D5XjXAPWBt8wgMx{;hQ$;6MaVmN1pQe*hXRD)@!^EpH z5;q7X-7VNZGl?x-!zjvY!iIAiB;FdP<&`2XU%s{UOrqav;0!AzsC18#Bv%Z+7Ih z;D#J}@0xMs;stC{jUjP^kT_xZ!W*6#6JLqM3q#_EA@PNfcw}_13OBszfwlD=NPIFB zrYn#*Wk|d`ll}`AX0XRFPWxL8I)-OlN=O!1(R2UZs(vPAuo;gVXJ&oKu8WnHdX3*+ zi+xjL*r}hwz$i5m2MrTNdQ8pk!Ya7|*~x0;3e^~&)`{gc1|*&uHnt3*nD%1{sX8Q1 z6Y|C9O!}GU(%ol3;xrjO0wU9zXLvRicBiDc_@f`fU(6UV&w@ zy+&|#b%@D6| zDYmH;^Y!#D(08Go-aF02Aibl*I61xi-km=`Mf-wL)Dixys8brllX7P~gJXmxrDa=& zhld~hH)_9E%$!@1y^j?Z6m9kM4G%eMjBSR~m``hAlds zvAsiQlquVm((|hp{h|buuKw(bgydAK*4EbN=$r5}cfQMWqO-H}>B2(E)`)PftG!ED z_Gzc^#*?m5+EYGpJ!b-v`#gdLJs$pvS{D{a=^GrIlq^U))gYI@_CM|O_XgmG%e#h4_0IZYJ mu_hDU==gw%@IMTz^`umn;#vc>NoTHi(J|>Ne+N;z7XKSu^X9ey literal 0 HcmV?d00001 diff --git a/tools/build-win.cjs b/tools/build-win.cjs index 54c2a13..b22118d 100644 --- a/tools/build-win.cjs +++ b/tools/build-win.cjs @@ -12,8 +12,14 @@ * - a clean signing environment. There is no code-signing certificate. electron-builder aborts on * an EMPTY WIN_CSC_LINK ("Env WIN_CSC_LINK is not correct"), so those variables are removed * rather than blanked, and identity auto-discovery is turned off. + * - a working uninstaller. On macOS electron-builder rebuilds the NSIS uninstaller in JavaScript and + * skips NSIS's icon patch, so unless the installer and uninstaller use the SAME icon the uninstaller + * fails NSIS's integrity check — and then that version can never be updated or uninstalled + * (1.4.35-1.4.37 shipped like that). build/installerIcon.ico makes electron-builder use one icon for + * both, so this refuses to build without it. */ const { spawnSync } = require('child_process'); +const fs = require('fs'); const path = require('path'); const env = { ...process.env, CSC_IDENTITY_AUTO_DISCOVERY: 'false' }; @@ -21,6 +27,13 @@ for (const key of ['CSC_LINK', 'WIN_CSC_LINK', 'CSC_KEY_PASSWORD', 'WIN_CSC_KEY_ delete env[key]; } +const ICON = path.join(__dirname, '..', 'build', 'installerIcon.ico'); +if (!fs.existsSync(ICON)) { + console.error('build/installerIcon.ico is missing. Without it the uninstaller built on macOS is damaged'); + console.error('("Installer integrity check has failed") and the version could never be updated. See tools/build-win.cjs.'); + process.exit(1); +} + const extra = process.argv.slice(2); const args = ['electron-builder', '--win', '--x64', ...extra];