You could use the WMI namespace to modify settings on a service.
For example, I have a test service that needs to have "Interact With
Desktop" checked, so I use the following code (which I got from a thread on a
CodeProject article) in my Installer Custom Action:
if (System.Environment.OSVersion.Platform == System.PlatformID.Win32NT)
{
ConnectionOptions coOptions = new ConnectionOptions();
coOptions.Impersonation = ImpersonationLevel.Impersonate;
ManagementScope mgmtScope = new
System.Management.ManagementScope(@"root\CIMV2", coOptions);
mgmtScope.Connect();
ManagementObject wmiService;
wmiService = new ManagementObject("Win32_Service.Name='" +
this.serviceInstaller1.ServiceName + "'");
ManagementBaseObject InParam = wmiService.GetMethodParameters("Change");
InParam["DesktopInteract"] = true;
ManagementBaseObject OutParam = wmiService.InvokeMethod("Change", InParam,
null);
}
I'm sure there's probally something like "LogonUser", "LogonDomain",
"LogonPassword" in there as well.
Or if it's a service you're installing, you can use a ServiceInstaller
object to set all this up for you. Search MSDN for a howto.