Skip to content

Bundle Visual C++ Redistributable in Windows NSIS installer#11060

Open
JosephMcEvoy wants to merge 1 commit intoEugeny:masterfrom
JosephMcEvoy:fix/bundle-vcredist-in-nsis-installer
Open

Bundle Visual C++ Redistributable in Windows NSIS installer#11060
JosephMcEvoy wants to merge 1 commit intoEugeny:masterfrom
JosephMcEvoy:fix/bundle-vcredist-in-nsis-installer

Conversation

@JosephMcEvoy
Copy link
Copy Markdown

@JosephMcEvoy JosephMcEvoy commented Mar 1, 2026

Summary

On fresh Windows installations without the Visual C++ Redistributable, Tabby shows the splash screen but the terminal never loads. This is because native modules (node-pty) require vcruntime140.dll and msvcp140.dll, which are not bundled with Tabby and not installed by the NSIS installer.

Changes

build/installer.nsh — Added a customInstall macro that:

  1. Checks if vcruntime140.dll exists in the system directory
  2. If missing, extracts and silently installs the bundled VC++ Redistributable
  3. Logs the result via DetailPrint

.github/workflows/build.yml — Added a CI step to download the correct VC++ Redistributable (x64 or arm64 based on build matrix) into the build/ directory before packaging. This makes it available to the NSIS ${BUILD_RESOURCES_DIR} at installer build time.

How it works

  • electron-builder's NSIS integration exposes ${BUILD_RESOURCES_DIR} pointing to the build/ directory
  • The customInstall macro uses the NSIS File directive to embed vc_redist.exe from that directory into the installer
  • At install time, if vcruntime140.dll is already present, the step is skipped entirely (no extraction, no execution)
  • If missing, the redistributable is extracted to $PLUGINSDIR (temp) and run with /install /quiet /norestart
  • The VC++ redistributable installer is idempotent and handles upgrades gracefully

Impact

  • Adds ~14MB to the NSIS installer size (the redistributable binary)
  • No impact on portable builds (zip)
  • No impact on macOS or Linux builds

Test results

All tests run on fresh Windows 11 VMs (Vagrant + Hyper-V, gusztavvargadr/windows-11 box) with no prior software installed.

Baseline: official v1.0.230 on fresh Windows 11

The official installer does not install the VC++ Redistributable. On a fresh Windows 11 VM, Electron starts and discovers all 12 plugins, but three plugins with native module dependencies fail to load:

"Could not load ssh: Error: The specified module could not be found."
"Could not load electron: Error: The specified module could not be found."
"Could not load auto-sudo-password: Error: The specified module could not be found."

Without the electron and ssh plugins, the terminal cannot function. Tabby remains stuck on the splash screen indefinitely:

=== Pre-install VC++ Check ===
vcruntime140.dll present: False

=== Post-install VC++ Check ===
vcruntime140.dll present: False

=== Process status ===
Process alive (PID: 5924)
  Process: Tabby PID=672  CPU=0.2 Handles=387 WS=54MB  Title=''
  Process: Tabby PID=2108 CPU=0   Handles=197 WS=30MB  Title=''
  Process: Tabby PID=4516 CPU=1   Handles=338 WS=223MB Title=''
  Process: Tabby PID=5916 CPU=0   Handles=337 WS=51MB  Title=''
  Process: Tabby PID=5924 CPU=0.6 Handles=756 WS=124MB Title=''

All processes alive but no window title — splash screen only, no terminal.

With this PR: custom build on fresh Windows 11

=== Pre-install VC++ Check ===
vcruntime140.dll present: False
VC++ registry key:

=== Installing Tabby ===

=== Post-install VC++ Check ===
vcruntime140.dll present: True
msvcp140.dll present: True
VC++ registry Installed: 1

=== Plugin Check ===
tabby-auto-sudo-password: dist=True
tabby-community-color-schemes: dist=True
tabby-core: dist=True
tabby-electron: dist=True
tabby-linkifier: dist=True
tabby-local: dist=True
tabby-plugin-manager: dist=True
tabby-serial: dist=True
tabby-settings: dist=True
tabby-ssh: dist=True
tabby-telnet: dist=True
tabby-terminal: dist=True

=== Launch Test ===
SUCCESS - Tabby is running (PID: 6656)

The NSIS macro detected the missing VC++ runtime, installed it silently during setup, and Tabby launched successfully.

Test checklist

  • Build Windows x64 NSIS installer and verify vc_redist.exe is embedded (installer size increased from ~127MB to ~152MB)
  • Install on a fresh Windows 11 VM without VC++ Redistributable — VC++ auto-installed, Tabby launches successfully
  • Install on a system with VC++ already present — redistributable step is skipped
  • Baseline: confirmed official v1.0.230 fails on fresh Windows 11 — native plugin modules can't load without VC++ runtime
  • Build Windows arm64 NSIS installer and verify correct arm64 redistributable is bundled

Related issues

Fixes #10734, #10782, #10450, #10284

On fresh Windows installations without the VC++ Redistributable,
Tabby shows the splash screen but the terminal never loads because
native modules (node-pty) require vcruntime140.dll and msvcp140.dll.

The NSIS installer now checks for vcruntime140.dll at install time
and silently installs the VC++ Redistributable if missing. The CI
workflow downloads the appropriate redistributable (x64 or arm64)
before building.

Fixes Eugeny#10734, Eugeny#10782, Eugeny#10450, Eugeny#10284
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.

Windows 11- After Installing Tabby, it gets stuck in the loading screen due to Microsoft Visual C++ Redistributable not being present in the machine.

1 participant