A tiny, fast launcher for Scoop, the Windows command-line installer. It reads a small .shim file, starts the tool it points to, and stays out of the way.
Four independent implementations -- C#, C++, Rust, and Zig -- with identical behavior.
New-Item -Path test.shim -Value 'path = C:\Windows\System32\calc.exe'
Copy-Item -Path .\cpp\bin\x64\shim.exe -Destination .\test.exe
.\test.exetest.exe reads test.shim from the same directory. The file is found by replacing the executable's extension with .shim, or appending .shim when the name has none.
path = C:\Apps\tool.exe
args = --quiet
env:APP_CACHE_DIR = %~dp0cache
env!:PATH = %PATH%;%~dp0
pathis required.args,cwd, andelevateare optional.env:NAMEsets a default; an external value wins.env?:NAMEis the same form.env!:NAMEforces a value. Use it for PATH changes or deliberate isolation.%~dp0means the shim's directory inpath, and the target's directory elsewhere.
The shim waits for the child and forwards its exit code. See SPEC.md for the full format and rules.
An unpaired shim.exe can report itself:
.\shim.exe --versionshim <version> (<impl>)
Features: cwd env env-force expand dp0 elevate
Only the canonical, unpaired shim.exe answers. A shim with a .shim file passes its arguments to the target.
An installed copy carries the same facts in its version resource, so it can be read without running the target:
(Get-Item .\foo.exe).VersionInfo | Select-Object ProductVersion, Comments| Implementation | impl |
Build Tool | x86 | x64 | arm64 |
|---|---|---|---|---|---|
| C# | cs |
dotnet | 24.5 KB | 24.0 KB | 24.0 KB |
| C++ | cpp |
Zig | 126.5 KB | 150.5 KB | 143.0 KB |
| C++ | cpp |
MSBuild | 129.5 KB | 152.5 KB | 133.0 KB |
| Rust | rust |
Cargo | 118.5 KB | 137.0 KB | 133.0 KB |
| Zig | zig |
Zig | 90.0 KB | 77.5 KB | 27.0 KB |
impl is the token reported by self-description. Sizes are the current build output.
- Specification: SPEC.md
- Design rationale: RATIONALE.md
- Agent workflow: AGENTS.md
- C# developer guide: cs/README.md
- C++ developer guide: cpp/README.md
- Rust developer guide: rust/README.md
- Zig developer guide: zig/README.md
- Test suite: test/run-tests.ps1
- Test guide: test/README.md
- Startup cost: benchmark/README.md
This repository builds on these earlier implementations:
- 71/scoop-better-shimexe -- C implementation that solved Ctrl+C passthrough and dropped the .NET startup cost.
- kiennq/scoop-better-shimexe -- C++ fork of 71's, adding MSBuild support and the
cwdfield to the shim format. - zoritle/rshim -- Rust implementation, memory safety and UTF-8 BOM handling.
- svercl/zshim -- Zig port, showed a shim can be built with no runtime dependency.
This project is dual-licensed under the Unlicense or the MIT License.
You may choose either license.