I'm creating an installer for a website that uses a custom event log source. I would like our WiX based installer to create that event log source during installation.
Does anyone know the best way to do this using the WiX framework.
To create an event source, you need to have a name for your new source (called the Event Source Name) and the name of the log where the event source will be a part. If the event log entries would be written to the standard “Application”, “System” or “Security” logs, then you can use that as the name of the log.
The event source is the name of the software that logs the event. It is often the name of the application or the name of a subcomponent of the application if the application is large.
An event log is a basic "log book" that is analyzed and monitored for higher level "network intelligence." It can capture many different types of information. For example, it can capture all logon sessions to a network, along with account lockouts, failed password attempts, etc.
Event logging provides a standard, centralized way for applications (and the operating system) to record important software and hardware events. The event logging service records events from various sources and stores them in a single collection called an event log.
Wix has out-of-the-box support for creating event log sources.
Assuming you use Wix 3, you first need to add a reference to WixUtilExtension to either your Votive project or the command line. You can then add an EventSource element under a component :
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"> <Component ...> ... <util:EventSource Log="Application" Name="*source name*" EventMessageFile="*path to message file*"/> ... </Component>
If this is a .NET project, you can use EventLogMessages.dll in the framework directory as the message file.
Just to save people some time - if you are trying to use the Application log and the .NET messages you can cut paste the below code:
<Util:EventSource xmlns:Util="http://schemas.microsoft.com/wix/UtilExtension" Name="ROOT Builder" Log="Application" EventMessageFile="%SystemRoot%\Microsoft.NET\Framework\v2.0.50727\EventLogMessages.dll" />
NOTE: the path above is now correct..
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With