14

For some reason, after adding a Installer class to my Windows Service project, I open it up in design mode and right click, but there is no option to add either a service installer or a service process installer. Does anyone know why this may be the case?

Trevor
  • 13,085
  • 13
  • 76
  • 99

1 Answers1

35

In both Visual Studio 2008 and 2010, the best way to do this is to open the ServiceBase component (named Service1 by default) in design mode. Then, right-click in the designer and select the Add Installer option. This adds a ProjectInstaller component along with the necessary assembly references. The ProjectInstaller component, in turn, has the service installer and service process installer added automatically.

Without additional detail, my best guess is that you manually added a component/class to your project and named it Installer instead of letting Visual Studio do the work for you.

See my post here for how to create a basic service in Visual Studio 2008 (seems to work in 2010 as well). Pay particular attention to Step 6.

Hope this helps.

Community
  • 1
  • 1
Matt Davis
  • 45,297
  • 16
  • 93
  • 124
  • I'm facing a similar problem to the one in the question, only it seems I can't go through step 6. I manually added the windows service template to VC# studio express - do I have to install the proper installer components before the menu option shows up for the studio express? – blueberryfields Dec 26 '11 at 22:03
  • 2
    I'm pretty sure the VS Express editions don't natively support creation of Windows services. You'll probably have to do everything manually; that has been my limited experience with those products. – Matt Davis Dec 27 '11 at 17:26
  • Can use ServiceInstaller or ProjectInstaller to do something like `MyService.exe install` or `MyService.exe uninstall`? It looks like they are only used by external tools. I want my service to (un)install by passing arguments to the service itself, not `InstallUtil` – SMUsamaShah Jun 03 '16 at 06:56