Skip to content

Commit 4b9c103

Browse files
snomiaoclaude
andcommitted
fix(windows-release): bundle sherpa-rs runtime DLLs in zip + installer
The Windows zip and NSIS installer previously shipped only clx.exe + clx-screen-reader.exe. clx.exe depends on sherpa-onnx-c-api.dll, onnxruntime.dll, onnxruntime_providers_shared.dll and cargs.dll, all of which sherpa-rs's build.rs drops into rs/target/release/. Without them, clx.exe fails at launch with STATUS_DLL_NOT_FOUND (0xC0000135) and no stdout/stderr — leaving users with a silently-broken download. - release-rust.yml: copy *.dll from rs/target/release/ into both the zip staging dir and the NSIS staging dir. Fail the build if no DLLs are found (guards against sherpa-rs build.rs regressions). - installer.nsi: File "*.dll" to include every staged runtime DLL, and matching Delete "*.dll" in uninstall. Verified on a Windows 10 22H2 box: dropping sherpa-onnx v1.10.34 shared DLLs next to clx.exe lets the process start cleanly in session 1. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent f8d215f commit 4b9c103

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

.github/workflows/release-rust.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,13 @@ jobs:
6363
New-Item -ItemType Directory -Force -Path $STAGE
6464
Copy-Item rs\target\release\clx-rust.exe "$STAGE\clx.exe"
6565
Copy-Item rs\target\release\clx-screen-reader.exe "$STAGE\clx-screen-reader.exe"
66+
# Runtime DLLs (sherpa-onnx-c-api.dll, onnxruntime.dll, etc.) are
67+
# dropped by sherpa-rs's build.rs into target/release. Without these
68+
# clx.exe fails with STATUS_DLL_NOT_FOUND (0xC0000135) at launch.
69+
$dlls = Get-ChildItem rs\target\release -Filter *.dll -ErrorAction SilentlyContinue
70+
if (-not $dlls) { throw "No DLLs found in rs\target\release — sherpa-rs build.rs may have failed" }
71+
foreach ($d in $dlls) { Copy-Item $d.FullName "$STAGE\" }
72+
Write-Host "Bundled DLLs: $($dlls.Name -join ', ')"
6673
Copy-Item scripts\install.ps1 "$STAGE\install.ps1"
6774
@"
6875
`$InstallDir = "`$env:LOCALAPPDATA\CapsLockX"
@@ -79,9 +86,13 @@ jobs:
7986
- name: Build NSIS setup.exe
8087
shell: pwsh
8188
run: |
82-
# Stage binaries next to .nsi file (NSIS resolves File relative to script)
89+
# Stage binaries + runtime DLLs next to .nsi (NSIS File resolves
90+
# relative to script dir)
8391
Copy-Item rs\target\release\clx-rust.exe scripts\clx.exe
8492
Copy-Item rs\target\release\clx-screen-reader.exe scripts\clx-screen-reader.exe
93+
Get-ChildItem rs\target\release -Filter *.dll | ForEach-Object {
94+
Copy-Item $_.FullName "scripts\"
95+
}
8596
# Install NSIS + EnVar plugin
8697
choco install nsis -y --no-progress
8798
$NSIS_DIR = "C:\Program Files (x86)\NSIS"

scripts/installer.nsi

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ Section "Install"
3838
; Copy files
3939
File "clx.exe"
4040
File "clx-screen-reader.exe"
41+
; sherpa-rs runtime DLLs (required — clx.exe fails with 0xC0000135 without
42+
; them). CI stages *.dll from rs/target/release/ next to this .nsi before
43+
; calling makensis, so the wildcard picks up sherpa-onnx-c-api.dll,
44+
; onnxruntime.dll, onnxruntime_providers_shared.dll, cargs.dll, etc.
45+
File "*.dll"
4146

4247
; Create uninstaller
4348
WriteUninstaller "$INSTDIR\uninstall.exe"
@@ -76,6 +81,7 @@ Section "Uninstall"
7681
; Remove files
7782
Delete "$INSTDIR\clx.exe"
7883
Delete "$INSTDIR\clx-screen-reader.exe"
84+
Delete "$INSTDIR\*.dll"
7985
Delete "$INSTDIR\uninstall.exe"
8086
RMDir "$INSTDIR"
8187

0 commit comments

Comments
 (0)