dotnet-win32-service icon indicating copy to clipboard operation
dotnet-win32-service copied to clipboard

DeleteService should stop the service

Open jnm2 opened this issue 5 years ago • 3 comments

Otherwise, it stays running and in the Services list until the next time it stops for some other reason.

Would it ever make sense to delete and leave running? If so, could you add a bool stopImmediately parameter to DeleteService to mirror the startImmediately parameter on CreateService?

jnm2 avatar Mar 04 '19 03:03 jnm2

yup i'm all in for stopImmediately

dasMulli avatar Mar 04 '19 15:03 dasMulli

There has been https://github.com/dasMulli/dotnet-win32-service/pull/75 before to implement stopping.

The reason i didn't want to put it in immediatly was because ServiceController has a more versatile method of stopping but i guess it should be fine to either copy that code or "just" use ServiceController.

dasMulli avatar Mar 04 '19 15:03 dasMulli

@dasMulli I'd have a mild preference for avoiding an extra assembly, and maybe I'd support it by saying it would be more symmetrical on the outside (startImmediately doesn't require the extra assembly). 🤷‍♂️

jnm2 avatar Mar 04 '19 15:03 jnm2