Search code examples
msbuildinstallshield

How to set ProductCode for InstallShield instance transforms


I can set the product code for a single instance installer with MSBuild like this:

<ItemGroup>
    <InstallShieldPropertyOverrides Include="{$(Guid)}">
         <Property>ProductCode</Property>
    </InstallShieldPropertyOverrides>
</ItemGroup>

How do you set the instance 1 product code? Is this possible? If not, then what is an appropriate way to set the product code on each instance transform when using automated builds?


Solution

  • Realistically your best bet is likely to be using Windows Installer or XML automation to edit the project file. This scenario is so specialized and so likely to cause you update problems in the future that InstallShield does not support it directly.

    To figure out what you need to change, save a copy of your project, and add or update the instance transforms by hand. Then use MsiDiff or a textual diff (depending on whether you're using binary or XML projects), to identify how the project database is modified, and figure out how to implement equivalent changes automatically.