Question

Is there a way to install a windows service and automatically set it up to run as the current user without having to manually fill in details each time it installs?

We're developing a windows service and want to automate the installation of the service on developer machines so everyone can get up and running on the project very quickly. We're using InstallUtil.exe to do the install.

Our service can't run as local service, local system or network service because of the resources it needs access to. We know that it's possible to pass in a username and password but would like to avoid setting up a domain user just so we can automate the install if there's a better option.

Was it helpful?

Solution

No that is not possible. If the service is running as a user, the service control manager has to cache the user id and password. During setup, it does not have access to the current user's password, so the install routine will have to supply that in some way.

Your service probably could run as network service, you just have to give all the developers machine accounts access to the needed resources.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top