Instmsi.exe

Instmsi.exe 是用于安装 Windows Installer 2.0 和早期版本的 Windows Installer 的可再发行组件包。 有关 Windows Installer 3.0 及更高版本的可再发行组件,请参阅 Windows Installer 可再发行组件

有关操作系统附带的 Windows Installer 版本的详细信息,请参阅 Windows Installer 的已发布版本

某些可再发行组件不应在某些版本的操作系统上运行。 下表描述了哪些 Instmsi 在哪个操作系统上兼容。

如果 Instmsi.exe 安装此版本的 Windows Installer 可以在这些操作系统上运行 Instmsi.exe 必须在这些操作系统上运行 Instmsi.exe
Windows Installer 版本 1.0 Windows 95、Windows 98、Windows NT 4.0+SP3 Windows Me、Windows 2000、Windows XP、Windows Server 2003、Windows Vista、Windows Server 2008
Windows Installer 版本 1.1 Windows 95、Windows 98、Windows NT 4.0+SP3 Windows Me、Windows 2000、Windows XP、Windows Server 2003、Windows Vista、Windows Server 2008
Windows Installer 版本 1.2 Windows 95、Windows 98、Windows Me、Windows NT 4.0+SP3 Windows 2000、Windows XP、Windows Server 2003、Windows Vista、Windows Server 2008
Windows Installer 版本 2.0 Windows 95、Windows 98、Windows Me、Windows NT 4.0+SP6、Windows 2000 Windows XP、Windows Server 2003、Windows Vista、Windows Server 2008

 

例如,在运行可再发行组件包之前,重新分发 Windows Installer 版本 1.1 的应用程序应检查操作系统是 Windows NT 4.0 SP3 还是 Windows 98/95。 使用可再发行组件包的应用程序还应确保 Windows Installer 的 ANSI 版本安装在 Windows 98/95 上,并且 Unicode 版本安装在 Windows NT 或 Windows 2000 上。 请注意,某些应用程序将 Unicode 版本重命名为 InstMsiW。

语法

instmsioptions

命令行选项

命令行选项不区分大小写。

选项 说明
/q 供作为引导应用程序的一部分重新分发 Windows Installer 的应用程序使用。 不会向用户显示任何 UI。 引导应用程序应检查返回代码,以确定是否需要重启才能完成 Windows Installer 的安装。
/t 仅用于调试目的。
/c:"msiinst /delayreboot" 延迟重启选项。 防止 Instmsi 提示用户重启,即使它必须替换在安装期间使用的文件。 如果使用此选项调用 Instmsi,则在必须替换正在使用的文件时将返回 ERROR_SUCCESS_REBOOT_REQUIRED。 如果不必替换正在使用的文件,则返回 ERROR_SUCCESS。 适用于 Windows Installer 2.0 或更高版本的 Instmsi。 有关延迟重启的其他信息,请参阅“备注”部分。
/c:"msiinst /delayrebootq" 延迟重启选项的静默版本。 它不向用户显示任何 UI。 否则,该行为与上一个选项相同。 适用于 Windows Installer 2.0 或更高版本的 Instmsi。 有关延迟重启的其他信息,请参阅“备注”部分。
/? 显示帮助。

 

备注

使用 Instmsi.exe 通过另一个应用程序安装 Windows Installer 的引导应用程序可能需要额外的系统重启。 除了安装应用程序所需的任何重启之外,这还可能是额外的重启。

仅对于希望将 Instmsi.exe 与安装正在使用的文件的安装程序应用程序配合使用而导致的额外重启的安装程序开发人员,建议使用延迟重启选项。

开发人员应在安装应用程序中执行以下操作,以使用延迟重启选项。 此选项不适用于安装低于版本 2.0 的 Window Installer 的 Instmsi.exe 版本:

使用延迟重启选项

  1. 使用延迟重启命令行选项之一调用 Instmsi.exe。

  2. 将返回 ERROR_SUCCESS 或 ERROR_SUCCESS_REBOOT_REQUIRED 视为成功。

  3. 从以下位置的 InstallerLocation 值中获取包含新安装的 Windows Installer 二进制文件的文件夹的路径:

    HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer

    此值的类型为 REG_SZ。

  4. 将当前目录设置为步骤 3 中获取的路径。

  5. 在应用程序的包上调用 Msiexec,并运行特定于应用程序的其他设置代码。 如果安装应用程序使用 MsiInstallProduct,则应用程序必须从步骤 3 中获取的位置加载 MSI.DLL。

    注意

    在步骤 3 中获取的位置的新 MSI.DLL 上调用 LoadLibrary 的应用程序必须确保尚未在进程中加载较旧版本的 MSI.DLL。 如果在进程中加载了较旧版本的 MSI.DLL,则必须在对新 MSI.DLL 调用 LoadLibrary 之前从进程地址空间中卸载它。

     

  6. 如果步骤 (5) 不需要重启,并且 Instmsi.exe 已在步骤 (1) 中返回 ERROR_SUCCESS_REBOOT_REQUIRED,则提示用户重启以完成系统上的 Windows Installer 二进制文件的设置。 但是,如果在步骤 (5) 中重启,则无需执行其他步骤。

Instmsi.exe 在面向 Windows Installer 开发人员的 Windows SDK 组件中提供。

启动

Internet 下载引导

已发布的版本、工具和可再发行组件

Windows Installer 开发工具