All notable changes to node-winsvc are documented here. The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Hardening pass based on the production pattern used by integrador-entregas
and api-datos.
-
doctorcommand — diagnoses config, core binary, Node, script and working directory before installing. Exits non-zero so installers can abort. -
pingsubcommand in the Rust core — dependency check used bydoctor. -
SCM failure actions — Windows restarts the supervisor after 1 min, 1 min, then 5 min, resetting after a healthy day.
SERVICE_CONFIG_FAILURE_ACTIONS_FLAGis enabled so a non-zero exit counts as a failure, not just a crash. -
Monthly log rotation with UTF-8 BOM —
logs/servicio-AAAA-MM.log. The file is picked per written line, so it rotates even if the child runs for months. The BOM keeps accents readable in PowerShell 5.1 and Notepad. -
Child output captured line by line — two threads pump the child's stdout and stderr into the supervisor log, with lifecycle events (spawn, exit code, restart, stop) recorded around them.
-
instalar-servicio.cmd— self-elevating double-click installer that checks everything before registering anything. -
docs/ARQUITECTURA.md— the two-level supervisor explained, decision by decision. -
api-logistica/— a real Node.js + SQL Server API used as the end-to-end test bed, installable as a service with a double click. -
Built-in installer wizard —
installernow ships its own Win32 wizard (node-winsvc-setup.exe, ~1 MB) with the app appended to it, so no Inno Setup is needed. Turquoise sidebar with step list, owner-drawn buttons, embedded icon.--innostill uses Inno Setup if preferred. Packaging is TAR + solid zstd: 28 MB for a 7,900-file app withnode.exebundled, against 45 MB with per-file ZIP compression and 26 MB for Inno. -
installercommand — builds a Windows installer wizard (.exe) straight fromwinsvc.config.json. Declareinstaller.promptsand the wizard asks for them, writes them to a.env, runsinstaller.verifyScript, and registers the service only if verification passes. Bundlesnode_modules, so the target server needs no internet. Compiles with Inno Setup if installed; otherwise it writes the.issfor you to compile elsewhere.--no-compileskips the build. As far as we could tell, no other npm package in this category generates its own installer. -
installer.bundleNode— shipsnode.exeinside the installer (vendor/node.exe), which the service prefers over the system Node. The target server then needs nothing installed, and the Node version is pinned. ~6 MB → ~26 MB. -
Windows Event Log — the supervisor now reports start, stop, child crash and startup failures to the Application log, where a sysadmin looks first. This was the last feature
node-windowshad that we lacked. -
Real PID and uptime in
status— viaQueryServiceStatusEx. Uptime falls back to a startup marker whenOpenProcessis denied, so reading the status no longer needs elevation at all (statusnow opens the SCM withSC_MANAGER_CONNECTinstead ofSC_MANAGER_ALL_ACCESS). -
Test suite — 20 Jest tests covering config parsing/defaults and installer script generation.
nodeArgsstarting with-brokeinstall. With"nodeArgs": ["--expose-gc"], clap parsed the value as its own flag and died withunexpected argument '--expose-gc' found. Fixed withallow_hyphen_valueson--node-argsand--env.- The binary was not self-contained. Added
rust/.cargo/config.tomlwith+crt-static. Without it the build silently produced an exe depending on VCRUNTIME140.dll, which fails to start on a clean server with an error message that does not say why. Verify withgrep -a -c VCRUNTIME140 rust/target/release/node-winsvc-core.exe→ must be 0.
0.1.1 - 2026-06-23
restartcommand — stops and starts the service in one step.logscommand — prints the tail of the service log file. Supports-f/--followto stream new output and-n <N>to set how many lines to show (default 50).
0.1.0 - 2026-06-23
First public release. 🎉
- Native Windows service registration via the Win32 Service Control Manager
API (
CreateServiceW/DeleteService/StartServiceW/ControlService/QueryServiceStatus) — no NSSM, no VBScript, no external dependencies. - Service host mode (
run): the bundled Rust binary acts as the service process itself (StartServiceCtrlDispatcherW+ServiceMain), supervising the Node.js child process, reporting status to Windows, and auto-restarting it on crash whenautoRestartis enabled. - CLI commands:
init,install,uninstall,start,stop,status. - Config file
winsvc.config.json: name, displayName, description, script, nodeArgs, env, autoRestart, startType, logFile, workingDirectory. - Env injection, working directory, and log redirection for the hosted app.
- TypeScript CLI (clean-code layered) + Rust core, shipped together; the Rust
binary (
node-winsvc-core.exe) is bundled inside the npm package.
- Windows only.
install/uninstall/start/stop/statusrequire Administrator privileges (enforced by the Service Control Manager).