Inside the Microsoft® Build Engine: Using MSBuild and Team Foundation Build

I’m proud to say that after many months of work Sayed Ibrahim Hashimi and I have completed work on Inside the Microsoft® Build Engine: Using MSBuild and Team Foundation Build (PRO-Developer). It is being published by Microsoft Press and is due out on 7th January 2009.

TFS 2008 Service Pack 1 Bug Fixes

Brian Harry has published a list of bug fixes that shipped in TFS 2008 Service Pack 1. What I also found interesting from this list is the breakdown of where different bugs were detected or reported.

Hands-Free TFS 2008 Install

Grant Holliday posted an almost hands-free TFS 2005 installation guide and I have been going through the same process for TFS 2008 so I thought I’d point out a few differences to be aware of as well as some amendments I made to Grant’s original process:

Part 2 - Building the ISO

  • The obvious changes:
    • Replace TFS 2005 with TFS 2008.
    • Remove TFS 2005 SP1 Quiesce Hotfix and TFS 2005 SP1.
    • Replace Team Plain with Team System Web Access.
    • Replace Visual Studio Team Editions / Team Suite 2005 with Visual Studio Team Editions / Team Suite 2008.
    • Remove Team Suite 2005 SP1.
  • I pre-extracted SQL Server 2005 Service Pack 2 to reduce the time taken to install:
    • SQLServer2005SP2-KB921896-x86-ENU.exe -x <TargetDir>
  • WSS is no longer required separately because it is automatically installed by TFS 2008.
  • Added TFS 2008 Power Tools.
  • Added TFS 2008 Installation Guide.
  • Added Office 2007 and Project 2007 (for building clients).
  • Edit TFS08\SQL2005ForATDT.ini and update the service account credentials.

My resulting directory structure was:

image

Part 3 - Installing Team Foundation Server unattended

  • I updated Grant’s script:
    • To reflect the changes above.
    • Added an INSTALLROOT environment variable in case you aren’t installing from D:\.
    • Added a TFSBUILDS user to run Team Build as.
    • Created users locally rather than in the domain (this was my requirement, if you want domain users simply add the /DOMAIN switch to the net user commands).

SET INSTALLROOT=D:\
SET TFSSERVICEPW=strongpassword
SET TFSREPORTSPW=strongpassword
SET TFSBUILDSPW=strongpassword
:: ############# User accounts
net user TFSSERVICE %TFSSERVICEPW% /ADD /EXPIRES:NEVER
net user TFSREPORTS %TFSREPORTSPW% /ADD /EXPIRES:NEVER
net user TFSBUILDS %TFSREPORTSPW% /ADD /EXPIRES:NEVER
ntrights -u TFSSERVICE +r SeInteractiveLogonRight
ntrights -u TFSREPORTS +r SeInteractiveLogonRight
ntrights -u TFSBUILDS +r SeInteractiveLogonRight
pause
:: ############# SQL 2005
:: # Run SQL2005 setup unattended
start /wait %INSTALLROOT%SQL05\Servers\setup.exe /qb /settings %INSTALLROOT%TFS08\SQL2005ForATDT.ini
pause
:: # Stop SQLBrowser service before SP2 install
sc stop SQLBrowser
sc config SQLBrowser start= auto
:: # Run SQL2005 SP2 unattended
start /wait %INSTALLROOT%SQLSP2\hotfix.exe /quiet /allinstances
:: # NOTE: I had an issue where after the service pack was applied the service account no longer had sysadmin access and this had to be rectified before continuing.
pause
:: ############ TFS Single-Server install
start /wait %INSTALLROOT%TFS08\at\setup.exe
pause
:: ############ VSTS install
start /wait %INSTALLROOT%VSTS08\setup.exe
pause
:: ############ TFS Team Explorer
start /wait %INSTALLROOT%TFS08\tfc\setup.exe
pause
:: ############ Team Build install
start /wait %INSTALLROOT%TFS08\BUILD\setup.exe
pause
:: ############ Team System Web Access
msiexec /i %INSTALLROOT%TFS08WA\TeamSystemWebAccess.msi /passive
pause
:: ############ Team System Power Tools
msiexec /i %INSTALLROOT%TFS08PT\tfpt.msi /passive
pause

Visual Studio Hotfixes

Brian Harry has blogged about the MSDN Code Gallery web site which not only contains numerous code samples and add-ins but is also used to publish the Visual Studio hotfixes.

Modifying SQL Server 2005 Answer File To Use Network Service Account

When installing SQL Server 2005 using the answer files provided on the Team Foundation Server 2008 media one of the steps is to modify the answer file to specify which accounts you want to run the various SQL Server 2005 components as. In a number of scenarios you may want to use the built-in Network Service account instead of a “real” service account.

To do this you need to replace the following section:

;Security Context of service accounts
SQLBROWSERACCOUNT=”MyDomain\MyServiceAccount”
SQLBROWSERPASSWORD=”MyPassword”
SQLACCOUNT=”MyDomain\MyServiceAccount”
SQLPASSWORD=”MyPassword”
AGTACCOUNT=”MyDomain\MyServiceAccount”
AGTPASSWORD=”MyPassword”
ASACCOUNT=”MyDomain\MyServiceAccount”
ASPASSWORD=”MyPassword”
RSACCOUNT=”MyDomain\MyServiceAccount”
RSPASSWORD=”MyPassword”

With:

;Security Context of service accounts
SQLBROWSERACCOUNT=”NT AUTHORITY\NETWORK SERVICE”
SQLACCOUNT=”NT AUTHORITY\NETWORK SERVICE”
AGTACCOUNT=”NT AUTHORITY\NETWORK SERVICE”
ASACCOUNT=”NT AUTHORITY\NETWORK SERVICE”
RSACCOUNT=”NT AUTHORITY\NETWORK SERVICE”

Unattended Installation of Team Foundation Server Power Tools

If rolling the Team Foundation Server Power Tools out to a number of users (which you will need to do if you want to use the check-in policies) you will probably want to run the installation unattended.

There are two tricks:

  1. You will need to uninstall the previous version. To do this run:
    msiexec.exe /x /qn {C802488F-CB5F-48BE-BBD2-0C0F9E290E63}
    /x specifies that we are doing an uninstall
    /qn specifies that we want no user interface
    {C802488F-CB5F-48BE-BBD2-0C0F9E290E63} is the Product Code for the Team Foundation Server Power Tools
  2. Then you need to install the latest version. To do this run:
    msiexec.exe /i /qb tfpt.msi ADDLOCAL=CLI,VSIP,CHECKINPOLICIES
    /i specifies that we are doing an install
    /qb specifies that we want a basic user interface (just a progress bar)
    tfpt.msi is the path to the tfpt.msi to be installed
    ADDLOCAL=CLI,VSIP,CHECKINPOLICIES specifies that we only want to install tfpt.exe, the Visual Studio add-in, and the check-in policies (we leave out the Best Practices Analyzer [BPA] and the Process Editor [PROCESSEDITOR] because most users don’t need these and they have dependencies on PowerShell and the DSL Runtime respectively)

I used dark.exe from the WiX Toolkit to determine the ProductCode and thanks must go to Hua Chen from Microsoft for helping out with how to exclude the Best Practices Analyzer and the Process Editor.