Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
 Install Method

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Class Library
EventLogInstaller..::.Install Method

Performs the installation and writes event log information to the registry.

Namespace:  System.Diagnostics
Assembly:  System.Configuration.Install (in System.Configuration.Install.dll)
Visual Basic (Declaration)
Public Overrides Sub Install ( _
    stateSaver As IDictionary _
)
Visual Basic (Usage)
Dim instance As EventLogInstaller
Dim stateSaver As IDictionary

instance.Install(stateSaver)
C#
public override void Install(
    IDictionary stateSaver
)
Visual C++
public:
virtual void Install(
    IDictionary^ stateSaver
) override
JScript
public override function Install(
    stateSaver : IDictionary
)

Parameters

stateSaver
Type: System.Collections..::.IDictionary
An IDictionary used to save information needed to perform a rollback or uninstall operation.
ExceptionCondition
PlatformNotSupportedException

The platform the installer is trying to use is not Windows NT 4.0 or later.

ArgumentException

The name specified in the Source property is already registered for a different event log.

The Install 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), Install 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 Installer Tool (Installutil.exe). The tool automatically calls the Install 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 Install method throws an exception if the Source property matches a source name that is registered for a different event log on the computer. The Install 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 Install 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.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker