I have created a windows service that has the Account set to user. Which means that when I install the service I need to pass a user name and password. Is there a way to set these maybe in the ProjectInstaller class maybe in the BeforeInstall event? if so HOW?
The below addition to a project installer will assign the service Log On information during installation.
public ProjectInstaller()
{
InitializeComponent();
serviceProcessInstaller1.Account = System.ServiceProcess.ServiceAccount.<account type>;
serviceProcessInstaller1.Username = <domain\userId>;
serviceProcessInstaller1.Password = <password>;
}
Take a look at System.ServiceProcess.ServiceProcessInstaller
Take a look at DynamicInstaller from CodeProject
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With