I have succesfully installed my service using InstallUtil, but I would like my service to run in its own process instead of in svchost. If I was doing this via say winmgmts, I could just pass OWN_PROCESS to it (see here). How can I do this using a System.Configuration.Install.Installer?
My current code:
[RunInstaller(true)]
public partial class MyServiceInstaller : Installer
{
private ServiceInstaller serviceInstaller;
private ServiceProcessInstaller processInstaller;
public MyServiceInstaller ()
{
InitializeComponent();
processInstaller = new ServiceProcessInstaller();
serviceInstaller = new ServiceInstaller();
processInstaller.Account = ServiceAccount.LocalSystem;
serviceInstaller.StartType = ServiceStartMode.Manual;
serviceInstaller.ServiceName = "MyService";
Installers.Add(serviceInstaller);
Installers.Add(processInstaller);
}
}
I am going to have to assume that this is not possible with this method. I long ago simply used another method (sc.exe) to accomplish this.