title: Create Event Log Source as part of installation - windows forms app, vs deployment project
body: <p>I have a vb.net windows form app that I am deploying as using the visual studio deployment project.  The app needs to write event logs to the application log in the event viewer.  For reasons explained <a href="http://social.msdn.microsoft.com/forums/en-US/windowsgeneraldevelopmentissues/thread/00a043ae-9ea1-4a55-8b7c-d088a4b08f09/" rel="noreferrer">here</a> I need to create the event source during the installation process.  Something like this to run as part of the installer</p>
  
  <pre><code>        If Not EventLog.SourceExists(My.Application.Info.ProductName) Then
              EventLog.CreateEventSource(My.Application.Info.ProductName, "Application")
          End If
  </code></pre>
  
  <p>That code needs to be run during the installer with elevated privileges.  So my questions are:</p>
  
  <ol>
  <li>How do I execute that code above as part of the installer?</li>
  <li>How do I get the installer to do the UAC prompt to allow that code to run as part of the installation?</li>
  </ol>