Performs the installation and writes event log information to the registry.
Assembly: System.Configuration.Install (in System.Configuration.Install.dll)
The method writes event log information to the registry, and associates the event log with a log that is specified by the Log property. If the log does not already exist (and a source is specified), creates a log and associates the new source with it.
Typically, you do not call the methods of the EventLogInstaller from within your code; they are generally called only by the Installutil.exe (Installer Tool). The tool automatically calls the method during the installation process to write registry information that is associated with the event log being installed. Installation is transactional, so if there is a failure of any installation project component during the installation, all the previously-installed components are rolled back to their pre-installation states. This is accomplished by calling each component's Rollback method.
Use EventLogInstaller to register a new source for a new or existing event log; do not use EventLogInstaller to change an existing source. The EventLogInstaller class does not modify the configuration properties of an existing source to match the specified installation properties. The method throws an exception if the Source property matches a source name that is registered for a different event log on the computer. The method skips registering the source if the Source property matches a source name that is already registered for the same event log specified in the Log property.
An application's install routine uses the project installer's Installer.Context property to automatically maintain information about the components that have already been installed. This state information, which is passed to as the stateSaver parameter, is continuously updated as the tool installs each EventLogInstaller. Usually, it is not necessary for your code to explicitly modify this state information.
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.