Open TomWouters opened 5 years ago
So i've been thinking about this for a bit. A few key points:
sc.exe
is messy. Plus i figured it might help with other code (installers for example) that needs to configure services - turns out i'm right and some users even extracted out all this code without even needing the ServiceBase alternative.subinacl.exe
is a nice commandline that can do what you want and you could call it after registering a service (for which you need privileges anyway). Did you try this already? I suppose you may need some command line escaping though.Summing up: I'm quite reluctant to add this as a feature.
Hello Daniel,
I've succesfully used your windows service library in a number of applications running under net core, over Peter Kottas library. So thanks a lot for the nice integratable solution.
I just have one issue.
I have a service, installed as an admin user (necessary for the application). The current logged in user is a normal user, with no option to elevate rights. For updates, new files are downloaded, the service is stopped, files are renamed, and the service is started.
What I'm noticing is that for starting and stopping a service, installed/running under an admin account, elevated rights are necessary.
Is there a way we can call the install command, so that start and stop rights are granted to all users?
I've found a similar question/response on stack overflow, where there is an instructionset on how to do it using windows, but it would be perfect if those rights could be set using the install command.
Link: https://stackoverflow.com/questions/10850595/windows-service-start-and-stop-without-admin-privileges
If this is implemented in the dasMulli library, I'll pick it up with Peter (or fork the library), so that it can also be wrapped there.