Repository navigation
OriginRouter CLI v0.4.6
OriginRouter CLI v0.4.6
English
This patch fixes two Windows service regressions in v0.4.5: a persistent blank Windows Terminal window at login, and reinstall failures that incorrectly reported an exiting daemon as still running.
- Launch the scheduled daemon through the Windows Script Host GUI host, hiding PowerShell before Windows creates its console. Explicitly select JScript so custom
.jsfile associations do not affect startup. - Wait for the daemon's process handle to signal exit before completing stop, reinstall, or restart. Preserve unrelated Node processes and report a genuine termination failure.
- Stop the previous service before npm replaces loaded native modules. Apply this to the Windows installer and CLI updater; the installer can recover older broken CLI versions without calling their service commands.
- Show Windows service command errors as readable UTF-8 text, without a long encoded command or PowerShell progress XML.
- Synchronize the package and website PowerShell installers.
Validation: full macOS test suite; real Windows 11 / PowerShell 5.1 tests covering ordinary-user reinstall, repeated stop/start/restart, failed-start cleanup, delayed process termination, actual launcher exit codes and logs, npm replacement, repeat installation, and fresh CLI/task installation. All five installation checks pass. Desktop window enumeration confirms service startup adds no visible terminal window. After a real reboot and login, the daemon starts automatically, all five checks pass, and the desktop has zero visible terminal windows.
After publishing the npm package and deploying the website script, run in Windows PowerShell:
irm https://originrouter.com/install.ps1 | iexExisting tasks are replaced automatically; no manual uninstall is required.
中文
本次修复 v0.4.5 的两个 Windows 服务问题:登录后空白终端常驻任务栏,以及重装时把正在退出的 daemon 误报为仍在运行。
- 计划任务改由 Windows Script Host 的 GUI 入口启动,在创建 PowerShell 控制台前隐藏窗口;显式指定 JScript,避免
.js默认打开方式影响服务启动。 - 停止、重装和重启服务时,等待 daemon 的进程句柄确认退出;保留其他 Node 程序,无法终止时明确报错。
- Windows 安装脚本及 CLI 更新器在 npm 替换本机模块之前先停止旧服务,避免旧包目录残留。安装脚本不调用旧版 CLI 的服务命令,也能恢复旧版停止逻辑有问题的安装。
- 服务命令报错改为可读的 UTF-8 文本,不再输出很长的编码命令或 PowerShell 进度 XML。
- npm 包及官网 PowerShell 安装脚本保持同步。
验证:macOS 完整测试;Windows 11 / PowerShell 5.1 真机验证普通权限重装、重复停止/启动/重启、启动失败清理、延迟退出、启动入口日志及退出码、npm 覆盖安装、重复安装、卸载 CLI 和任务后重新安装。安装验证五项全绿,实际桌面窗口枚举确认启动服务不会增加可见终端窗口。电脑实际重启并登录后,daemon 自动启动,五项检查全绿,可见终端窗口为零。
发布 npm 包并部署官网脚本后,在 Windows PowerShell 执行:
irm https://originrouter.com/install.ps1 | iex旧计划任务会自动替换,无需手动卸载。