Use WIX to install side by side versions of the same IIS site

老子叫甜甜 提交于 2019-12-06 13:15:51

Windows Installer supports installing multiple instances via instance transforms. Essentially, you can install the package with new product code upgrade codes, and the different products can be managed individually.

You add an InstanceTransforms element to your package, and add a child Instance element for each custom instance you want to support in addition to the default instance:

<InstanceTransforms Property="INSTANCEID">
    <Instance Id="P1" ProductCode="GUID1" UpgradeCode="GUID2" ProductName="My App P1" />
    <Instance Id="P2" ProductCode="GUID3" UpgradeCode="GUID4" ProductName="My App P2" />
</InstanceTransforms>

This allows you to install up to three copies: the default instance, plus instances P1 and P2. To install each, use one of these commands:

msiexec /i MyApp.msi
msiexec /i MyApp.msi MSINEWINSTANCE=1 TRANSFORMS=":P1"
msiexec /i MyApp.msi MSINEWINSTANCE=1 TRANSFORMS=":P2"

Then on your non-file components, add the Component/@MultiInstance="yes" attribute. This will create a new component guid for each transform, so you can install multiple copies of the component (one for each transform).

This blog post "Revisited: Multiple Instance installations and patches" describes using the InstanceTransforms element and the Component/@MultiInstance attribute in more detail.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!