Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between ServiceProcessInstaller and ServiceInstaller

Tags:

c#

service

I don't get the difference between System.ServiceProcess.ServiceProcessInstaller and System.ServiceProcess.ServiceInstaller. From metadata: the first one installs an executable and the second one a class. After reading the example of the MSDN where there is one ServiceProcessInstaller and two ServiceInstaller(s) with different ServiceName(s) I was completely lost.

Is there a clear explanation?

like image 600
mfudi Avatar asked Oct 01 '10 13:10

mfudi


1 Answers

It is possible for an executable to actually contain multiple services. In such a case, you'd have a ServiceInstaller that represents each service, but a single ServiceProcessInstaller, that represents the executable.

Each service is implemented (in .NET) as a different class. But the multiple services (if they're all started) would share an AppDomain (I believe). It's probably quite rare for you to need such a setup, and in most cases, there's a 1-1 mapping between executables and services (so you'd only have a single ServiceInstaller and ServiceProcessInstaller in the executable).

like image 128
Damien_The_Unbeliever Avatar answered Sep 22 '22 01:09

Damien_The_Unbeliever