minutes icon indicating copy to clipboard operation
minutes copied to clipboard

Windows: every published artifact needs the VC++ runtime, none ship it (silent DLL_NOT_FOUND)

Open silverstein opened this issue 3 months ago • 5 comments

Summary

minutes-windows-x64.exe from the v0.24.0 release does not start on a Windows machine that has never had developer tools installed. It exits with 0xC0000135 (STATUS_DLL_NOT_FOUND) and prints nothing at all, so the user sees the command silently do nothing.

Evidence

Tested on a real Windows 11 Enterprise LTSC 2024 (build 26100) VM, x64, with no Visual Studio, no build tools, and no VC++ redistributable:

PS> Test-Path C:\Windows\System32\vcruntime140.dll
False
PS> Test-Path C:\Windows\System32\msvcp140.dll
False

PS> & C:\qa\minutes.exe --version
exit=-1073741515      # 0xC0000135 STATUS_DLL_NOT_FOUND
output=               # empty

The binary was hash-verified against the published asset (b576503487610424d3d7e8c2…) before and after transfer, so this is the shipped artifact rather than a corrupted download.

Its import table names the missing dependencies directly:

VCRUNTIME140.dll
VCRUNTIME140_1.dll
MSVCP140.dll
MSVCP140_1.dll

Those ship in the Microsoft Visual C++ Redistributable, not in Windows. DirectML.dll is also imported but is present in stock Windows 11, so it is not implicated.

Why CI never caught it

GitHub's windows-latest runners have the VC++ redistributable preinstalled, so every build and smoke test passes. The failure only appears on an end-user machine that has never had it. Install CLI (windows-latest) is green today and will stay green.

Impact

Any Windows user who downloads the CLI onto a clean machine gets a silent no-op with no diagnostic. There is no message to search for, which makes it close to unreportable from the user's side. Worth considering how many quiet Windows abandonments this accounts for.

Options

  1. Statically link the CRT — -C target-feature=+crt-static for x86_64-pc-windows-msvc. Self-contained, matches the "single binary" story. Requires the bundled C++ (whisper.cpp/ggml) to be built /MT so the runtimes agree; mismatched CRTs are their own class of bug, so this needs verifying rather than assuming.
  2. Ship the redistributable DLLs beside the exe. App-local deployment is permitted by Microsoft. Changes the CLI download from one file to an archive, which is the same tradeoff #645 raises for sherpa.
  3. Document the prerequisite and have the installer ensure it. Cheapest, but does nothing for the standalone CLI download, which is the path that fails silently.

Option 1 is the only one that keeps a single self-contained binary. Worth checking whether the NSIS desktop installer already installs the redistributable, since the desktop app may be unaffected while the CLI is not.

Relationship to #645

That issue proposes bundling sherpa's DLLs for Windows. This one should be settled first: adding more dynamically-linked dependencies on top of a runtime that is already missing would compound the failure rather than introduce it.

Found using the Windows QA VM rather than CI, because the defect is specifically about what is absent on a clean machine.

silverstein avatar Aug 06 '26 06:08 silverstein

The desktop app is affected too, and the installer does not cover it

Same clean Windows 11 VM, same result for the desktop binary from the v0.24.0 release:

PS> & C:\qa\minutes-app.exe --version
desktop_exit=-1073741515      # 0xC0000135 STATUS_DLL_NOT_FOUND
desktop_output=               # empty

Its import table confirms the same dependency:

MSVCP140.dll
MSVCP140_1.dll

So this is not a CLI packaging oversight. Every Windows artifact we publish requires the Visual C++ Redistributable, and none of them ship or install it.

Why the installer does not save us

tauri/src-tauri/tauri.windows.conf.json:

{
  "bundle": {
    "targets": ["nsis"],
    "windows": {
      "webviewInstallMode": { "type": "downloadBootstrapper", "silent": true },
      "nsis": { "installMode": "currentUser" }
    }
  }
}

WebView2 is handled: missing runtime, bootstrapper downloads it. The VC++ runtime has no equivalent entry. And installMode: currentUser means the installer runs unelevated, so it could not install a machine-wide redistributable even if it tried.

The likely user experience for the desktop app is therefore an install that appears to succeed followed by an application that will not launch, with no message.

Revised scope

artifact needs VC++ runtime ships or installs it
minutes-windows-x64.exe (CLI) yes no
minutes-desktop-windows-x64.exe yes no
minutes-desktop-windows-x64-setup.exe yes no (WebView2 only)

That makes the static-CRT option more attractive than app-local DLLs: one build flag fixes all three, whereas bundling means solving it separately for a bare CLI download and an NSIS installer.

Caveat on this evidence

I ran the raw desktop executable rather than the NSIS installer. A missing DLL aborts before any application code runs, so the exit code is decisive for the binary itself. I have not verified what the installer does end to end, including whether it surfaces any error. Worth doing before deciding the fix, since if the installer already pulls something in, the desktop story may differ from the CLI story.

silverstein avatar Aug 06 '26 06:08 silverstein

Confirmed by controlled experiment, not just inference

Earlier evidence was the import table plus a failure on a machine lacking the runtime. That is strong but circumstantial. The VM now has the redistributable installed, so the same binary can be run with the only variable changed:

VC++ runtime present result
no exit=-1073741515 (0xC0000135), no output
yes exit=0, minutes 0.24.0

Same machine, same binary, same command. Installing the Visual C++ Redistributable is both necessary and sufficient to make the shipped v0.24.0 CLI start.

That closes the diagnosis. What remains is the fix (#659, static CRT) and verifying it on a machine that does not have the runtime, which is what the clean-no-vcredist-2026-08-06 VM snapshot preserves.

Note for anyone reproducing this: the earlier attempt to install the redistributable appeared to fail on its own, but it was blocked by UAC. VirtualBox guestcontrol runs commands with a filtered admin token, so the installer's elevation step died silently at Launching elevated engine process. That was an artefact of the harness rather than anything about the redistributable.

silverstein avatar Aug 06 '26 18:08 silverstein

Direction settled: app-local DLLs, and the cost is under 1 MB

With static linking ruled out by ONNX Runtime (#659), the remaining option is shipping the runtime files beside the executable, which Microsoft permits for these specific DLLs.

Measured the actual payload from the VS 2022 redistributable (VC\Redist\MSVC\14.44.35112\onecore\x64\Microsoft.VC143.CRT):

file bytes
msvcp140.dll 546,312
vcruntime140.dll 113,632
vcruntime140_1.dll 38,368
msvcp140_1.dll 26,088
total 724,400 (~0.7 MB)

Less than the ~1 MB static linking would have added, so size is not an argument against this.

The two artifacts differ in how disruptive it is:

  • Desktop app: the NSIS installer already lays down a directory, so the four files go in beside the executable and nothing changes for the user. No UX cost at all.
  • Standalone CLI: currently a single .exe. Shipping DLLs means the download becomes an archive. That is the only real tradeoff in this issue.

Next step is to verify app-local loading actually works on a machine with no runtime installed, using the clean-no-vcredist-2026-08-06 snapshot, before building any packaging around the assumption. Windows documents the application directory as first in the DLL search order, but that is exactly the kind of thing worth confirming rather than assuming.

silverstein avatar Aug 06 '26 19:08 silverstein

App-local DLLs verified on a clean machine

Reverted the QA VM to clean-no-vcredist-2026-08-06 (confirmed runtime=ABSENT) and ran the released v0.24.0 binary two ways in the same session:

--- CONTROL: bare exe, no DLLs ---
  exit=-1073741515      # 0xC0000135 STATUS_DLL_NOT_FOUND
  out=

--- TEST: exe with the four DLLs beside it ---
  exit=0
  out=minutes 0.24.0

Same binary, same machine, same shell. The only difference is 724 KB of runtime files sitting in the same directory. Windows resolves the application directory ahead of the system path, so the app-local copies satisfy the imports without anything being installed.

That settles the approach. No user action, no separate installer, no admin rights required.

What to build

Desktop app — copy the four DLLs into the NSIS install directory. The installer already lays down a folder, so nothing changes for the user and there is no new download step.

Standalone CLI — the current artifact is a single minutes-windows-x64.exe. It has to become an archive containing the executable plus the four DLLs. That is the only user-visible change in this fix, and it is a fair trade against "currently does not start at all".

Files, from the VS 2022 redistributable (VC\Redist\MSVC\14.44.35112\onecore\x64\Microsoft.VC143.CRT):

msvcp140.dll        546,312
vcruntime140.dll    113,632
vcruntime140_1.dll   38,368
msvcp140_1.dll       26,088
total               724,400

Microsoft permits app-local deployment of these specific files.

Verification requirement for the fix

Whatever the packaging looks like, CI cannot prove it works: every GitHub windows-latest runner has the redistributable installed, so it will pass with or without the DLLs. The check has to run the packaged artifact on a machine that lacks the runtime, which is what the clean-no-vcredist-2026-08-06 snapshot exists for.

Anything less and this regresses silently the moment someone reorganizes the packaging.

silverstein avatar Aug 06 '26 21:08 silverstein

Install path verified end to end on a clean machine

Built the archive exactly as the release workflow will produce it (minutes.exe plus the four DLLs), then ran the same sequence the MCP auto-installer performs on Windows: copy the zip into the install directory, Expand-Archive, delete the archive, run the binary.

On the clean-no-vcredist-2026-08-06 snapshot:

installed_files=5
runtime_installed_systemwide=False
exit=0
out=minutes 0.24.0

Nothing installed system-wide, no admin rights, no separate runtime. This closes the gap noted when #660 merged: the fix was proven, the packaging and extraction were not. Both are now.

Zip is 15.2 MB against the 41.4 MB bare exe, since compression more than covers the 724 KB of added DLLs.

Remaining: the desktop app

The desktop app has the same dependency and is not covered by #660. Notes for whoever picks it up:

Tauri places bundle.resources entries relative to the executable, so a bare filename lands beside the exe, which is where the DLL search order needs them. A subdirectory would not work.

The complication is that resources must exist at build time. Either the four DLLs get committed to the repo, which means Microsoft binaries in git, or CI stages them from the runner's VS redistributable directory before cargo tauri build. The second is cleaner but a missing-resource error would break local dev builds on machines that have not staged them, so the resource entry probably needs to tolerate absence.

I have not tested which of those Tauri actually accepts, and it should be verified on the clean snapshot rather than assumed, exactly as the CLI half was.

silverstein avatar Aug 06 '26 22:08 silverstein