Window Service browsing by category


Install a Window Service

Sunday, August 1st, 2010

Here were the steps I went through to install a Window service called “Yangsoft Greeting” that will simply say a greeting when user first logs in to a PC:

  1. Create a Windows service project using the service template from VS2010
  2. Right click on the service.cs designer surface and add a service installer (ProjectInstaller.cs)
  3. Once I added the ProjectInstaller, there were two installer components needed to be configured properly, one is for service installer and one for service process installer. ServiceInstaller is where you define the name, description, and display name of the service; ServiceProcessInstaller is where you define which account will be used to run the service. The account to choose is LocalService, LocalSystem, networkService and User. The User account requires a user name and password when the service is installed.
  4. After compiling the solution, next step is to install the service so that it will show up in the Windows service list. There are two ways to install a service, one is manually running InstallUtil.exe from command line, for example : C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe    F:\Development\GreetingWinSvc\VoiceGreeting\bin\Release\Yangsoft.VoiceGreeting.exe
  5. The other way is to create a Setup and deployment project and package everything into a MSI file.