We are currently working with Wix (Windows Installer XML) and  today we wanted to roll out a new software package with a prerequisite for Silverlight 3.0.

I must say it’s pretty hard to find something on the web, on how to check installation or version of Silverlight (for Wix or other deployment projects).

But Alex and I found the solution.

If Silverlight is installed you will find the following Registry Entry:

[HKEY_CLASSES_ROOT\AgControl.AgControl\CurVer]

@=”AgControl.AgControl.x.x”

The “AgControl.AgControl.x.x” part contains the current installed version (Silverlight 3.0 = AgControl.AgControl.3.0)

As a little extra here the “Condition” check for Wix:

<Property Id="SILVERLIGHTVERSION">
  <RegistrySearch Id="SilverLightSearch" Type="raw" Root="HKCR" Key="AgControl.AgControl\CurVer"/>
</Property> 

<Condition Message="Please install Silverlight 3.0 or higher, available at: http://go.microsoft.com/fwlink/?LinkID=149156&amp;v=3.0.40818.0">
  <![CDATA[Installed OR SILVERLIGHTVERSION >= "AgControl.AgControl.3.0"]]>
</Condition>
Share and Enjoy:
  • Technorati
  • Digg
  • Facebook
  • del.icio.us
  • Live
  • Google Bookmarks
  • DotNetKicks
  • DZone
  • TwitThis
  • Blogosphere News
  • Blogplay
  • LinkedIn
  • MisterWong
  • MisterWong.DE
  • MSN Reporter
  • MyShare
  • RSS
  • StumbleUpon
  • Suggest to Techmeme via Twitter
  • Tumblr
  • Twitter
  • Webnews.de
  • Yahoo! Bookmarks
  • Yigg

If you want to set up Teamcity with Delphi you have to take care of several important issues :

You can run a build with the msbuild-runner, but the Delphi commandline-compiler needs additional Environment Variables :

  1. APPDATA : this is where EnvOptions.proj is saved, without it Delphi cannot compile anything, the Problem is that this is installed under the Config-Dir of the User who installed Delphi
    Values can be :
    German Win2003 – D2007 : C:\Dokumente und Einstellungen\<USER>\Anwendungsdaten\Borland\BDS\5.0
    English Windows7 -D2010: C:\Users\<USER>\AppData\Roaming\CodeGear\BDS\7.0
    etc.
  2. BDS – where Delphi is stored e.g. (for Delphi 2007)  C:\Programme\CodeGear\RAD Studio\5.0
  3. BDSCOMMONDIR – e.g. (for Delphi 2007) C:\Dokumente und Einstellungen\All Users\Dokumente\RAD Studio\5.0

In Build file path you just need to add the <Project>.dproj File and your done if you just want to build the executable.

This alone already helped us to ensure that we always have at least all the source-files which are needed to compile the project, which wasn’t always the case before.

If you want Teamcity to also to run your Unit-tests then you have some extra work to do :

  1. Create a new Teamcity project with all the configuration from above e.g. <Project>-Test
    1. Then you need my adapted Console-Runner for DUnit, which emits the necessary infos for Teamcity.
      Use this instead of the standard console-Runner from DUnit
      e.g. change the Source of your Test-Exe Project to

      Application.Initialize;
      if IsConsole then
       TeamCityTestRunner.RunRegisteredTests
       else
       GUITestRunner.RunRegisteredTests;
  2. Create a batch-file which calls the compiled Unit-test Exe and call it with Teamcity

and there you have it – a working integration of Delphi,  DUnit  and TeamCity.

Now if i only had a sure-fire way how to make all of the old GUI-centered Code testable so that i could switch to some Agile Practice like TDD …

TeamCityTestRunner

Share and Enjoy:
  • Technorati
  • Digg
  • Facebook
  • del.icio.us
  • Live
  • Google Bookmarks
  • DotNetKicks
  • DZone
  • TwitThis
  • Blogosphere News
  • Blogplay
  • LinkedIn
  • MisterWong
  • MisterWong.DE
  • MSN Reporter
  • MyShare
  • RSS
  • StumbleUpon
  • Suggest to Techmeme via Twitter
  • Tumblr
  • Twitter
  • Webnews.de
  • Yahoo! Bookmarks
  • Yigg

Just a found a tool that was missing in my Toolchain: Microsoft Build Sidekick from Attrice Corporation. Finally a nice and convenient tool to edit and debug MSBuild files that I use for my Teamcity work. It also supports the MSBuild Extension Pack.
image

Share and Enjoy:
  • Technorati
  • Digg
  • Facebook
  • del.icio.us
  • Live
  • Google Bookmarks
  • DotNetKicks
  • DZone
  • TwitThis
  • Blogosphere News
  • Blogplay
  • LinkedIn
  • MisterWong
  • MisterWong.DE
  • MSN Reporter
  • MyShare
  • RSS
  • StumbleUpon
  • Suggest to Techmeme via Twitter
  • Tumblr
  • Twitter
  • Webnews.de
  • Yahoo! Bookmarks
  • Yigg

If you choose to run Teamcity with a .sln you have an almost automatic integration into Teamcity that can be configured from the web interface.

For most stuff I end up needing a MsBuild Script to get all the Tasks done required for our Builds. If you choose MsBuild as a buildrunner in Teamcity you lose the nice GUI for configurating MsTest . So you need to run the tests by yourself with a simple target in an MsBuild script:

<Target Name=”MsTest”>

    <Exec IgnoreExitCode=”true” Command=”&quot;$(VS2008_Path)\mstest.exe&quot; /testcontainer:BridgeTest.dll  /resultsfile:BridgeTest.trx”  />

    <Message Text=”##teamcity[importData type='mstest' path='BridgeTest.trx']“/>

</Target>

The Trick  is the Second Task which serves as a Service Message and tells Teamcity to Import the results from MsTest.

Other versions of running MsTest from MsBuild can be found in my previous post.

Mostly the same applies for Nunit Tests – yet you don’t need the Service Message because Teamcity can import Nunit reports from the gui.

Share and Enjoy:
  • Technorati
  • Digg
  • Facebook
  • del.icio.us
  • Live
  • Google Bookmarks
  • DotNetKicks
  • DZone
  • TwitThis
  • Blogosphere News
  • Blogplay
  • LinkedIn
  • MisterWong
  • MisterWong.DE
  • MSN Reporter
  • MyShare
  • RSS
  • StumbleUpon
  • Suggest to Techmeme via Twitter
  • Tumblr
  • Twitter
  • Webnews.de
  • Yahoo! Bookmarks
  • Yigg

Auf Nati Dobkin’s Blog habe ich heute einen Task für MSTest und eine super Aufstellung über die verschiedenen Varianten gefunden: MSTest task for MSBuild

Wenn man sich für die Commandline Variante entscheidet, sind auch noch die folgenden 2 Links interessant:

http://harriyott.com/2005/07/running-mstest-from-msbuild.aspx

http://geekswithblogs.net/michaelstephenson/archive/2007/04/27/112031.aspx

Share and Enjoy:
  • Technorati
  • Digg
  • Facebook
  • del.icio.us
  • Live
  • Google Bookmarks
  • DotNetKicks
  • DZone
  • TwitThis
  • Blogosphere News
  • Blogplay
  • LinkedIn
  • MisterWong
  • MisterWong.DE
  • MSN Reporter
  • MyShare
  • RSS
  • StumbleUpon
  • Suggest to Techmeme via Twitter
  • Tumblr
  • Twitter
  • Webnews.de
  • Yahoo! Bookmarks
  • Yigg

Buildserver und Continuous Integration sind nichts vor dem man Angst haben muß!! Es gibt auch komfortable Tools!  ;)

Im letzten halben Jahr habe ich sehr intensiv mit Teamcity 4x von Jetbrains gearbeitet. Diesen BuildServer gibt es  in einer kostenlosen und einer kostenpflichtigen Version. Ich finde dieses Tool einfach nur genial – vor allem wenn man sich über die Konfiguration von CruiseControl.Net geärgert hat.

Von der kommenden Version Teamcity 5 gibt es jetzt eine Preview im “Early Access Program” von Jetbrains! – Ich habe es schon auf einem Server in Betrieb und bin begeistert!  Zum Beispiel kann man jetzt sogar eigenen HTML Reports integrieren ohne in XML Files editieren zu müsssen!

Ich hoffe mich endlich motivieren zu können mehr über Teamcity und MSBuild zu bloggen.

Share and Enjoy:
  • Technorati
  • Digg
  • Facebook
  • del.icio.us
  • Live
  • Google Bookmarks
  • DotNetKicks
  • DZone
  • TwitThis
  • Blogosphere News
  • Blogplay
  • LinkedIn
  • MisterWong
  • MisterWong.DE
  • MSN Reporter
  • MyShare
  • RSS
  • StumbleUpon
  • Suggest to Techmeme via Twitter
  • Tumblr
  • Twitter
  • Webnews.de
  • Yahoo! Bookmarks
  • Yigg