Reputation: 673
I just created a new windows service and I am having issues with the installer.
I created the installer via this tutorial: http://www.sarin.mobi/2008/08/c-windows-service-visual-studio-2008/
Anyway, when I run the .msi generated by VS, the executable for this project is installed where I expect it to be. However, the service does not appear in Windows Services.
When I use the VS command line tool and installutil, everything works just fine.
I have created services in the past, so I compared the ProjectInstaller files and the installer configuration with past projects and see no significant differences.
Any advice?
Upvotes: 1
Views: 1770
Reputation: 46034
Step-by-step instructions for creating a Windows service in C# using Visual Studio 2008 can be found here. This includes the addition of the Installers necessary to install the service using the InstallUtil.exe
utility.
If you want to have your service install itself via the command line, see the step-by-step instructions here.
Upvotes: 0
Reputation: 6343
To install a service, you need to add a ServiceInstaller
and a ServiceProcessInstaller
to the service project, then add custom actions to the installer to run them. I'm pretty sure it's the custom actions part you're missing.
Now when you build the installer and execute it, the installers you've created in step 3 will be executed, adding your service and setting all properties.
HTH,
James
Upvotes: 4