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.