Continuous Learning and Sharing of Team Foundation Server and Application Lifecycle Management RSS 2.0
# Tuesday, November 03, 2009

I am going to giving two Getting Agile with Team Foundation Server 2010 talks in November, both in Omaha, NE.  On Thursday November 12th, I will be giving the talk for a lunch and learn at Advanced Network Technologies.  You can register for the event here.  On November 24th, I will be giving the talk at the Omaha Team System User Group Meeting.  Here is more information about the event and registration instructions.

This is the same talk as the one I gave at the Heartland Developer Conference in October but I will be using Beta 2 for these two.  Here’s some more details on the presentation and myself.  I look forward to seeing everyone there.

Presentation: Getting Agile with TFS 2010

This presentation will demonstrate a complete two week scrum iteration from the planning meeting to development, testing, and bug fixing to deployment utilizing the features found in Team Foundation Server 2010. New features include gated check-ins for Continuous Integration (CI), Test-Driven Development (TDD), Product Backlog enhancements including hierarchical views and support for multiple teams to work from a single backlog. The presentation also demonstrates the enhancements to the TFS Portal and Web Access to support Agile planning and displaying graphs such as burn-down charts. Each walk through includes a live demonstration of the feature in Visual Studio 2010.

Speaker: Mike Douglas, Deliveron Consulting Services

Mike Douglas is a Solution Consultant at Deliveron Consulting Services where he provides end-to-end solutions and TFS installation, configuration, and custom development for clients.  He has over 11 years experience building enterprise level applications on a variety of .NET technologies including WCF, Web Services, ASP.NET, Disconnected Smart Clients and Data Synchronization, BizTalk, and Team Foundation Server.  Mike enjoys trying to keep up with the constant change and evolution of .NET.  Mike is an experienced presenter having spoken at several Omaha .NET User Group meetings on CSLA.NET, Subsonic, and TFS.  He also spoke at the 2008 ESRI International User Conference on a GIS integration project he helped lead. Mike actively maintains the open source project, Team Deploy, on CodePlex for deploying MSIs using Team Foundation Server.  Mike also enjoys sharing his experiences in Code Generation, CSLA.NET, and TFS on his blog at www.CodeSmartNotHard.com.

Tuesday, November 03, 2009 3:42:00 AM (Central Standard Time, UTC-06:00)  #    Comments [0] -
Agile | Team Foundation Server | TFS 2010

# Tuesday, October 20, 2009

Visual Studio 2010 and TFS 2010 beta 2 were just released on Monday and there is already an incredible amount of information available.   It is hard to keep up with all of the information.   I created a list of some of the links to posts and downloads I have found and others have tweeted about.  I’m sure I missed some.  Let me know if there are any links I missed that you want me to add to the list.

Downloads

Download Visual Studio 2010 Beta 2
http://msdn.microsoft.com/en-us/default.aspx

Visual Studio 2010 and .NET Framework 4 Training Kit - October Preview
http://www.microsoft.com/downloads/details.aspx?familyid=752CB725-969B-4732-A383-ED5740F02E93&displaylang=en

Team Foundation Installation Guide for Visual Studio Team System 2010 (Updated)
http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=2d531219-2c39-4c69-88ef-f5ae6ac18c9f

Visual Studio Team System 2008 Service Pack 1 Forward Compatibility Update for Team Foundation Server 2010 (Installer)
http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=cf13ea45-d17b-4edc-8e6c-6c5b208ec54d

 

Multimedia

10-4 Episode 33: Downloading and Installing Visual Studio 2010 Beta 2
http://channel9.msdn.com/shows/10-4/10-4-Episode-33-Downloading-and-Installing-Visual-Studio-2010-Beta-2/

Radio TFS - The Ultimate Announcement Show
http://www.radiotfs.com/2009/10/19/TheUltimateAnnouncementShow.aspx

 

Visual Studio Blog Posts

Somasegar - Announcing Visual Studio 2010 and .NET FX 4 Beta 2
http://blogs.msdn.com/somasegar/archive/2009/10/19/announcing-visual-studio-2010-and-net-fx-4-beta-2.aspx

Scott Guthrie - VS 2010 and .NET 4.0 Beta 2
http://weblogs.asp.net/scottgu/archive/2009/10/19/vs-2010-and-net-4-0-beta-2.aspx

Shai Raiten - Historical Debugger Is Now –> IntelliTrace And Much More
http://blogs.microsoft.co.il/blogs/shair/archive/2009/10/20/historical-debugger-is-now-gt-intellitrace-and-much-more.aspx

Jeff Bramwell - Visual Studio 2010 – Beta 2 Released
http://devmatter.blogspot.com/2009/10/visual-studio-2010-beta-2-released.html

Duke Kamstra - What’s new for Data Dude in Visual Studio 2010?
http://blogs.msdn.com/vstsdb/archive/2009/10/19/what-s-new-for-data-dude-in-visual-studio-2010.aspx

Emil Protalinski - Visual Studio 2010 simplified to four SKUs, Beta 2 arrives
http://arstechnica.com/microsoft/news/2009/10/visual-studio-2010-simplified-to-four-skus-beta-2-arrives.ars

Jeff Beehler - “Going live” with Visual Studio 2010 Beta 2
http://blogs.msdn.com/jeffbe/archive/2009/10/19/going-live-with-visual-studio-2010-beta-2.aspx

 

TFS Blog Posts

Buck Hodges - TFS 2010 server licensing: It's included in MSDN subscriptions
http://blogs.msdn.com/buckh/archive/2009/10/20/tfs-2010-server-licensing-it-s-included-in-msdn-subscriptions.aspx

Allen Clark - Enabling New Application Lifecycle Management Features for Visual Studio 2010 Beta 2 in Upgraded Team Projects
http://blogs.msdn.com/allclark/archive/2009/10/13/enabling-new-application-lifecycle-management-features-for-visual-studio-2010-beta-2-in-upgraded-team-projects.aspx

Martin Hinshelwood - Installing Visual Studio 2010 Team Foundation Server on Windows Vista in 3 minutes
http://blog.hinshelwood.com/archive/2009/10/20/installing-visual-studio-2010-team-foundation-server-on-windows-vista.aspx

Martin Hinshelwood - Configuring Visual Studio 2010 Team Foundation Server on Vista in 12 minutes
http://blog.hinshelwood.com/archive/2009/10/20/configuring-visual-studio-2010-team-foundation-server-on-vista-in.aspx

Compatibility Matrix for 2010 Beta 2 Team Foundation Server to Team Explorer 2008 and 2005
http://blogs.msdn.com/teams_wit_tools/archive/2009/10/19/compatibility-matrix-for-2010-beta-2-team-foundation-server-to-team-explorer-2008-and-2005.aspx

Tuesday, October 20, 2009 5:42:00 PM (Central Daylight Time, UTC-05:00)  #    Comments [0] -
TFS 2010

Here are the slides from my An Iteration in the Life of an Agile Team with Team System 2010 talk at the 2009 Heartland Developer Conference.  Thanks for everyone that attended.  I had a great time giving the talk and at the rest of the conference.

http://www.codesmartnothard.com/content/binary/agile_vsts2010.zip

If you didn’t get a chance to attend my talk, I am going to be giving the presentation again (This time with beta 2!) at the next Omaha Team System User Group meeting on November 24th.  Check out the Omaha Team System User Group website for more details.

Thanks!

Mike

Tuesday, October 20, 2009 4:15:00 AM (Central Daylight Time, UTC-05:00)  #    Comments [0] -
Agile | HDC | Team Foundation Server | TFS 2010

# Saturday, September 26, 2009

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.

Installing PS Tools

  • Team Deploy uses the free PSExec and PSKill utilities by Sysinternals (owned by Microsoft).  PSExec allows you to remotely run any command and PSKill can kill any process on a local or remote machine.
  • Download PSTools at http://technet.microsoft.com/en-us/sysinternals/bb896649.aspx and install to a local folder.  I also recommend renaming psexec and pskill to something like psexec2.exe.  Some anti-virus software sees these files as a risk.

 

Installing Team Deploy

  • Browse to the Team Deploy website on CodePlex at http://TeamDeploy.CodePlex.com
  • Click on the Downloads and download the TeamDeploy.MSI.
  • Run the MSI to install Team Deploy to c:\Program Files\MSBuild\TeamDeploy
  • The windows service account that runs Team Build on the build server will need to be a local administrator on all target machines.

 

Creating a Team Deploy TFS Build

  • In Team Explorer, create a new build in your Team Project by right clicking on Builds and choosing “New Build Definition”

New Build Definition

 

  • Give it a name such as “Build and Deploy”
  • Create a workspace (Cloak other folders in your project that don’t need to be part of the build. This helps the speed up your build because otherwise the server will try to get all source files in the project)
  • Leave Project File name as is but click on the “Create” button to create a new TFSBuild.proj file.
  • Next choose the solution you want to build, then the configuration type. I recommend leaving the default.
  • Choose any options that you want to enable for running tests and/or code analysis. I would recommend leaving these unchecked for now and once you verify everything is working then go back and enable the options you want.
  • In TFS 2008, you can choose retention policies. This will help prevent builds from filling up your server disk space quickly. I usually choose Keep 7 latest.
  • the next options are for the Build Defaults. Choose the appropriate build agent. If unsure, just leave the default. Then choose the share where you want to copy the staging files.
  • The last option is “Trigger”. The "build and deploy" build should be separate from the continuous integration build. I recommend leaving the default “Check-ins do not trigger a new build”.

 

Build Trigger

 

  • Finally click “OK” to create the build type.

Creating the build definition will create the TFSBuild.proj that contains the basic options that were selected in the wizard. The following steps will customize the TFSBuild.proj file created. This file is a Xml file based on MSBuild.
  • To modify the TFSBuild.proj file, located the file under Source Control -> $/YourTeamProject/TeamBuildTypes/Build and Deploy (You can also navigate directly to this file by right clicking on the build definition and choosing "View Configuration Folder".)
  • Check out and open the TFSBuild.proj file to configure it to use Team Deploy
  • Find the comment <!—Do not edit this -> and add the following line underneath the one that is already there. It should look something like the screenshot below

<Import Project="$(MSBuildExtensionsPath)\TeamDeploy\TeamDeploy.Tasks.targets" />

AddTeamDeployProject.jpg

 

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>

The copied Xml in the TFSBuild.proj should look something like this

FinishedTFSBuild.jpg

  • Save and check-in the TFSBuild.proj file


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.

DeployScript.jpg

 

There are a few things to note here.

  • Team Deploy can
    • Kill 0 to many processes
    • Deploy/Uninstall 0 to many MSIs
    • Deploy MSIs to 0 to many Target Machines
  • Modify the xml appropriately for your environment. The GUID for the uninstalls are the MSI product codes. If the MSI is done correctly it will uninstall previous versions using the upgrade code, however they are usually unable to remove the same version of the MSI, this is why we have the separate step of uninstall.
  • The ExtraArgs element contains the SETUPENV variable that is used by the MSI’s custom action to copy the correct environment’s config file to the project’s. The custom action is a simple VBScript that copies the config file (not included with Team Deploy). See Part 2 for more details on creating the config files folder structure.

 

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.

Saturday, September 26, 2009 1:16:00 PM (Central Daylight Time, UTC-05:00)  #    Comments [0] -
Team Build | Team Deploy | Team Foundation Server

# Wednesday, August 26, 2009

Team Deploy is a free set of custom Team Build tasks for deploying MSIs to client PCs and servers.  Team Deploy 2.1 has been released and includes a number of fixes and a couple new features.

A special thanks to Jeremy Novak for creating the new CleanupPsExec task and multiple other fixes.  Here is the list of the changes:

  • Moved Guidance and Installation from Word document to wiki site (and created a Troubleshooting section)
  • Added -accepteula to all pstools calls so it won’t display the EULA dialog the first time it runs
  • Added new CleanupPsExec task and test to clean up the PSTools service if it becomes stuck.
  • Fixed spelling error in RemoteExecute task
  • Added support to uninstalling 32bit apps on Windows 2008 64bit servers
  • Changed property declarations to be auto-implemented
  • Updated task required properties to have the Required attribute
  • Created Team Deploy Installation Screencast
  • Other misc fixes.

Team Deploy 2.1 can be found on CodePlex at http://teamdeploy.codeplex.com/.

-Mike

Wednesday, August 26, 2009 2:49:00 AM (Central Daylight Time, UTC-05:00)  #    Comments [0] -
Team Build | Team Deploy | Team Foundation Server

# Monday, August 17, 2009

Today I completed the installation of Team Foundation Server 2010 beta 1.  I had previously started a couple times and run into a couple issue (mostly time) but didn’t get a chance to finish.  Tonight I finally worked through a couple issues and completed it.  I kept a few notes of the issues I encountered and what I did to resolve them.  If you run into any of these errors, I hope they help.

TFS Configuration Wizard Readiness Checks

When the configuration wizard completed, I had errors in Reporting Check and SharePoint Check.

Reporting

Here is the error

TF255275: The following Web service for SQL Server Reporting Services could not be accessed: http://myserver/ReportServer/ReportService2005.asmx

Problem was I installed Report Services in Integrated Mode.  It only supports Native.

Here are the steps to fix the error:

1. Deleted the ReportServer databases
2. Recreated the ReportServer database in Native mode.

SharePoint

We are planning on using this server for multiple things and we installed SharePoint 2007 on before I started the installation of TFS 2010 beta 1.  I thought that TFS would simply install the extensions to any compatible SharePoint installation on the server.  Apparently, TFS must install and configure SharePoint on the machine before the verification will allow you to continue. 

Here is the error

TF255282: Windows SharePoint 3.0 cannot be installed error on server.  The program is already installed on this server.

The fix is easy.  Simply, go to Add/Remove programs and uninstall.   However I do want MOSS 2007 to be install on it.  Once, I have a backup made after VSTS 2010 finishes installation.  I am going to try uninstalling WSS 3 and reinstalling MOSS 2007.

 

image

After fixing these two bugs, the Readiness Checks completed successfully.  Clear sailing from here?  Not quite.   When the configuration tool completed, it displayed the following error.

Windows NT user or group '.\tfsservice' not found. Check the name again.

Installation log details:

TF255356: The following error occurred when configuring the Team Foundation databases: Error occurred while executing servicing step Setup Warehouse for component TfsWarehouse during Install: Windows NT user or group '.\tfsservice' not found. Check the name again.. For more information, see the configuration log. (Error occurred while executing servicing step Setup Warehouse for component TfsWarehouse during Install: Windows NT user or group '.\tfsservice' not found. Check the name again.) ---> Microsoft.TeamFoundation.Framework.Server.CollectionServicingException: Error occurred while executing servicing step Setup Warehouse for component TfsWarehouse during Install: Windows NT user or group '.\tfsservice' not found. Check the name again. ---> System.Data.SqlClient.SqlException: Windows NT user or group '.\tfsservice' not found. Check the name again.

The system allowed me to enter a dot for the server name instead of the actual server name and then display the error.  I would classify this more as a user error but it would be nice to prevent or allow configuration tool, to lookup the actual server so it will complete.  I logged an error with Connect.  I will see how they rate it.

For the fix, fortunately I took a snapshot of server right before I ran this.  I restored to the previous step and restarted the configuration tool.   For the service name, I entered: <myserver>\TFSService and everything worked.

image

It finally completed with a Success message!!!  

While I have been typing this, I started the TSVS 2010 Beta 1 Installation.  It is really slow (knock on wood), but so far it hasn’t caused any errors.

 

Thanks,

Mike

Monday, August 17, 2009 5:01:00 AM (Central Daylight Time, UTC-05:00)  #    Comments [3] -
Team Foundation Server | TFS 2010

# Thursday, July 30, 2009

Note:  I slightly changed the title from TFS Deployments to Deployments with TFS in case there was any confusion about whether this is about deploying TFS or doing deployments with TFS.

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 this Part, I will walk through the steps to create an automated deployment MSI in Visual Studio 2008 satisfying the rules from Part 1.    In this example I will build the MSI for a windows service that will auto assign the username and password.

The first few steps are standard steps for building the MSI.  Then the steps get more interesting when it starts getting into to the automated deployment settings.

Step 1:  Add the Setup Project to existing solution

To add the setup project to the solution, choose “Add New Project” > Other Project Types > Setup Project.

image

 

Step 2:  Add Project Output to MSI

Add the required files for the deployment by adding the project output of the primary project.  To the project output, right click on the setup project in the solution explorer  > View > Project Output.  A dialog box similar to the one below will appear.  Verify that the windows service project is the selected project in the combo box.  Choose Primary Output and click OK.

image

 

Step 3:  Add Custom Actions

Next add the Primary output as a Custom action for the install, uninstall, etc.  To do this, right click on the Custom Actions > Add Custom Action > Application Folder > Primary Output from <your project>.

image

Step 4:  Add Installer to Windows Service project

In the Windows Service project, add an Installer class by double clicking on the Service component to view the designer.  In the Properties window (usually) at bottom right corner, there will be a link to “Add Installer” similar to the image below.  This creates the project installer class containing the service installer and the process installer.  We will be modifying these in some later steps.

image

Step 5:  Create the environment config files and folders in the windows service and add them to the MSI.

If the solution had multiple projects, I usually create a separate project for the config files.  Here I will create the folders in the same project. Create the folders and files as shown below.  Basically environment’s config file will be stored here and checked into source control.  To add these to the MSI, go to the properties of each config file and change the Build Action to Content.  Now go back to the MSI, right click on the project > Add > Project Output > Content Files to add these.

image

Step 6:  Create Custom Action to copy the selected config file to the application folder

Now that environment configs are in the ConfigFiles folder, the selected one needs to be copied to Application folder.  To do this we need to create a custom action.  This is in VBScript but eventually I want to create these custom actions as a helper class in Team Deploy.  To create the custom task, the actual file needs to be created outside the MSI.  I have created a CustomActions folder in the windows service project.   In there I added a copyconfig.vbs file.  This custom action is going to need two values passed into it.  One is the environment and the other is TargetDir.  I couldn’t figure out a way to get current folder inside for the vbscript so I found it easier to just pass it in.  To pass in values into the custom action the name/value pairs are passed into the CustomActionData property.  Also since this is going to overwrite the current app.config files, exclude the app.config by clicking on the Primary Output > Exclude > Add for *.config.

Here is the code for the copyconfig.vbs file.  After you copy and paste this into the vbs file.  Save it and in the properties, change the Build Action to None.   We do not want this copied to the MSI output like the config files. 

on error resume next
dim paramsList
paramsList = split(session.property("CustomActionData"), ",")
dim param1
dim param2

param1 = paramsList(0)
param2 = paramsList(1)

dim filesys
dim path

path = param2 & "configfiles\" & param1 & "\"

dim strEvn, objFile, strLogFile

Set objShell = CreateObject("Wscript.Shell")
strEnv = objShell.ExpandEnvironmentStrings("%temp%")
strLogFile = strEnv & "\MSIInstallLog.txt"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(strLogFile, 8, True)

objFSO.CopyFile path & "*.config", param2, true

if err.number > 0 then
    objFile.WriteLine Now & "::CopyConfigs - " & param1 & err.Description
else
    objFile.WriteLine Now & "::CopyConfigs - Completed Successfully."
end if

objFile.Close

Now add the Custom Action to the MSI by right clicking on the project > View > Custom Actions.  We only want this to run during the installation process, so right click on Install > Add Custom Action > Application Folder > Add File > Browse to Copyconfig.vbs and click OK.  Notice in the setup project that the copyconfig.vbs has the no sign icon on it so it isn’t copied to the application folder.

Next we need to pass in the the values into the Custom Action.  Click on the Copyconfig.vbs in the Custom Actions view.  In the properties window, set CustomActionData = [ENV],[TARGETDIR]. 

Repeat the steps above for AssignService.vbs.   Set CustomActionData = [USR],[PWD],"SampleService"

on error resume next

dim param

param = split(session.property("CustomActionData"), ",")

if len(param(0)) > 0 then

    dim strEvn, objFile, strLogFile

    Set objShell = CreateObject("Wscript.Shell")
    strEnv = objShell.ExpandEnvironmentStrings("%temp%")
    strLogFile = strEnv & "\MSIInstallLog.txt"
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFile = objFSO.OpenTextFile(strLogFile, 8, True)
    ' ------ SCRIPT CONFIGURATION ------
    strUser     = param(0)
    strPassword = param(1)      
    strSvcName  = cstr(replace(param(2), chr(34), ""))
    strComputer = "."    
    ' ------ END CONFIGURATION ---------
    set objWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
    set objService = objWMI.Get("Win32_Service.Name='" & strSvcName & "'")
    intRC = objService.Change(,,,,,,strUser,strPassword)
    if intRC > 0 then
       objFile.WriteLine Now & "::" & strSvcName & " - " & "Error setting service account: " & intRC
    else
       objFile.WriteLine Now & "::" & strSvcName & " - " & "Successfully set service account"
    end if
    if err.number > 0 then
        objFile.WriteLine Now & "::" & strSvcName & " - " & err.Description
    end if
    objFile.Close

end if

This custom action finds the “SampleService” and changes the username and password.  I had to use the service name literal.  There wasn’t anything I could find where I could use a dynamic value.

Step 7:  Modify Project Installer to handle interactive and silent modes

One of the requirements is that the MSI needs to work when using the wizard and when specifying parameters when installing from the command line or remote utility.  Therefore when the user is installing the MSI through the wizard (we will create this in the next step)   it needs to prompt for the user and password.  This is accomplished by setting the service account of the installer to LocalSystem so it won’t prompt but if the username isn’t passed in it switches the service account to User.  This will then prompt the user.

To implement this, add the following code to the ProjectInstaller.

private string GetContextParameter(string key)
{
    string sValue = "";

    try
    {
        sValue = this.Context.Parameters[key].ToString();

    }
    catch
    {
        sValue = "";
    }

    return sValue;
}       

// Override the 'OnBeforeInstall' method.       
protected override void OnBeforeInstall(IDictionary savedState)
{
    try
    {
    base.OnBeforeInstall(savedState);
    string username = GetContextParameter("usr").Trim();

        if (username == "")
        {
            serviceProcessInstaller1.Account = System.ServiceProcess.ServiceAccount.User;
        }
    }
    catch(Exception e)
    {

  }
}

private string getvalues()
{
    string all = "";

    foreach (DictionaryEntry value in this.Context.Parameters)
    {
        all += value.Value.ToString() + ",";
    }
    return all;
}

Step 8:  Add step to wizard to specify the Environment.

In addition to prompting the user for the user and password, the MSI needs to prompt the user for the environment.  To add a form to the Wizard.  Right click on the setup project > View > User Interface.  Then right click on Start (as shown) and the click Add Dialog.  In this example we have 3 environment, so choose the RadioButtons (3 Buttons) and press Ok.

image

The Dialog window appears below the Confirm Installation box.  If you build the setup project you will notice the warning, “All custom dialogs must precede the 'Installation Folder' dialog”.  Therefore, click on the up arrow twice to move the RadioButton dialog window  above the Installation folder.  Now click on the dialog and view the Properties window.  There are several empty properties we need to set.  Set the following to something similar to these values:

  • BannerText = “Choose Environment”
  • BodyText = “Please select an environment from the list.”
  • Button1Label = “Production”
  • Button1Value = “Prod”
  • Button2Label = “Test”
  • Button2Value “Test”
  • Button3Labal = “Development”
  • Button3Value = “Dev”
  • ButtonProperty = “Env”
  • DefaultValue = “Prod”

 

Step 9:  Change build type to loose uncompressed files

The last step is to change the Package Files option under the setup project’s properties from “In setup file” to “As loose uncompressed files.  You will need to do this for each configuration in the project.

image

 

These are all of the steps.  I hope it helps.  Attached below is the sample solution with the setup project hosted on the MSDN Code Gallery.  You may use this however you would like.  Now that you know how to build the MSI, it is time to deploy it.  I will walk through that in the next post.

Sample Automated Deployment Solution for building a Windows Service MSI (22k)

The other future parts in the series will include:

  1. Building and Deploying ClickOnce applications
  2. Deploying a web application.
  3. Hopefully more!  Let me know what you would like to see.

 

Mike

Thursday, July 30, 2009 5:14:00 AM (Central Daylight Time, UTC-05:00)  #    Comments [1] -
Team Build | Team Deploy | Team Foundation Server

# Monday, July 20, 2009

I just received my new Google Voice number.  One of the cool features is creating a “Call me” widget.   Here’s the link for you to call me.  If you have any questions about VSTS or TFS including information about our Team System and Team Foundation Server 2008 Jumpstart program or if you just want to say “hi”, click on the link below.  Depending on the amount of SPAM and solicitors, this may be directed to voice mail so please leave a message and I will call you back.  Also, feel free to contact us through normal methods on our website at http://www.deliveron.com.

Mike

 

Monday, July 20, 2009 6:12:00 PM (Central Daylight Time, UTC-05:00)  #    Comments [0] -
General | Team Foundation Server

# Tuesday, July 14, 2009

Build automation and more specifically deployments are one of my favorite things to do with Team Build in Team Foundation Server 2008.  Deployments are not an “out of the box” feature but there are several ways to accomplish this.  I am going to cover some of these different approaches and strategies for doing deployments with TFS.  Before I get into doing the actual deployments, I want to give a some background and guidance behind why creating automated deployments are part of a good software configuration management (SCM) process. Then I will go into creating a MSI that supports automated deployments.   The subsequent posts will cover a variety of topics including deploying the MSIs with Team Deploy and deploying Click Once applications.  Lastly I will explore what automated deployments will look like in TFS 2010.  As always, if you have any questions or if there is something you want me to see, send me an email, tweet, or comment.

This deployment process has been an evolution of the past 3 years.  I began getting engaged in this process when I used to be part of a process where the development team created a MSI for test and a couple weeks before production our PC configuration team would create a new MSI with their tools.  We would do some testing of this MSI over those couple weeks before going to production.  Unfortunately this process led to a few mistakes, mostly due to the fact we were changing too much too late in the game.  We began to think of an improved process with better configuration management in mind.  We created a few rules to that we wanted our new process to follow. 

Rules for MSIs

  • Create the MSI early in the development process – As early as a development team has most of the projects for the deployment created, compile the assemblies and create the MSI.  For Agile teams this can be as early as Iteration 1.
  • Create a MSI that is easily updated – MSBuild and Team Build by default do not support building setup projects.   There are some workarounds to being able to build a MSI, but I prefer creating the MSI and choose “As  loose, uncompressed files” for the build in the setup project properties.   This will leave the files out of the MSI and basically add pointers to the files in the MSI.  This makes updating the MSI as easy as using the copy task.  If a new project is added to the solution, add the new dependency, rebuild the MSI, and add the new assembly to the copy process (more on this later)
  • Config files – This could probably be a post by itself.  Basically there are a couple rules I have about config files. 
    • The config files for all of the environments must be checked in to source control.  Usually I will create a library project in the solution and add all of the config files to it.
    • Along with all of the files being in source control, there can be no editing or copying of config files once the application is deployed.  For too long I would always copy the config file from the installed location.  Then I would do the uninstall, reinstall, and then copy/modify the config file based on the one I copied to another file.   I did this because I didn’t know if there were changes or particular production settings that were not in the MSI.  
    • Lastly the MSI should contain all of the config files for all of the environments.  These can be removed after the installation process is done but the key is that the config files are not copied from another location.  This will become more clear when I start to walk through the process.
  • Because the MSI contains the config files for multiple environments, the user must be able to select the appropriate environment to install.  The MSI should allow the the user to specify the environment in the wizard or through a command line argument when installing it in quiet mode.
  • If the MSI is a windows service, the user must also be able to specify the username and password through the wizard or command line.

 

By following these rules, it provides the following enhancements

  • Tested and Proven MSI – Just like we shouldn’t deploy code that we haven’t tested, the same is true for the deployment process.  By using the same MSI in the Test environment, throughout the development cycle, and in production, this will help ensure that that are no surprises when deploying to production.
  • Ready for Automated Deployments – The MSI will include key features that are required for use in automated deployments.   These include the config files for multiple environments, easily updateable from Team Build, and supports passing environment and username/password by command line.

In the next part, I will go over the steps and processes for creating a MSI to support these rules and help enforce your configuration management process.  I will demonstrate how to do all of this within Visual Studio without using any 3rd party tools.

Mike

Tuesday, July 14, 2009 5:13:00 AM (Central Daylight Time, UTC-05:00)  #    Comments [1] -
Team Build | Team Foundation Server

# Thursday, July 09, 2009

This week I was informed my presentation, “An Iteration in the Life of an Agile Team with Team System 2010” was added to the schedule at the Heartland Developer Conference 2009.  I am excited to be presenting at this event that usually sells out around 600 attendees.  It is going to be huge. There are a lot of great speakers and topics.  Scott Guthrie is one of the keynote speakers!  My session is October 16th at 2:00pm.  I am looking forward to this session that will be a unique, real world way of demonstrating some of the new features of Team System 2010.

Presentation Summary

This presentation will demonstrate a complete two week scrum iteration from the planning meeting to development, testing, and bug fixing to deployment utilizing the features found in Team System 2010. New features include gated check-ins for Continuous Integration (CI), Test-Driven Development (TDD), Product Backlog enhancements including hierarchical views and support for multiple teams to work from a single backlog. The presentation also demonstrates the enhancements to the TFS Portal and Web Access to support Agile planning and displaying graphs such as burn-down charts. Each walk through includes a live demonstration of the feature in Visual Studio Team System 2010.

I hope to see everyone there!

 

Mike

Thursday, July 09, 2009 12:48:00 AM (Central Daylight Time, UTC-05:00)  #    Comments [0] -
HDC | Team Foundation Server

Visual Studio ALM MVP
Microsoft Visual Studio ALM MVP
Archive
<November 2009>
SunMonTueWedThuFriSat
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345
Blogroll
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2014
Mike Douglas
Sign In
Statistics
Total Posts: 101
This Year: 7
This Month: 0
This Week: 0
Comments: 86
All Content © 2014, Mike Douglas
DasBlog theme 'Business' created by Christoph De Baene (delarou)