What is the best way to install a C# windows service that doesn't require running installutil manually?

StackOverflow https://stackoverflow.com/questions/169381

Question

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?

Was it helpful?

Solution

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

OTHER TIPS

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.

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top