I have two products Product1 & Product2. Product1 uses p1.dll & Product2 uses p2.dll.
I have defined separate ComponentGroups for them but in same wxs file (Groups.wxs).
I have included these ComponentGroups in separate Features F1 & F2 (Feature.wxs).
Then provided FeatureRef for F1 in Product1.wxs and F2 in Product2.wxs as shown below.
In my build system, I have either p1.dll or p2.dll in bin folder.
I have only p1.dll in bin folder when I build the installer for Product1.
However, when I build the installer for Product1, it throws - error LGHT0103: The system cannot find the file '..\bin\p2.dll'
Why should the wix linker look for p2.dll when I have not provided FeatureRef for F2 in Product1?
How can I resolve this?
Groups.wxs:
<ComponentGroup Id="G1">
<Component Id="C1" DiskId="1" Directory="BIN" Guid="xxxx">
<File Id="C1" Name="p1.dll" Source="..\bin\p1.dll" />
</Component>
</ComponentGroup>
<ComponentGroup Id="G2">
<Component Id="C2" DiskId="1" Directory="BIN" Guid="yyyy">
<File Id="C2" Name="p2.dll" Source="..\bin\p2.dll" />
</Component>
</ComponentGroup>
Features.wxs:
<Feature Id="F1" Title="Feature1" Level="1">
<ComponentGroupRef Id="G1" />
</Feature>
<Feature Id="F2" Title="Feature2" Level="1">
<ComponentGroupRef Id="G2" />
</Feature>
Product1.wxs:
<FeatureRef Id="F1" />
Product2.wxs:
<FeatureRef Id="F2" />
Product1.wixproj
<ItemGroup>
<WixCode Include="$(WixCodeDir)\Groups.wxs" />
<WixCode Include="$(WixCodeDir)\Features.wxs" />
<WixCode Include="$(WixCodeDir)\Product1.wxs" />
</ItemGroup>
Product2.wixproj
<ItemGroup>
<WixCode Include="$(WixCodeDir)\Groups.wxs" />
<WixCode Include="$(WixCodeDir)\Features.wxs" />
<WixCode Include="$(WixCodeDir)\Product2.wxs" />
</ItemGroup>