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

<p>Does anyone know the best way to do this using the WiX framework.</p>

[{'answer_id': 58686, 'author': 'Paul Lalonde', 'author_id': 5782, 'author_profile': 'https://Stackoverflow.com/users/5782', 'pm_score': 7, 'selected': True, 'text': '<p>Wix has out-of-the-box support for creating event log sources.</p>\n\n<p>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 :</p>\n\n<pre><code>&lt;Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"\n    xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"&gt;\n\n    &lt;Component ...&gt;\n        ...\n        &lt;util:EventSource Log="Application" Name="*source name*"\n           EventMessageFile="*path to message file*"/&gt;\n        ...\n    &lt;/Component&gt;\n</code></pre>\n\n<p>If this is a .NET project, you can use EventLogMessages.dll in the framework directory as the message file.</p>\n'}, {'answer_id': 574055, 'author': 'Gordon', 'author_id': 69455, 'author_profile': 'https://Stackoverflow.com/users/69455', 'pm_score': 4, 'selected': False, 'text': '<p>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:</p>\n\n<pre><code>&lt;Util:EventSource\n xmlns:Util="http://schemas.microsoft.com/wix/UtilExtension"\n Name="ROOT Builder"\n Log="Application"\n EventMessageFile="%SystemRoot%\\Microsoft.NET\\Framework\\v2.0.50727\\EventLogMessages.dll"\n/&gt;\n</code></pre>\n\n<p>NOTE: the path above is now correct..</p>\n'}, {'answer_id': 5029747, 'author': 'Daniel Fisher  lennybacon', 'author_id': 12679, 'author_profile': 'https://Stackoverflow.com/users/12679', 'pm_score': 4, 'selected': False, 'text': '<p>How about the more flexible stuff built in:</p>\n\n<pre><code>EventMessageFile="[NETFRAMEWORK20INSTALLROOTDIR]EventLogMessages.dll"\n</code></pre>\n\n<p>or</p>\n\n<pre><code>EventMessageFile="[NETFRAMEWORK40FULLINSTALLROOTDIR]EventLogMessages.dll"\n</code></pre>\n\n<p>And </p>\n\n<pre><code>EventMessageFile="[NETFRAMEWORK40FULLINSTALLROOTDIR64]EventLogMessages.dll"\n</code></pre>\n'}]
['https://Stackoverflow.com/questions/58538', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5182/']