Service Process Installer

  • Thread starter Thread starter John J. Hughes II
  • Start date Start date
J

John J. Hughes II

Two question:

1) Is there a way using the "System.ServiceProcess.ServiceController" to
change the service account type from say Automatic to Manual? I have a
control for my service that starts, stops, pauses, and continues but there
does not seem to be an obvious way to handle changing the startup option.

2) When installing the service can anyone tell me how or direct me to an
example for changing the "this.serviceProcessInstaller1.Account" type? I
know I need to add a question dialog and then based on the selected item
change the type but I am not sure how to see the data from the dialog screen
in the setup program.

Thanks,
John
 
1) Is there a way using the "System.ServiceProcess.ServiceController" to
change the service account type from say Automatic to Manual? I have a
control for my service that starts, stops, pauses, and continues but there
does not seem to be an obvious way to handle changing the startup option.

This is a property of the ServiceInstaller, not the ServiceProcessInstaller.
It's confusing, I know, why do we need two separate installers, yeah yeah
yeah.
And then there's the System.Configuration.Install.Installer that they both
get added to ...

2) When installing the service can anyone tell me how or direct me to an
example for changing the "this.serviceProcessInstaller1.Account" type? I
know I need to add a question dialog and then based on the selected item
change the type but I am not sure how to see the data from the dialog screen
in the setup program.

You can't change it once its installed. You would need to just set it from
the code in the installer class and then once its set that's it.
 
Back
Top