April 6, 2012

Steps to Setup of CruiseControl.NET with TFS 2005 under a 64bit server

1)      Install latest plugin for TFS, which we can download here.

2)    Modify the configuration file as below.

<project>
    <name>Example1</name>
    <triggers>
      <intervalTrigger seconds="240"/>
    </triggers>
    <modificationDelaySeconds>120</modificationDelaySeconds>
    <sourcecontrol type="vsts" autoGetSource="true" applyLabel="true">
      <server>http://tfs:8080</server>
      <project>$/CA.Example1</project>
      <username>user</username>
      <password>pwd</password>
      <domain>mydomain</domain>
      <workingDirectory>C:\WorkingDirectory\example1\</workingDirectory>
    </sourcecontrol>
    <tasks>
      <msbuild>
        <executable>C:\Windows\Microsoft.NET\Framework\v3.5\MSBuild.exe</executable>
        <workingDirectory>C:\WorkingDirectory\example1workingDirectory>
        <projectFile>Example1.sln</projectFile>
        <buildArgs> /p:Configuration=Debug</buildArgs>
        <targets>Build</targets>

      </msbuild>
    </tasks>
    <publishers>

    </publishers>
  </project>

January 5, 2012

How is upgrade code stored in the registry?

Did you wonder how is upgrade code stored in the registry? Its using the Darwin Transform..
 
A standard GUID requires 38 characters and contains 5 groups of hexadecimal characters separated by dashes. The valid format for a standard GUID is:
 {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
where X is a hex digit (0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F).
 
A packed GUID is an alternative representation that allows Windows Installer to reduce the space in the registry database when storing a GUID. A packed GUID requires only 32 characters. Its valid format is: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
where X is a hex digit.
 
A packed GUID can be obtained by applying a transform to a standard GUID. This transform performs the following operations:
* removes the curly braces and separating dashes from a standard GUID;
* writes the first three groups of hexadecimals characters in a standard GUID in reverse order;
* switches every two characters in the fourth and fifth group in a standard GUID.
This conversion procedure,is called Darwin Transform since its primary use is to construct a well-known Darwin Descriptor, which is a combination of the product code GUID, a feature name, and a component code GUID.

November 16, 2011

How to Reset the Edit control value on CheckBox Action?

This article explains how to reset the Edit control value on CheckBox Action.

Assume you have two Edit controls named EDIT1 & EDIT2 and a Check Box named ChkBoxSkip.
OnClick on ChkBoxSkip, you may want to set null value or empty string to EDIT1 & EDIT2 and disable them. Technically you should be able to define SetProperty CustomActions and add them under ChkBoxSkip events. But due to current limitation in InstallShield, it does not work this way.

Workaround:
Create two additional Edit controls named EDIT1_1 & EDIT2_2 and disable them by default. The default value of ChkBoxSkip should be set to 1 and there is no need to create IS_SKIP_CHECKED property in the Property Manager.
The properties associated to these controls are defined in below table
Control
Property
EDIT1
USERNAME
EDIT2
EMAILID
EDIT1_1
DUMMY
EDIT2_2
DUMMY
ChkBoxSkip
IS_SKIP_CHECKED
Now you will have to display EDIT1 & EDIT2 controls when ChkBoxSkip is UNCHECKED and display EDIT1_1 & EDIT2_2 when ChkBoxSkip is CHECKED. To achieve this, set the following contions for each of the Edit Controls.
 
Control
Action
Condition
EDIT1
Hide
SKIP_CHECKED
Show
Not  SKIP_CHECKED 
Enable
Not  SKIP_CHECKED
EDIT2
Hide
SKIP_CHECKED
Show
Not  SKIP_CHECKED 
Enable
Not  SKIP_CHECKED
EDIT1_1
Hide
Not SKIP_CHECKED
Show
SKIP_CHECKED 
EDIT2_2
Hide
Not SKIP_CHECKED
Show
SKIP_CHECKED 
 











with this, from the user's perspective EDIT1 & EDIT2 will be enabled with ChkBoxSkip is UNCHECKED and disabled & cleared when ChkBoxSkip is CHECKED. But actually the Property associated with EDIT1 and EDIT2 can be reset by using SetProperty CA OnClick on Next button.

Note: Applies to Basic MSI Project and verified in InstallShield 2012.

October 27, 2011

How to setup Build Automation for .Net Projects on Windows 2008 Standard R2 - 64bit?

Installing Cruise Control.Net & NAnt and setting up the Build Automation for .Net projects is pretty straight forward on a Windows Server 2003 but extra care should be taken while configuring it on Locked Down environments like Windows 2008 R2 Server.

Here you go with few simple steps

  1. Install IIS using "Add Roles"
  2. Install Visual Studio 2010 (or the version required for your .Net Application)
  3. Download and Install Cruise Control.Net version 1.6.7981.1. By default it goes to "C:\Program Files (x86)\CruiseControl.NET"
  4. If you are attempting to use a domain account (say domain\user1) for CruiseControl.Net, then start "CruiseControl.NET Server" from Windows Services panel using the 'user1' account and grant full control to same user for the C:\Program Files (x86)\CruiseControl.NET folder 
  5. Download and extract apropriate version on NAnt to C:\Program files (x86) path.
    Also add C:\Program Files (x86)\NAnt\bin path to the PATH environment variable to access NAnt from the command line.
These settings should work for just compiling the Project source but if you are aiming to get the product source from source control management (SCM) tool and build the installer as well, then you need to install SCM tools (say TFS) and Installer compiler (say Stand Alone Builder in case of InstallShield)

October 14, 2011

Rollback in TFS 2010

Rollback or Undo a particular changeset is always something that comes your way to quickly revert the changes that has gone into the source control.
Though TFS 2010 have command line options (say tf rollback /?) but a GUI can always be handy.
August 2011 update on TFS 2010 Power Tools have a solution to the long waited "GUI for Rollback"

Click here for more details on Rollback in TFS  and you can download and install TFS 2010 Power Tools (along with Team Explorer).
After installing TFS 2010 Power Tools, you will have Rollback context-menu by right clicking the branch or the changeset in the history.