Recently I had to configure companies Team Foundation Server to produce installers for the applications we are working on. Task seemed pretty straightforward at first, but then I realized that build definition for VSTS Team build won’t build a solutions setup project. Sometime later, however it was still possible to convince him to do so. Here is a quick walkthrough:

  1. 1. In solution properties enable build checkbox for the Release configuration for the setup

  2. 2. Create a build definition as you normally would.
  3. 3. Open the build definition project file (TFSBuild.proj) from source control and put following directive just before the end tag:
    <Target Name="AfterCompile">
    <Exec Command="&quot;$(ProgramFiles)\Microsoft Visual Studio 9.0\
    Common7\IDE\devenv&quot;
    &quot;$(SolutionRoot)\Setup\Main\Corres\CorresSetup\CorresSetup.vdproj
    &quot; /Build
    &quot;RELEASE|Any CPU&quot;"
    /> <Copy SourceFiles="$(SolutionRoot)\Setup\Main\Corres\CorresSetup\
    Release\CorresSetup.msi ;
    $(SolutionRoot)\Setup\Main\Corres\CorresSetup\Release\setup.exe"

    DestinationFolder="$(OutDir)" /> </Target>
  4. 4. Check in the changes