fix(windows): remove the service on uninstall even if it is stopped - #28
Merged
Conversation
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.
aschumann-virtualcable
deleted the
fix/windows-uninstall-leaves-service
branch
September 2, 2026 14:37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.