Building WiX Projects In Team Foundation Build
Once you have created a WiX project file, you need to perform some additional steps in order to successfully build the WiX project in Team Foundation Build. Without these additional steps, the WiX project will be ignored by default by Team Foundation Build even though it is an MSBuild-compatible project.
Step 1: Update the Solution Build Configuration
By default, WiX projects will not be built when building the 'Any CPU' platform because Windows Installer packages are CPU-specific. As a result, you need to use the following steps to update the solution build configuration to include your WiX project and its dependencies as part of a Team Foundation Build.
- In the solution, open Configuration Manager (Build | Configuration Manager).
- Set the 'Debug' configuration as the active configuration.
- Select the 'x86' platform that you plan to build from the drop-down list.
- Ensure that the WiX project is checked in the 'Build' column.
- Ensure that any project references that the WiX project uses are also checked in the 'Build' column.
- Set the 'Release' configuration as the active configuration.
- Repeat steps 3-5 to ensure that the WiX project and its dependencies will build for the 'Release' configuration.
- If you plan to build the 'x64' platform, repeat steps 3-7 for the 'x64' platform.
- Close Configuration Manager and save the solution.
Step 2: Add the Build Configurations to TFSBuild.proj
Now that you have added the WiX project and its dependent projects to the 'x86' and/or 'x64' build configurations, Team Foundation Build will build your WiX project in these build configurations. However, these build configurations may not be specified in your Team Foundation Build Definition (TFSBuild.proj).
When you create a new Build Definition, you can select the 'Debug/Mixed Platforms' and 'Release/Mixed Platforms' build configurations to build all projects in your solution, including WiX projects.
If you have an existing Build Definition, you need to use the following steps to modify it so it will build WiX projects along with the other projects in your solution.
- Right-click on the Build Definition and select View Configuration Folder.
- Check out and open the file named TFSBuild.proj.
- Add the following build configurations to the <ConfigurationToBuild> section if they do not already exist there, or update them if they do already exist:
<ConfigurationToBuild Include="Debug|Mixed Platforms">
<FlavorToBuild>Debug</FlavorToBuild>
<PlatformToBuild>Mixed Platforms</PlatformToBuild>
</ConfigurationToBuild>
<ConfigurationToBuild Include="Release|Mixed Platforms">
<FlavorToBuild>Release</FlavorToBuild>
<PlatformToBuild>Mixed Platforms</PlatformToBuild>
</ConfigurationToBuild> - Close, save and check in the changes to TFSBuild.proj.
After making the above changes and queuing the build, you will see folders named 'Debug' and 'Release' in the build output. Each of these folders will contain a sub-folder named 'en-us' (or another culture depending on the settings in the WiX project) that contains the built Windows Installer package.