4 Commits
Author SHA1 Message Date
christianandClaude Opus 5.5 94ec22d466 Release 1.4.38
Installs over the damaged 1.4.35-1.4.37 uninstallers, and ships a valid one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 21:09:32 -04:00
christianandClaude Opus 5.5 e7709e8756 Fix the damaged uninstaller that blocked every update from 1.4.35 on
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 <noreply@anthropic.com>
2026-10-21 21:07:41 -04:00
christianandClaude Opus 5.5 478763c60e Release 1.4.37
The Browser tab, with an installer that closes everything running from the app folder
before copying (the 1.4.36 install stopped at "cannot be closed").

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 20:39:44 -04:00
christianandClaude Opus 5.5 f0af453020 Installer: close everything running from the app's folder before copying
Updating 1.4.35 -> 1.4.36 on the TV stopped at "Bible App cannot be closed. Please
close it manually and click Retry" with the app plainly closed. That message also
comes from the installer's copy step (and from removing the old version) when any
file in the install folder is in use — not only when Bible App.exe is running.

The app runs programs from its own folder: the local AI server (llama-server.exe),
speech (whisper-cli.exe), the upscaler. electron-builder's stock check closes only
Bible App.exe, and when it has to force-close the app, the app's own shutdown (which
stops the AI server) never runs. The orphaned llama-server.exe then holds its files
open forever, so Retry can never succeed.

- build/installer.nsh: customCheckAppRunning replaces the stock check. It asks the
  app to close, force-closes any Bible App.exe left, force-closes the helpers by name,
  then, as a backstop, every process whose executable is inside the install folder
  (via WMI, which works from the 32-bit installer on 64-bit Windows; the folder is
  passed in an environment variable and a bare drive is refused). It runs before the
  old version is removed and before any file is copied.
- main.cjs: the in-app updater stops the AI server before launching the installer.

The fix is in the INSTALLER, so the TV still on 1.4.35 gets it with this release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 20:37:14 -04:00
6 changed files with 91 additions and 1 deletions
+6
View File
@@ -70,6 +70,12 @@ Notes:
for you. The TV's updater compares versions numerically and only offers a HIGHER version. 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, - 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`). `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 - On Windows, if the build fails while extracting `winCodeSign` (symlink / permission errors), run the
terminal as administrator or turn on Developer Mode, delete terminal as administrator or turn on Developer Mode, delete
`%LOCALAPPDATA%\electron-builder\Cache\winCodeSign`, and build again. `%LOCALAPPDATA%\electron-builder\Cache\winCodeSign`, and build again.
+68
View File
@@ -4,3 +4,71 @@
IfFileExists "$INSTDIR\resources\app.asar.unpacked\vendor\redist\vc_redist.x64.exe" 0 +2 IfFileExists "$INSTDIR\resources\app.asar.unpacked\vendor\redist\vc_redist.x64.exe" 0 +2
ExecWait '"$INSTDIR\resources\app.asar.unpacked\vendor\redist\vc_redist.x64.exe" /install /quiet /norestart' $0 ExecWait '"$INSTDIR\resources\app.asar.unpacked\vendor\redist\vc_redist.x64.exe" /install /quiet /norestart' $0
!macroend !macroend
; ---------------------------------------------------------------------------------------------------
; Replaces electron-builder's "is the app running?" check (customCheckAppRunning). Runs at the start of
; installing, BEFORE the old version is removed and before any file is copied.
;
; The stock check only looks for "Bible App.exe". But the app also starts programs from its own folder
; - the local AI server (llama-server.exe), speech (whisper), the upscaler - and if the app is closed
; hard, those are left running. They hold their files open, so copying the new version fails and the
; installer says "Bible App cannot be closed. Please close it manually and click Retry" even though
; the app is plainly closed, and Retry can never succeed. So:
; 1. ask the app to close (it then stops the AI server itself), and give it a moment;
; 2. force-close anything named Bible App.exe that is still there;
; 3. force-close the app's own helper programs by name (plain taskkill, nothing to go wrong);
; 4. as a backstop, force-close EVERY program running from this install folder, whatever its name.
; Step 4 matches by folder, via WMI (works from this 32-bit installer on 64-bit Windows, where a
; 32-bit process cannot read a 64-bit process's path). The folder travels in an environment variable
; so a quote or space in it can never break the command, and it refuses to act on a bare drive.
; No question is asked first: installing this version replaces the app, which is what was asked for.
; ---------------------------------------------------------------------------------------------------
!macro customCheckAppRunning
DetailPrint `Closing "${PRODUCT_NAME}"...`
nsExec::Exec `"$SYSDIR\cmd.exe" /c taskkill /im "${APP_EXECUTABLE_FILENAME}" /fi "USERNAME eq %USERNAME%"`
Pop $0
Sleep 2500
nsExec::Exec `"$SYSDIR\cmd.exe" /c taskkill /f /t /im "${APP_EXECUTABLE_FILENAME}" /fi "USERNAME eq %USERNAME%"`
Pop $0
nsExec::Exec `"$SYSDIR\cmd.exe" /c taskkill /f /t /im llama-server.exe /im whisper-cli.exe /im realesrgan-ncnn-vulkan.exe /fi "USERNAME eq %USERNAME%"`
Pop $0
System::Call 'Kernel32::SetEnvironmentVariable(t "BIBLEAPP_INSTDIR", t "$INSTDIR")'
StrCpy $1 "$SYSDIR\WindowsPowerShell\v1.0\powershell.exe"
${If} ${FileExists} "$WINDIR\Sysnative\WindowsPowerShell\v1.0\powershell.exe"
StrCpy $1 "$WINDIR\Sysnative\WindowsPowerShell\v1.0\powershell.exe"
${EndIf}
StrCpy $2 `"$1" -NoProfile -NonInteractive -ExecutionPolicy Bypass -Command "$$r = $$env:BIBLEAPP_INSTDIR.TrimEnd('\'); if ($$r.Split('\').Count -lt 2) { exit }; $$d = $$r + '\'; Get-CimInstance Win32_Process | Where-Object { $$_.ExecutablePath -and $$_.ExecutablePath.StartsWith($$d, [StringComparison]::OrdinalIgnoreCase) } | ForEach-Object { Stop-Process -Id $$_.ProcessId -Force -ErrorAction SilentlyContinue }"`
DetailPrint `Closing anything else still running from "${PRODUCT_NAME}"'s folder...`
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
Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

+3
View File
@@ -355,6 +355,9 @@ async function createWindow () {
quit: () => { try { app.quit(); } catch (_) {} }, quit: () => { try { app.quit(); } catch (_) {} },
runInstaller: (installerPath) => { runInstaller: (installerPath) => {
// Launch the installer detached, then quit so it can replace the running app. // Launch the installer detached, then quit so it can replace the running app.
// Stop the local AI server FIRST: it runs from the install folder, and one left running holds
// its files open, so the installer cannot copy the new version over them ("cannot be closed").
try { stopLlamaServer(); } catch (_) {}
try { try {
const { spawn } = require('child_process'); const { spawn } = require('child_process');
const child = spawn(installerPath, [], { detached: true, stdio: 'ignore', windowsHide: false }); const child = spawn(installerPath, [], { detached: true, stdio: 'ignore', windowsHide: false });
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "bible-app", "name": "bible-app",
"version": "1.4.36", "version": "1.4.38",
"description": "Minimalist Bible App for Portrait-Oriented Touchscreen TV", "description": "Minimalist Bible App for Portrait-Oriented Touchscreen TV",
"type": "module", "type": "module",
"main": "main.cjs", "main": "main.cjs",
+13
View File
@@ -12,8 +12,14 @@
* - a clean signing environment. There is no code-signing certificate. electron-builder aborts on * - 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 * 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. * 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 { spawnSync } = require('child_process');
const fs = require('fs');
const path = require('path'); const path = require('path');
const env = { ...process.env, CSC_IDENTITY_AUTO_DISCOVERY: 'false' }; 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]; 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 extra = process.argv.slice(2);
const args = ['electron-builder', '--win', '--x64', ...extra]; const args = ['electron-builder', '--win', '--x64', ...extra];