Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you create an event log source using WiX

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.

like image 349
Edward Wilde Avatar asked Sep 12 '08 09:09

Edward Wilde


People also ask

How do I add source to event log?

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.

What is event log source?

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.

What are event logs and its example?

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.

What is event logging System?

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.


2 Answers

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.

like image 93
Paul Lalonde Avatar answered Sep 21 '22 08:09

Paul Lalonde


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..

like image 39
Gordon Avatar answered Sep 20 '22 08:09

Gordon