Skip to content

fix(installer): install VC++ runtime when missing#303

Merged
lstein merged 1 commit into
masterfrom
lstein/fix/windows-vcredist
Jun 7, 2026
Merged

fix(installer): install VC++ runtime when missing#303
lstein merged 1 commit into
masterfrom
lstein/fix/windows-vcredist

Conversation

@lstein
Copy link
Copy Markdown
Owner

@lstein lstein commented Jun 7, 2026

Problem

On a clean Windows 10 VM, the launcher installed fine but crashed at first launch:

OSError: [WinError 126] ... Error loading "...\torch\lib\c10.dll" or one of its dependencies.

PyTorch's c10.dll depends on the Microsoft Visual C++ runtime (vcruntime140.dll, msvcp140.dll), which isn't present on a fresh Windows install. The old windows.ps1 installer used to download vc_redist; the new Inno installer didn't.

Fix

  • Bundle vc_redist.x64.exe in the Inno installer and run it silently only when the runtime is absent — detected via the VC++ 2015–2022 x64 registry key (HKLM64). Machines that already have it (the majority) see no extra prompt; clean machines get one UAC prompt for the (inherently machine-wide) runtime.
  • CI downloads vc_redist.x64.exe and passes it to ISCC via /DVCRedist.

Notes

  • Adds ~25 MB to the Windows installer.
  • macOS/Linux unaffected. The PyPI/uv tool path is unchanged (power users provide their own runtime).

🤖 Generated with Claude Code

PyTorch's c10.dll needs the MSVC runtime; on a clean Windows machine torch import fails with WinError 126. Bundle vc_redist.x64.exe in the Inno installer and run it silently only when the runtime is absent (registry check via HKLM64), matching what the old windows.ps1 used to do.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@lstein lstein merged commit b15a150 into master Jun 7, 2026
9 checks passed
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