I am building a reusable framework for building scheduling services using the .NET Framework. My code is distributed as a library, which is then referenced by the user in a console application. In the main entry point of the application, the user is asked to transfer control to a static method in the library, which will commence job scheduling if running in non-interactive mode, alternatively read command arguments and perform maintenance tasks such as installation.
In order to install the application as a Windows service using the System.Configuration.Install
namespace, the user will have to add a class descendant of Installer
to the application assembly, telling the framework how to install the service. I really would prefer to do this once and for all in the library, but unfortunately the installer class has to be in the application assembly.
The solution that I am looking at right now, involves defining the an installer class in the library, and requiring the user to inherit this in a public class, without adding any additional code. While this works, it requires the user to write annoying boiler plate code.
What are the alternatives to extending Installer
? Can I access the managed installation framework in more direct way?