title: Registry entries for custom service - when to create/remove them?
body: <p>I am currently making my first attempts at creating a simple Windows Service using C# and .NET. I am at a point where the service does what it is supposed to do, but uses a lot of hard-coded values. I want to move these values to a separate configuration area - probably the Windows registry. I would like to provide my service with a kind of default configuration - if the settings / registry entries aren't present, create a set of default values and warn the user that the default values may need to be adjusted. However, I am unsure on <em>when</em> to perform this operation:</p>
  
  <ul>
  <li><p>I could create the registry entries from the constructor of the <code>ServiceBase</code> descendant.</p></li>
  <li><p>I could create the entries within the installer I created following the tutorial (a subclass <code>System.Configuration.Install.Installer</code>).</p></li>
  </ul>
  
  <p>I am unsure whether there are other options, what the pros and cons of these options are and whether there is a "correct" approach to perform this. I am even less sure if and where I should provide code to automatically remove the registry entries.</p>