How to install a windows service

Hello everyone,

After a long time I developed a new windows service and I wanted to share how to install a windows service so that it could be seen in the Services list.

 

Use Project Installer

First of all you must have a Project Installer in your windows service project. You can benefit from this link in MSDN and follow the steps to have it installed in your windows service application.

You can easily set Description, DisplayName, ServiceName of your window service application without writing any line of codes with the help of Project Installer.

After you completed this step your window service application will be ready to installed.

How to install a windows service ?

In order to do that;

  • Go to the installutil.exe in your .NET folder (it is something like: C:\Windows\Microsoft.NET\Framework\v4.0.30319 for example)
  • Then install your service typing like below:

[For copy-paste issues you can use: C:\Windows\Microsoft.NET\Framework\v4.0.30319\installutil.exe D:\MyServices\PersonService.exe ]

If your service has been installed successfully you should see below messages on your Developer Command Prompt:

How to uninstall a windows service ?

In order to uninstall a windows service type /u after installutil.exe command and just before giving your service’s directory address like that:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\installutil.exe /u D:\MyServices\PersonService.exe

Hope that helps! 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *