James R
James R

Reputation: 155

WIx burn project dependencies don't build

In Visual Studio 2013 I have two WIX 3.10 projects. The first a "Bootstrapper" project called "ProgramABundle". The second is a a "Setup" project called "ProgramAInstaller". ProgramABundle depends on the output of ProgramAInstaller to be present to work properly. Within the Visual Studio solution I've specified that the ProgramABundle depends on ProgramAInstaller, and I've added a ProgramAInstaller project reference to the ProgramABundle project.

However when I right click on the ProgramABundle and choose "Build" or "Rebuild", ProgramAInstaller does not get built, even when it's output is empty. How do I force ProgramAInstaller to build whenever the ProgramABundle is built?

Note that I don't really want to set up the configuration to always build the ProgramABundle and ProgramAInstaller, but I know that I can do that if I have to.

Upvotes: 1

Views: 540

Answers (1)

Zhanglong Wu - MSFT
Zhanglong Wu - MSFT

Reputation: 1660

How do I force ProgramAInstaller to build whenever the ProgramABundle is built?

You can use exec method to execute msbuild command before you build project named ProgramABundle. please right click project named ProgramABundle -> unload project -> right click project named ProgramABundle -> Edit ProgramABundle.wixproj, then add the following code in your wixproj file.

<PropertyGroup>
    <MsbuildExe>"$(MSBuildToolsPath)\msbuild.exe"</MsbuildExe>
    <InstallerProject>"related path\ProgramAInstaller.wixproj"</InstallerProject>
  </PropertyGroup>

  <Target Name="BeforeBuild">
    <Message Text="$(MSBuildToolsPath)" />
    <Exec Command="$(MsbuildExe) $(InstallerProject)"/>
  </Target>

Upvotes: 1

Related Questions