System.Configuration.Install 命名空间提供类,这些类使您可以为自己的组件编写自定义安装程序。Installer 类是 .NET Framework 中所有自定义安装程序的基类。

通过 Installers 属性,一个安装程序可包含其他安装程序的集合作为其子级。执行安装程序时,将循环通过其子级,并调用 InstallCommitRollbackUninstall。有关 Installers 集合中对象的示例,请参见

Context 属性包含关于安装的信息。例如,关于安装的日志文件位置的信息,保存 Uninstall 方法所要求信息的文件的位置,以及运行可执行安装文件时输入的命令行。有关可执行安装文件的示例,请参见

InstallCommitRollbackUninstall 方法并不总是在 Installer 的同一实例上调用。例如,可以使用某 Installer 来安装和提交应用程序,然后释放对该 Installer 的引用。以后卸载该应用程序时将创建对 Installer 的新引用,这意味着在 Installer 的另一个实例上调用 Uninstall 方法。因此,不要在安装程序中保存计算机的状态。而请使用 ,它可跨调用保留并传递给 InstallCommitRollbackUninstall 方法。

  说明
System.Configuration.Install 命名空间 AssemblyInstaller 加载一个程序集,并运行其中的所有安装程序。
System.Configuration.Install 命名空间 ComponentInstaller 指定一个安装程序,该程序从组件复制属性以供安装时使用。
System.Configuration.Install 命名空间 InstallContext 包含关于当前安装的信息。
System.Configuration.Install 命名空间 Installer 提供自定义安装的基础。
System.Configuration.Install 命名空间 InstallerCollection 包含要在安装过程中运行的安装程序的集合。
System.Configuration.Install 命名空间 InstallEventArgs 为下列事件提供数据:BeforeInstallAfterInstallCommittingCommittedBeforeRollbackAfterRollbackBeforeUninstallAfterUninstall
System.Configuration.Install 命名空间 InstallException 在安装的提交、回滚或卸载阶段发生错误时引发的异常。
System.Configuration.Install 命名空间 ManagedInstallerClass 基础结构。表示托管安装。
System.Configuration.Install 命名空间 TransactedInstaller 定义要么完全成功要么失败后将计算机保留在其初始状态的安装程序。

接口

  接口 说明
System.Configuration.Install 命名空间 IManagedInstaller 基础结构。为托管安装程序提供一个接口。

委托

枚举

  枚举 说明
System.Configuration.Install 命名空间 UninstallAction 指定安装程序在卸载时应进行的操作。

相关文章:

猜你喜欢
  • 2022-01-24
  • 2022-12-23
  • 2022-01-01
相关资源
相似解决方案