views:

678

answers:

3

I'd like to package a C# windows service project so it can be easily installed by anyone without having to use installutil command prompt utility? Is there an easy way to configure a Visual Studio setup project to do that similar to how winforms applications are installed?

+1  A: 

I like to create a install project to get a nice and clean MSI installer, this should help you:

http://support.microsoft.com/kb/816169

And codeproject has a good example too: http://www.codeproject.com/KB/dotnet/simplewindowsservice.aspx

AlbertEin
+1  A: 

For completeness sakes I'll summarise http://support.microsoft.com/kb/816169 here.

You need to add a Service Installer class to your service component. This can then be called by the setup routine to add you service. You'll need to create a custom action in your Setup project to call it. The details are in the KB identified.

Brody
+2  A: 

There are plenty of extra answers in this question.

If the app is for basic users then the MSI is the best way to go.

If it's aimed at techies then I personally prefer apps that can install and uninstall themselves, and can run as a service or like a normal app. The linked question has answers that describe this.

romkyns