Upraviť

Zdieľať cez


Installer.Install(IDictionary) Method

Definition

When overridden in a derived class, performs the installation.

public:
 virtual void Install(System::Collections::IDictionary ^ stateSaver);
public virtual void Install (System.Collections.IDictionary stateSaver);
abstract member Install : System.Collections.IDictionary -> unit
override this.Install : System.Collections.IDictionary -> unit
Public Overridable Sub Install (stateSaver As IDictionary)

Parameters

stateSaver
IDictionary

An IDictionary used to save information needed to perform a commit, rollback, or uninstall operation.

Exceptions

The stateSaver parameter is null.

An exception occurred in the BeforeInstall event handler of one of the installers in the collection.

-or-

An exception occurred in the AfterInstall event handler of one of the installers in the collection.

Examples

The following example demonstrates the Install method of the Installer class. A class is derived from the Installer base class and the Install method is overridden.

   // Override the 'Install' method of the Installer class.
public:
   virtual void Install( IDictionary^ mySavedState ) override
   {
      Installer::Install( mySavedState );
      // Code maybe written for installation of an application.
      Console::WriteLine( "The Install method of 'MyInstallerSample' has been called" );
   }
// Override the 'Install' method of the Installer class.
public override void Install( IDictionary mySavedState )
{
   base.Install( mySavedState );
   // Code maybe written for installation of an application.
   Console.WriteLine( "The Install method of 'MyInstallerSample' has been called" );
}
' Override the 'Install' method of the Installer class.
Public Overrides Sub Install(mySavedState As IDictionary)
   MyBase.Install(mySavedState)
   ' Code maybe written for installation of an application.
   Console.WriteLine("The Install method of 'MyInstallerSample' has been called")
End Sub

Notes to Inheritors

Applies to

See also