共用方式為


Installer.Install(IDictionary) 方法

定義

當在衍生類別中被覆寫時,執行安裝。

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)

參數

stateSaver
IDictionary

IDictionary,用來儲存執行認可、復原或解除安裝作業所需的資訊。

例外狀況

stateSaver 參數為 null

在集合中有一個安裝程式的 BeforeInstall 事件處理常式發生例外狀況。

-或-

在集合中有一個安裝程式的 AfterInstall 事件處理常式發生例外狀況。

範例

下列範例示範 Install 類別的 Installer 方法。 類別衍生自 Installer 基類, Install 並覆寫 方法。

   // 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

給繼承者的注意事項

適用於

另請參閱