I need to use InstallUtil to install a C# windows service. I need to set the service logon credentials (username and password). All of this needs to be done silently.
<
You can also force your service to run as User using ServiceProcessInstaller::Account = ServiceAccount.User;
A popup asking "[domain\]user, password" will appear during service installation.
public class MyServiceInstaller : Installer
{
/// Public Constructor for WindowsServiceInstaller
public MyServiceInstaller()
{
ServiceProcessInstaller serviceProcessInstaller = new ServiceProcessInstaller();
ServiceInstaller serviceInstaller = new ServiceInstaller();
//# Service Account Information
serviceProcessInstaller.Account = ServiceAccount.User; // and not LocalSystem;
....