In Part 1: The Deployment Process Should Enforce Good Configuration Management Practices, I gave some background on my experiences and how the configuration management process has evolved and some rules and benefits to the automated deployment MSIs.
In Part 2: How to create an automated deployment MSI, I walked through the steps to create an automated deployment MSI in Visual Studio satisfying the rules from Part 1.
In Part 3, I am going to walk through the steps to install Team Deploy. Then walk through creating a team build, configure Team Deploy, and deploy a MSI with it.
There is also a great Screencast by Ian Ceicys walking through the entire process of installing TFS, WIX, Team Deploy and deploying a MSI. I highly recommend watching this.
<Import Project="$(MSBuildExtensionsPath)\TeamDeploy\TeamDeploy.Tasks.targets" />
Scroll to the bottom of the TFSBuild.proj file to the <PropertyGroup>. Overwrite the Property group with the following (Adjust the paths for your specific environment):
<PropertyGroup> <KillAppPathFilename>c:\Program Files\PSTools\pskill2.exe</KillAppPathFilename> <RemoteExecutePathFilename>c:\Program Files\PStools\psexec2.exe</RemoteExecutePathFilename> </PropertyGroup> <!-- Deploy MSI --> <Target Name="AfterEndToEndIteration"> <CallTarget Condition="'$(IsDesktopBuild)'!='true'" Targets="DeployMSITargetVirtuals" /> </Target> <Target Name="DeployMSITargetVirtuals"> <Deploy DeployScript="$(SolutionRoot)\..\..\Push Scripts\SampleDeploy.xml" KillAppPathFilename="$(KillAppPathFilename)" RemoteExecutePathFilename="$(RemoteExecutePathFilename)" TeamFoundationServerUrl="$(TeamFoundationServerUrl)" BuildUri="$(BuildUri)" /> </Target>
<PropertyGroup> <KillAppPathFilename>c:\Program Files\PSTools\pskill2.exe</KillAppPathFilename> <RemoteExecutePathFilename>c:\Program Files\PStools\psexec2.exe</RemoteExecutePathFilename> </PropertyGroup>
<!-- Deploy MSI --> <Target Name="AfterEndToEndIteration"> <CallTarget Condition="'$(IsDesktopBuild)'!='true'" Targets="DeployMSITargetVirtuals" /> </Target>
<Target Name="DeployMSITargetVirtuals"> <Deploy DeployScript="$(SolutionRoot)\..\..\Push Scripts\SampleDeploy.xml" KillAppPathFilename="$(KillAppPathFilename)" RemoteExecutePathFilename="$(RemoteExecutePathFilename)" TeamFoundationServerUrl="$(TeamFoundationServerUrl)" BuildUri="$(BuildUri)" /> </Target>
The copied Xml in the TFSBuild.proj should look something like this
The Deploy task uses a Xml Deploy Script that contains the information of what Msi(s) to deploy, additional tasks such as starting and stopping the service, and specifies the target machines. The following steps walks you through editing this file.
There are a few things to note here.
Once the TFSBuild.proj is checked in and the Deploy script is saved (or also checked in), then you can right click on the build and do a queue new build. The MSI will be deployed to your target machine(s).
See the Troubleshooting / FAQ section of Team Deploy or contact me if you have any questions or problems.
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.