I am writing a Windows Service in C# in Visual Studio 2010.
My service will require a registry key HKLM\system\currentcontrolset\services\myservicename\parameters. It will also require a custom event source. I can't create either of these from within the service because both of these actions require running elevated on Win7, and I don't want my service to run elevated.
The event source seems to be created automagically (I wish I knew how/where and could find this documentation) by the installer.
What is the correct place for me to create and populate the Parameters registry key? Would it be the AfterInstall() event of the installer? I'd like to be able to roll back the installation if my actions fail and I'm not sure I can do that in AfterInstall().