I have created a C# Windows Service and its accompanying Visual Studio Setup project that creates an installer. It successfully installs the service.
When I choose any value from enum ServiceAccount
apart from ServiceAccount.User
, the service installs without prompting using the appropriate built-in user. What I am after is actually installing the service under current user's credentials. When I specify ServiceAccount.User
, I get a prompt for a user name and password during installation. What I need to do is find a way to install the service with the credentials of the user who is running the setup without prompting for password.
Is this at all possible? I am willing to resort to any measures needed (like loads of P/Invoke) to get the job done.