Skip to content

fix: handle Windows service install paths#27

Draft
joeynyc wants to merge 1 commit into
cosmicstack-labs:mainfrom
joeynyc:fix/windows-service-install
Draft

fix: handle Windows service install paths#27
joeynyc wants to merge 1 commit into
cosmicstack-labs:mainfrom
joeynyc:fix/windows-service-install

Conversation

@joeynyc
Copy link
Copy Markdown

@joeynyc joeynyc commented Apr 30, 2026

Summary

  • Fix Windows Task Scheduler service install by passing schtasks arguments via execFileSync instead of a composed cmd.exe string.
  • Use the current CLI entrypoint as the service script path instead of constructing a nested lib/node_modules/... path.
  • Stop reporting a successful Windows service install when schtasks /create fails.
  • Add tests for installed entrypoint path handling and Windows task command construction.

Root cause

The Windows install path was fragile in two ways: paths containing spaces were interpolated into a shell command string for schtasks, and getDistPath() could turn an already-valid dist/index.js entrypoint into a non-existent nested npm global path.

Fixes #13.

Validation

  • npm test -- src/cli/service.test.ts
  • npm run typecheck
  • npm test
  • npm run build

@joeynyc joeynyc changed the title [codex] fix Windows service install fix: handle Windows service install paths Apr 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Service cannot be installed in Windows

1 participant