How to convert Microsoft Surface Applications to Windows 7 Touchpack with MsBuild

*UPDATE* If you are confused about the options you have read this first: How to leverage Surface investments for Windows 7

I like Surface and I like MsBuild – so i got motivated in making a build script where we could automatically port our Surface applications for Windows 7 Touchpack.

Of course there is trade offs as conventional multitouch screens are not working with tags – nevertheless it gives us and our customers a value add.

In order for this to make sense, the Surface applications have to be built in a resolution “neutral” way.

On your buildserver or development machine you need to install the MsBuild Community tasks.

image

Inside the project directory I generate a “libs” directory where I gather all of the assemblies for surface and touchpack.
After this I change the “References” in the surface project to go to the surface version of the assemblies in my libs directory.
Those two steps are mandatory to be able to build on a build server, to build on local development machines they are not required.

The first part of the Script collects all files that need to be changed:

<ItemGroup>
<ProjectFiles Include=”$(SolutionDir)**\*.csproj” />
<CSharpFiles Include=”$(SolutionDir)**\*.cs” />
<XamlFiles Include=”$(SolutionDir)**\*.xaml” />
<AppXamlFiles Include=”$(SolutionDir)**\App.xaml” />
</ItemGroup>

After this I define a Target that modifies the content of these files:

<Target Name=”TouchPack” >

This target consists of lines like:

<FileUpdate Files=”@(CSharpFiles)” Regex=”using Microsoft.Surface” ReplacementText=”using Microsoft.Surface.TouchPack” />

When ever I want to build for Windows 7 Touchpack I call the Touchpack target before my Build target.

You can download a sample build.xml from here.

4 comments on “How to convert Microsoft Surface Applications to Windows 7 Touchpack with MsBuild

  1. Pingback: Tweets that mention How to convert Microsoft Surface Applications to Windows 7 Touchpack with MsBuild | LieberLieber Software TeamBlog -- Topsy.com

  2. Pingback: How to leverage Surface investments for Windows 7 | LieberLieber Software TeamBlog

  3. A good step! Too bad that its not the complete convert, since you dont have any applicationactivated/detactivated events on a touch pc, and the scatterviewitem behaves a tiny bit different because of other default values and the change of contactdown events and touchevent, but nevertheless, this is handy

Hinterlasse eine Antwort

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind markiert *

Du kannst folgende HTML-Tags benutzen: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>