Install Windows Service created in Visual Studio
Looking at:
No public installers with the RunInstallerAttribute.Yes attribute could be found in the C:\Users\myusername\Documents\Visual Studio 2010\Projects\TestService\TestSe rvice\obj\x86\Debug\TestService.exe assembly.
It looks like you may not have an installer class in your code. This is a class that inherits from Installer
that will tell installutil
how to install your executable as a service.
P.s. I have my own little self-installing/debuggable Windows Service template here which you can copy code from or use: Debuggable, Self-Installing Windows Service
You need to open the Service.cs file in the designer, right click it and choose the menu-option "Add Installer".
It won't install right out of the box... you need to create the installer class first.
Some reference on service installer:
How to: Add Installers to Your Service Application
Quite old... but this is what I am talking about:
Windows Services in C#: Adding the Installer (part 3)
By doing this, a ProjectInstaller.cs
will be automaticaly created. Then you can double click this, enter the designer, and configure the components:
serviceInstaller1
has the properties of the service itself:Description
,DisplayName
,ServiceName
andStartType
are the most important.serviceProcessInstaller1
has this important property:Account
that is the account in which the service will run.
For example:
this.serviceProcessInstaller1.Account = ServiceAccount.LocalSystem;