Open jnm2 opened 5 years ago
yup i'm all in for stopImmediately
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 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). 🤷♂️
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 toDeleteService
to mirror thestartImmediately
parameter onCreateService
?