views:

172

answers:

1

Our WiX script currently creates an event log source using the method described here.

However, the log is created with default values for the Maximum log size and how it behaves when the log is full (e.g. Overwrite events as needed).

Is there an easy way to change those values when creating the source? I'm guessing it would require creating a custom action, but I'm wondering if there's an easier way or if such an action already exists.

+1  A: 

Hi Todd,

I've looked in the WiX CHM and did not see a field for specifying the maximum log size and how it behaves when full. But, I did find this entry which I think will help, and allow you to skip using a custom action: http://www.mail-archive.com/[email protected]/msg02026.html

So, I think for you:

  1. Create the EventSource, possibly in the registry (HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog), and configure it to your liking
  2. Export the key
  3. Use the program listed here to convert the REG file to a WiX authoring: http://stackoverflow.com/questions/269423/how-to-generate-wix-xml-from-a-reg-file/270442#270442

-Zachary

Zachary Young
Unfortunately this seems to require a reboot for the changes to be applied, which I'd like to avoid. The System.Diagnostics.EventLog object can modify the values without requiring a reboot. I was hoping to find a way to do that, but it looks like writing my own custom action might be the only option.
Todd Ropog