.vdproj Setup Projects and TFS Build 2010


So you’re using .vdproj setup projects are you?  And you want to automate them with TFS 2010?  Well, you’re in the right place, although I would recommend you start moving those setup projects to a msdeploy  solution.

First, to automate the building of .vdproj project, you’re going to need to write your own msbuild file because they are not in msbuild format and therefore TFS Build does not know what to do with them.  I found some good examples on the net on how to do this, but I updated mine a little for 2010.  Here it is:

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
  <Target Name="Build">
    <PropertyGroup>
            <DevEnv>$(ProgramFiles)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.com</DevEnv>
            <SolutionFile>$(MSBuildProjectDirectory)\MySolution.sln</SolutionFile>
            <ProjectFile>$(MSBuildProjectDirectory)\MySetupProject\MySetup.vdproj</ProjectFile>
            <Configuration>Release</Configuration>
    </PropertyGroup>
    <Exec
          Command="&quot;$(DevEnv)&quot; &quot;$(SolutionFile)&quot; /Rebuild &quot;$(Configuration)&quot;
          /Project &quot;$(ProjectFile)&quot; /ProjectConfig &quot;$(Configuration)&quot; /Log"
          ContinueOnError="false"
         IgnoreExitCode="false"
         WorkingDirectory="$(MSBuildProjectDirectory)" />
  </Target>
</Project>

After you’ve done that save the msbuild file as, for example, AutomatedSetupBuild.proj and add it to source control at the same level as the solution file you intend to build.  Then select it when you are creating your build definition.

One last thing on drops.  If you intend to create a drop, there is a twist.  TFS Build usually overwrites the “OutputPath” property in msbuild files to the “Binaries” folder on the build agent at build time.  Since the “OutputPath” property does not apply here, you will need to overwrite it in the .vdproj file.  Simply open the .vdproj file in a text editor and find the word “Release”.  Change the “OutputFilename” to “..\\..\\..\\Binaries\\*.msi”.  My .vdproj file had an “8:” prefixing the path which I simply left.

You’re done now.  Enjoy!

TFS Rangers have shipped Build Customization Guide


Saturday morning, the TFS Rangers (a group I’m involved with) published the RTM release of Rangers Build Customization Guide on Codeplex!

Project Description

This Visual Studio ALM Ranger project has the primary goal of delivering scenario based and hands-on lab guidance for the customization and deployment of Team Foundation Build 2010 activities such as versioning, code signing, and branching.

What is in the downloads?

  • Guidancecontains scenario based practical guidance, frequently asked questions and quick reference posters
    • Selected PDF contains guidance and quick reference posters in PDF format only.
    • Complete contains guidance, quick reference posters and localization files in all available formats.
  • Hands-on Labs (HOL)includes:
    • HOL documents that provide walkthroughs of the technology, based on the guidance
    • HOL Package contains a HOL environment setup package allowing you to setup the HOL environment in your own environment
    • BRDLite Build Process Reference Template walk-through.
  • Samples contains sample build process templates used by the team as part of the guidance.
  • Videos which showcase the guidance in quick 5-10min videos.

The Epics included in the guidance are:

  • Practical guidance and tooling to simplify the customization of Team Foundation Build
  • Practical guidance to use Team Foundation Build process templates to automate build and non-build scenarios in Microsoft environments
  • Practical guidance to enable simple and flexible deployment of applications and their data stores
  • Practical guidance for Activities to empower developers and build engineers
  • Quality hands-on labs that complement the guidance and effectively guide the user through the features
  • Visualization of the guidance using quick reference posters