大网数据广告活动
安装更新与部署

Installing Multiple Instances with Instance Transforms

· 52CE 我爱测

This topic provides guidelines for installing or reinstalling a multiple instance installation that uses instance transforms.

This topic provides guidelines for installing or reinstalling a multiple instance installation that uses instance transforms.

  • When installing a new instance with an instance transform, include the MSINEWINSTANCE property and set MSINEWINSTANCE=1.
  • When installing a new instance with an instance transform, include the TRANSFORMS property and set the first transform in the list of transforms to the instance transform that changes the product code. Any customization transforms should follow the instance transform at the beginning of this list.
  • The easiest way to initiate a maintenance installation, and reinstall an instance, is to reference the product code of the instance. If you initiate the maintenance installation by using the package path, you must also specify the product code of the instance. From the command line, use the /n {Product Code} option. From code or script, use the MSIINSTANCEGUID property.

The following example shows installing a new instance from a command line where the instance transform is prefixed by a colon which specifies that the transform is embedded in the package.

msiexec /I mypackage.msi TRANSFORMS=:instance.mst MSINEWINSTANCE=1 /qb

The following example shows installing a new instance using MsiInstallProduct.

UINT uiStat = MsiInstallProduct(_T("path to mypackage.msi"), _T("TRANSFORMS=:instance.mst MSINEWINSTANCE=1"));

The following example shows installing the new instance from script.

Dim Installer As Object
Set Installer = CreateObject("WindowsInstaller.Installer")
Installer.InstallProduct "path to mypackage.msi", "TRANSFORMS=:instance.mst MSINEWINSTANCE=1"

The following example reinstalls an instance without re-caching the package. The instance is referred to by its product code {00000001-0002-0000-0000-624474736554}.

msiexec /I {00000001-0002-0000-0000-624474736554} REINSTALL=ALL REINSTALLMODE=omus /qb

The following example reinstalls an instance and re-caches the package from the command line. The instance is referred to by the package path. You are only required to include the /n {Product Code} option if the product is originally installed with an instance transform.

msiexec /I c:\newpath\mypackage.msi /n {00000001-0002-0000-0000-624474736554} REINSTALL=ALL REINSTALLMODE=vomus /qb

The following example reinstalls an instance and caches the package using MsiInstallProduct. The instance is referred to by the package path. Use the MSIINSTANCEGUID property to provide the product code of the instance.

UINT uiStat = MsiInstallProduct(_T("path to mypackage.msi"), _T("MSIINSTANCEGUID={00000001-0002-0000-0000-624474736554}  REINSTALL=ALL REINSTALLMODE=vomus"));

The following example reinstalls an instance and caches the package using script. Use the MSIINSTANCEGUID property to provide the product code of the instance.

Dim Installer As Object
Set Installer = CreateObject("WindowsInstaller.Installer")
Installer.InstallProduct "path to mypackage.msi", "MSIINSTANCEGUID={00000001-0002-0000-0000-624474736554}  REINSTALL=ALL REINSTALLMODE=vomus"

The following example shows how to advertise an instance using the command line.

msiexec /jm mypackage.msi /t :instance.mst /c /qb

The following example shows how to install to advertise an instance using MsiAdvertiseProductEx.

UINT uiStat = MsiAdvertiseProductEx(_T("path to mypackage.msi"), NULL, _T(":instance.mst"), 0, 0, MSIADVERTISEOPTIONS_INSTANCE);

The following example shows how to apply a patch to an instance from a command line. You are only required to include the /n {Product Code} option if the product was originally installed with an instance transform.

msiexec /p mypatch.msp /n {00000001-0002-0000-0000-624474736554} /qb

The following example shows how to apply a patch to an instance installation using MsiApplyPatch.

UINT uiStat = MsiApplyPatch(_T("path to mypatch.msp"), _T("{00000001-0002-0000-0000-624474736554}"), INSTALLTYPE_SINGLE_INSTANCE, _T("REINSTALL=ALL REINSTALLMODE=omus"));

For more information, see Installing Multiple Instances of Products and Patches and Authoring Multiple Instances with Instance Transforms.

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 05/31/2018
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。