3

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.

Community
  • 1
  • 1
Todd Ropog
  • 1,133
  • 1
  • 14
  • 23

1 Answers1

4

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/wix-users@lists.sourceforge.net/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: How to generate WiX XML from a .reg file?
Zach Young
  • 10,137
  • 4
  • 32
  • 53
  • 2
    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 Mar 08 '10 at 20:31
  • @ToddRopog If you end up creating a custom action, could you share it here, please? – Ondrej Janacek Nov 26 '21 at 11:41
  • @OndrejJanacek Sorry, I don't think I ever did, but I haven't used WiX in a long time. – Todd Ropog Nov 27 '21 at 14:29