|
Este artigo foi traduzido por máquina. Coloque o ponteiro do mouse sobre as frases do artigo para ver o texto original. Mais informações.
|
Tradução
Original
|
Classe Installer
System.MarshalByRefObject
System.ComponentModel.Component
System.Configuration.Install.Installer
System.Configuration.Install.AssemblyInstaller
System.Configuration.Install.ComponentInstaller
System.Configuration.Install.TransactedInstaller
System.Management.Instrumentation.DefaultManagementInstaller
System.Management.Instrumentation.DefaultManagementProjectInstaller
System.Management.Instrumentation.ManagementInstaller
Namespace: System.Configuration.Install
Assembly: System.Configuration.Install (em System.Configuration.Install.dll)
O tipo Installer expõe os membros a seguir.
| Nome | Descrição | |
|---|---|---|
![]() | CanRaiseEvents | |
![]() | Container | |
![]() | Context | |
![]() | DesignMode | |
![]() | Events | |
![]() | HelpText | |
![]() | Installers | |
![]() | Parent | |
![]() | Site |
| Nome | Descrição | |
|---|---|---|
![]() | Commit | |
![]() | CreateObjRef | |
![]() | Dispose() | |
![]() | Dispose(Boolean) | |
![]() | Equals(Object) | |
![]() | Finalize | |
![]() | GetHashCode | |
![]() | GetLifetimeService | |
![]() | GetService | |
![]() | GetType | |
![]() | InitializeLifetimeService | |
![]() | Install | |
![]() | MemberwiseClone() | |
![]() | MemberwiseClone(Boolean) | |
![]() | OnAfterInstall | |
![]() | OnAfterRollback | |
![]() | OnAfterUninstall | |
![]() | OnBeforeInstall | |
![]() | OnBeforeRollback | |
![]() | OnBeforeUninstall | |
![]() | OnCommitted | |
![]() | OnCommitting | |
![]() | Rollback | |
![]() | ToString | |
![]() | Uninstall |
| Nome | Descrição | |
|---|---|---|
![]() | AfterInstall | |
![]() | AfterRollback | |
![]() | AfterUninstall | |
![]() | BeforeInstall | |
![]() | BeforeRollback | |
![]() | BeforeUninstall | |
![]() | Committed | |
![]() | Committing | |
![]() | Disposed |
Herdar de Installer classe. Override the Install, Commit, Rollback, and Uninstall methods. Adicionar o RunInstallerAttribute a derivada da classe e defina-o como true. Coloque sua classe derivada no assembly com o seu aplicativo para instalar. Invoca os instaladores. Por exemplo, use o InstallUtil para invocar os instaladores.
using System; using System.Collections; using System.ComponentModel; using System.Configuration.Install; // Set 'RunInstaller' attribute to true. [RunInstaller(true)] public class MyInstallerClass: Installer { public MyInstallerClass() :base() { // Attach the 'Committed' event. this.Committed += new InstallEventHandler(MyInstaller_Committed); // Attach the 'Committing' event. this.Committing += new InstallEventHandler(MyInstaller_Committing); } // Event handler for 'Committing' event. private void MyInstaller_Committing(object sender, InstallEventArgs e) { Console.WriteLine(""); Console.WriteLine("Committing Event occured."); Console.WriteLine(""); } // Event handler for 'Committed' event. private void MyInstaller_Committed(object sender, InstallEventArgs e) { Console.WriteLine(""); Console.WriteLine("Committed Event occured."); Console.WriteLine(""); } // Override the 'Install' method. public override void Install(IDictionary savedState) { base.Install(savedState); } // Override the 'Commit' method. public override void Commit(IDictionary savedState) { base.Commit(savedState); } // Override the 'Rollback' method. public override void Rollback(IDictionary savedState) { base.Rollback(savedState); } public static void Main() { Console.WriteLine("Usage : installutil.exe Installer.exe "); } }
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Função Server Core sem suporte), Windows Server 2008 R2 (Função Server Core com suporte com o SP1 ou posterior, Itanium sem suporte)
O .NET Framework não oferece suporte a todas as versões de cada plataforma. Para obter uma lista das versões com suporte, consulte .Requisitos de sistema do NET Framework.
