21

I have a Windows Service project in Visual Studio 2008. I've also added the setup and deployment project. Unfortunately, when I install it, the service does not show up in the services MMC snapin.

I have already added the ProjectInstaller to the service project, and I've followed the instructions here already.

gbjbaanb
  • 51,617
  • 12
  • 104
  • 148
Joel Martinez
  • 46,929
  • 26
  • 130
  • 185
  • 2
    the pertinent part of the article for me was... *"The point which was had me hunting the internet for hours was right click and select “View Custom Actions” from the window that opens right click the root node and select “Add Custom Action” select application folder and then select your service. This will ensure that when your service is installed it is registered in the Services MMC"* – BizNuge May 17 '11 at 07:38

1 Answers1

25

What you're looking for (and that article has nothing on this, that I can see) is a ProjectInstaller class. If you open your service up in design view, you can right-click and select "Add Installer." This adds a class to your project called, by default (I think), ProjectInstaller.cs. In design view, you will see two items with the default names ServiceProcessInstaller1 and ServiceInstaller1. Change the properties on each for what account you want your service to run under, what the service name is, description, etc.

Then, in your MSI project, click on the Custom Actions Editor icon and add the "Primary output from YourServiceProject" to all of the actions, Install, Commit, Rollback, and Uninstall.

Here's an older walk-through from Microsoft.

Best of luck.

AJ.
  • 16,368
  • 20
  • 95
  • 150