I have a vb.net form application that I am deploying using a visual studio deployment project. The application must write event logs to the application log in the event viewer. For the reasons explained here I need to create an event source during the installation process. Something like this to run as part of the installer
If Not EventLog.SourceExists(My.Application.Info.ProductName) Then EventLog.CreateEventSource(My.Application.Info.ProductName, "Application") End If
This code must be run during installation with elevated privileges. So my questions are:
- How to execute this code above as part of the setup program?
- How do I get the installer to execute the UAC prompt so that this code runs as part of the installation?
source share