Thursday, April 23, 2009

Creating Needed Installer for Windows Services

This is not the actual "installer". This code is needed for the service to operate correctly. We will get to installing and deployment latter..

Add The Installer Code

From Service1 designer, right click in the gray area and choose Add Installer.

Another file will be added to your Solution Explorer, called ProjectInstaller. On this class will be two components in the designer, ServiceProccessInstaller1 and ServiceInstaller1.

Let's configure the Installer: Click on the listed component and alter the following properties:

ServiceProccessInstaller1:

  • Account = LocalSystem (will cause service to run under local service account)
ServiceInstaller1:
  • ServiceName = NewService
  • StartType = Automatic (wether your service will auto start after reboot)
  • DisplayName = NewService
Now we Build and Install the service to test it out.

Well, that's it for today. We'll continue with next lesson in another time.

Reference:
dotheweb.net