Skip to content

fix(windows): remove dead installer code from the shipped binary - #507

Merged
PathGao merged 2 commits into
sftwrdotdev:masterfrom
PathGao:fix/remove-dead-installer-code
Aug 7, 2026
Merged

fix(windows): remove dead installer code from the shipped binary#507
PathGao merged 2 commits into
sftwrdotdev:masterfrom
PathGao:fix/remove-dead-installer-code

Conversation

@PathGao

@PathGao PathGao commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Problem

The code that triggered Trojan:Win32/Wacatac.B!ml was removed in #481, but the setup.exe (NSIS installer) is still being flagged by Windows Defender — see this comment on #466.

Three things that still look like an installer to a behaviour classifier were left in the binary:

  1. forward_legacy_uninstall() — answered --uninstall from pre-2.7 custom installs. The NSIS template writes UninstallString = uninstall.exe unconditionally, and the auto-updater's /UPDATE pass runs Section Install, so every install that has ever updated through 2.7.1 already has the corrected registry entry. The hooks.nsi macro also drops stray --uninstall entries from both hives as a backstop.

  2. is_installer_mode detection — checked for --install or "installer" in the exe name. No shipped artifact has triggered either since build: harden release inputs and isolate test bundles #355 stopped publishing an installer-named file, and fix(windows): remove the bundled installer and uninstaller (#466) #481 removed Installer.svelte, install_app, and the invoke_handler registrations that were the only consumers of the resulting window label.

  3. The "installer" window label in capabilities — a window that no code can create any more.

None of these do anything observable today, but a scanner that reads the file rather than tracing reachability still sees them.

Change

  • Delete forward_legacy_uninstall() and its call site in run()
  • Delete is_installer_mode detection, hardcode label to "main"
  • Delete the is_installer_mode window-sizing block
  • Remove "installer" from capabilities/default.json
  • Update the test that asserts the capability window list

Verification

npm test722 pass / 5 fail (same as master; the 5 are pre-existing Node.js v25 localStorage incompatibility)

PathGao added 2 commits August 7, 2026 14:03
The code that triggered Trojan:Win32/Wacatac.B!ml was removed in sftwrdotdev#481,
but three things that still look like an installer to a behaviour
classifier were left in the binary:

- forward_legacy_uninstall() — answered --uninstall from pre-2.7 custom
  installs.  The NSIS template writes UninstallString = uninstall.exe
  unconditionally, and the auto-updater passes /UPDATE which runs Section
  Install, so every install that has ever updated through 2.7.1 already
  has the corrected registry entry.  The hooks.nsi macro also drops
  stray --uninstall entries from both hives as a backstop.

- is_installer_mode detection — checked for --install or 'installer' in
  the exe name.  No shipped artifact has triggered either since sftwrdotdev#355
  stopped publishing an installer-named file, and sftwrdotdev#481 removed
  Installer.svelte, install_app, and the invoke_handler registrations
  that were the only consumers of the resulting window label.

- The 'installer' window label in capabilities/default.json — window
  that no code can create any more.

None of these do anything observable today, but a scanner that reads the
file rather than tracing reachability still sees them.  Removing them
shrinks the binary by the 55 lines of Rust that remained from the old
custom installer.

Addresses the setup.exe detection reported in sftwrdotdev#466 (comment).
npm audit reports 5 moderate vulnerabilities in mermaid <= 11.16.0:
- GHSA-c4c3-pg64-4m4v (prototype pollution)
- GHSA-6x64-9x62-f2gx (CSS injection)
- GHSA-3rrr-jr9j-h3q3 (prototype pollution)
- GHSA-2v8p-3f2j-5mp7 (infinite loop DoS)
- GHSA-rhh3-jpg6-66xh (DoS)

All fixed in 11.16.1.
@PathGao
PathGao merged commit cd29fd3 into sftwrdotdev:master Aug 7, 2026
4 checks passed
@PathGao
PathGao deleted the fix/remove-dead-installer-code branch August 7, 2026 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant