- stateSaver
An IDictionary used to save information needed to perform a rollback or uninstall operation.
The EventLogInstaller.Install(IDictionary) method writes event log information to the registry, and associates the event log with a log that is specified by the EventLogInstaller.Log property. If the log does not already exist (and a source is specified), EventLogInstaller.Install(IDictionary) creates a log and associates the new source with it.
Typically, you do not call the methods of the System.Diagnostics.EventLogInstaller from within your code; they are generally called only by the Installer Tool (Installutil.exe). The tool automatically calls the EventLogInstaller.Install(IDictionary) 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 EventLogInstaller.Rollback(IDictionary) method.
Use System.Diagnostics.EventLogInstaller to register a new source for a new or existing event log; do not use System.Diagnostics.EventLogInstaller to change an existing source. The System.Diagnostics.EventLogInstaller class does not modify the configuration properties of an existing source to match the specified installation properties. The EventLogInstaller.Install(IDictionary) method throws an exception if the EventLogInstaller.Source property matches a source name that is registered for a different event log on the computer. The EventLogInstaller.Install(IDictionary) method skips registering the source if the EventLogInstaller.Source property matches a source name that is already registered for the same event log specified in the EventLogInstaller.Log property.
An application's install routine uses the project installer's System.Configuration.Install.Installer.Context property to automatically maintain information about the components that have already been installed. This state information, which is passed to EventLogInstaller.Install(IDictionary) as the stateSaver parameter, is continuously updated as the tool installs each System.Diagnostics.EventLogInstaller. Usually, it is not necessary for your code to explicitly modify this state information.