Appearance
Single Executable Distribution
@valoranchi/riot-client can be built and distributed as a standalone Windows executable (riotclient-win-x64.exe) requiring no installed Node.js runtime, npm dependencies, or environment configuration.
Building the Executable
Run the build script from the root of lib/:
bash
npm run exeThe build script automates the full Node.js Single Executable Application (SEA) pipeline:
- Compile TypeScript: Compiles the codebase using
tsctodist/. - Bundle with esbuild: Bundles
dist/bin.jsand all dependencies (includingundici) into a single self-contained CommonJS file (dist/bundle.cjs). - Generate SEA Blob: Runs
node --experimental-sea-config sea-config.jsonto produce the SEA bytecode preparation blob (dist/sea-prep.blob). - Copy Host Node Binary: Copies the host Node binary (
process.execPath) torelease/riotclient-win-x64.exe. - Inject with postject: Uses
postjectto inject the SEA blob into the PE executable with fuseNODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2.
The final output is saved to:
release/riotclient-win-x64.exeRunning the Executable
The standalone binary supports all CLI commands and options:
powershell
# Check version
.\release\riotclient-win-x64.exe --version
# Inspect authenticated player
.\release\riotclient-win-x64.exe whoami
# Stream live match events
.\release\riotclient-win-x64.exe watch-match
# Run the HTTP integration server
.\release\riotclient-win-x64.exe serve --port 47800Windows Binary Signing Caveat
WARNING
Official Node.js binaries for Windows are digitally signed by the Node.js Foundation.
When postject injects the SEA preparation blob into the resource section of node.exe, the executable's original digital signature is modified, causing Windows to detect the signature as corrupted (warning: The signature seems corrupted!).
Recommended Mitigation
Remove Existing Signature: If the Windows SDK is installed, remove the original signature using Microsoft's
signtool:powershellsigntool remove /s release\riotclient-win-x64.exeThe
npm run exescript automatically attempts this step ifsigntoolis available in yourPATH.Re-sign with Your Certificate: For commercial or widespread distribution, sign the final executable with your own Authenticode code-signing certificate:
powershellsigntool sign /fd SHA256 /a /tr http://timestamp.digicert.com /td SHA256 release\riotclient-win-x64.exeRunning Without Signing: The binary executes normally in developer consoles, automation scripts, and CI runners without re-signing. Windows SmartScreen may present a warning dialog ("Unknown Publisher") on interactive desktop launches until signed.
Automated CI Releases
The .github/workflows/release.yml workflow includes an automated build-exe job running on windows-latest. Whenever a new version is released, the workflow builds riotclient-win-x64.exe and attaches it directly to the GitHub Release assets.