System.Configuration.Install Namespace

The System.Configuration.Install namespace provides classes that allow you to write custom installers for your own components. The System.Configuration.Install.Installer class is the base class for all custom installers in the.NET Framework.

Remarks

Through the System.Configuration.Install.Installer.Installers property, an installer contains a collection of other installers as children. As the installer is executed, it cycles through its children and calls System.Configuration.Install.Installer.Install(IDictionary), System.Configuration.Install.Installer.Commit(IDictionary), System.Configuration.Install.Installer.Rollback(IDictionary), or System.Configuration.Install.Installer.Uninstall(IDictionary). For an example of an object in the System.Configuration.Install.Installer.Installers collection, see System.Diagnostics.EventLogInstaller.

The System.Configuration.Install.Installer.Context property contains information about the installation. For example, information about the location of the log file for the installation, the location of the file that saves information required by the System.Configuration.Install.Installer.Uninstall(IDictionary) method, and the command line that was entered when the installation executable was run. For an example of an installation executable, see Installer Tool (Installutil.exe).

The System.Configuration.Install.Installer.Install(IDictionary), System.Configuration.Install.Installer.Commit(IDictionary), System.Configuration.Install.Installer.Rollback(IDictionary), and System.Configuration.Install.Installer.Uninstall(IDictionary) methods are not always called on the same instance of System.Configuration.Install.Installer. For example, you might use an System.Configuration.Install.Installer to install and commit an application, and then release the reference to that System.Configuration.Install.Installer. Later, uninstalling the application creates a new reference to an System.Configuration.Install.Installer, which means that the System.Configuration.Install.Installer.Uninstall(IDictionary) method is called on a different instance of System.Configuration.Install.Installer. For this reason, do not save the state of a computer in an installer. Instead, use an IDictionary that is preserved across calls and passed into the System.Configuration.Install.Installer.Install(IDictionary), System.Configuration.Install.Installer.Commit(IDictionary), System.Configuration.Install.Installer.Rollback(IDictionary), and System.Configuration.Install.Installer.Uninstall(IDictionary) methods.

Classes

TypeReason
AssemblyInstaller

Loads an assembly, and runs all the installers in it.

ComponentInstaller

Specifies an installer that copies properties from a component to use at install time.

IManagedInstaller

Provides an interface for a managed installer.

InstallContext

Contains information about the current installation.

Installer

Provides the foundation for custom installations.

InstallerCollection

Contains a collection of installers to be run during an installation.

InstallEventArgs

Provides data for the events: System.Configuration.Install.Installer.BeforeInstall, System.Configuration.Install.Installer.AfterInstall, System.Configuration.Install.Installer.Committing, System.Configuration.Install.Installer.Committed, System.Configuration.Install.Installer.BeforeRollback, System.Configuration.Install.Installer.AfterRollback, System.Configuration.Install.Installer.BeforeUninstall, System.Configuration.Install.Installer.AfterUninstall.

InstallEventHandler

Represents the method that will handle the System.Configuration.Install.Installer.BeforeInstall, System.Configuration.Install.Installer.AfterInstall, System.Configuration.Install.Installer.Committing, System.Configuration.Install.Installer.Committed, System.Configuration.Install.Installer.BeforeRollback, System.Configuration.Install.Installer.AfterRollback, System.Configuration.Install.Installer.BeforeUninstall, or System.Configuration.Install.Installer.AfterUninstall event of an System.Configuration.Install.Installer.

InstallException

The exception that is thrown when an error occurs during the commit, rollback, or uninstall phase of an installation.

ManagedInstallerClass

Represents a managed install.

TransactedInstaller

Defines an installer that either succeeds completely or fails and leaves the computer in its initial state.

UninstallAction

Specifies what an installer should do during an uninstallation.