I have an InstallScript installer that needs to modify an existing service's startup type (i.e. Automatic, Manual or Disabled) based on its current value. For example, if the current startup type is Disabled, it might leave it so, while otherwise it might set it to Automatic.
Unfortunately I can't find a way to obtain a service's startup type. There are functions to detect whether a service exists (ServiceExistsService
), and get its current started/stopped state (ServiceGetServiceState
), but nothing that retrieves the service's parameters. I thought that perhaps calling one of those functions would populate the SERVICE_IS_PARAMS
structure as a side-effect, but that doesn't seem to be the case.
How can I get a service's startup type?