2

I'm having difficulty implementing a WindowsService with C# Express. What I want is to write a class that separates the installation logic from the service, er, service. To make this worthwhile I am looking to remove the class deriving from installer and be left with just the service itself, as I thought http://msdn.microsoft.com/en-us/library/zt39148a%28v=VS.100%29.aspx might describe. All these fancy install and packaging wizards are absent from my Express edn so I must use only .NET classes.

I'm considering ManagedInstallerClass and AssemblyInstaller and _not_ installutil, if at all possible.

John
  • 6,433
  • 7
  • 47
  • 82

1 Answers1

2

Use the ManagedInstallerClass.

The answers in this question are excellent. Please check Self install windows service in .NET c# and the code midpage here http://blogs.microsoft.co.il/blogs/kim/archive/2009/01/04/self-installing-windows-service.aspx (this example uses AssemblyInstaller).

Community
  • 1
  • 1
Jeremy
  • 3,880
  • 3
  • 35
  • 42
  • 1
    If you want to create a self install windows service you can also look to http://topshelf-project.com/. – Gerard May 02 '12 at 21:02