Skip to content

fix(windows): remove the service on uninstall even if it is stopped - #28

Merged
dkmstr merged 1 commit into
masterfrom
fix/windows-uninstall-leaves-service
Sep 2, 2026
Merged

fix(windows): remove the service on uninstall even if it is stopped#28
dkmstr merged 1 commit into
masterfrom
fix/windows-uninstall-leaves-service

Conversation

@dkmstr

@dkmstr dkmstr commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

unregister() aborted before DeleteService whenever ControlService(STOP) returned an error, and an already stopped service returns ERROR_SERVICE_NOT_ACTIVE, so the service stayed registered after uninstalling. A missing service is now a no-op, a failed stop only logs a warning and the removal goes on, and the wait for the stopped state is bounded to 30 seconds instead of looping forever.

Installing on top of a 4.x actor also left its service behind, showing two UDS services on the machine, so both --install and --uninstall now remove the 4.x service names as well.

Service name, display name and description move to consts, the service dispatcher no longer registers itself as "RustExampleService", and --install/--uninstall exit with 0 on success instead of always 1.

The sample NSIS scripts referenced udsactor_service.exe and udsactor_config.exe, but the binaries ship with a hyphen, so neither the service install nor its removal ever ran from them.

unregister() aborted before DeleteService whenever ControlService(STOP)
returned an error, and an already stopped service returns
ERROR_SERVICE_NOT_ACTIVE, so the service stayed registered after
uninstalling. A missing service is now a no-op, a failed stop only logs a
warning and the removal goes on, and the wait for the stopped state is
bounded to 30 seconds instead of looping forever.

Installing on top of a 4.x actor also left its service behind, showing two
UDS services on the machine, so both --install and --uninstall now remove
the 4.x service names as well.

Service name, display name and description move to consts, the service
dispatcher no longer registers itself as "RustExampleService", and
--install/--uninstall exit with 0 on success instead of always 1.

The sample NSIS scripts referenced udsactor_service.exe and
udsactor_config.exe, but cargo emits them with a hyphen and the shipped
installer uses the hyphen everywhere, so neither the service install nor its
removal ever ran from them.
@dkmstr
dkmstr merged commit a7c50fd into master Sep 2, 2026
2 checks passed
@aschumann-virtualcable
aschumann-virtualcable deleted the fix/windows-uninstall-leaves-service branch September 2, 2026 14:37
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.

2 participants