Defining a new event source for the Windows event viewer

The Windows event viewer is a centralized place where application messages are logged, which system administrators can use to monitor the health of the machine. Registering an event source gives us a chance to store hard-coded, localized strings for our own messages. We can select one programmatically by its associated numeric ID. That way, the messages stay consistent and system administrators have one place to go to, to find them.

In this recipe, we'll create a messages file and store it within a resource DLL. Then, we'll register that file with an event source that's installed to the end user's computer. An application can use this event source to log predefined messages to the event viewer. ...

Get WiX Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.