<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-17497884</atom:id><lastBuildDate>Thu, 29 May 2025 14:48:12 +0000</lastBuildDate><category>Misc Products</category><category>Surface</category><category>DotNet</category><category>Silverlight</category><category>Windows</category><category>SQL Server</category><category>Tech Events</category><category>Visual Studio</category><category>Gadgets</category><category>SharePoint</category><category>WPF</category><category>ASP.NET</category><category>LINQ</category><category>WiX</category><title>CT Labs</title><description>Technology Blog of Sameer C Thiruthikad</description><link>http://ctlabs.blogspot.com/</link><managingEditor>noreply@blogger.com (Sameer C. Thiruthikad)</managingEditor><generator>Blogger</generator><openSearch:totalResults>70</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-17497884.post-6988819210290588167</guid><pubDate>Fri, 09 Nov 2012 06:30:00 +0000</pubDate><atom:updated>2012-12-05T12:01:24.586+05:30</atom:updated><title>My Windows 8 experience on a non-touch laptop</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
Here is a quick bullet list of my&amp;nbsp;Windows 8 experience on a non-touch laptop:&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Installation was smooth, but I had to check &lt;a href=&quot;http://www.digitaltrends.com/computing/how-to-dual-boot-windows-7-and-windows-8/&quot;&gt;how to dual boot&lt;/a&gt;.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Dual booting on Work laptop is cool. Windows 7 for the work stuff as a member of domain and all. Windows 8 for personal stuff without any link to corporate network so I don&#39;t have to bother about website restrictions or anti virus updates from office.&lt;/li&gt;
&lt;li&gt;Start screen looks awesome with colorful and cool tiles.&lt;/li&gt;
&lt;li&gt;Then a little confused, moving mouse to top right corner all the time to get to charm bar for accessing settings, etc. By the time I move pointer down to the required icon, sometimes charm bar will disappear.&lt;/li&gt;
&lt;li&gt;Next was activation issue. It won&#39;t activate as it was&amp;nbsp;enterprise&amp;nbsp;copy. Got a &lt;a href=&quot;http://blogs.technet.com/b/keithmayer/archive/2012/08/24/tip-of-the-day-microsoft-windows-8-enterprise-activation-itpro-windows8.aspx&quot;&gt;solution &lt;/a&gt;for that too.&lt;/li&gt;
&lt;li&gt;Installed some games and apps. Not very fast. And sometimes they crash. Cut the Rope never loaded.&lt;/li&gt;
&lt;li&gt;Then realized that there are no apps to play music files.&lt;/li&gt;
&lt;li&gt;Installed Music app from store.&lt;/li&gt;
&lt;li&gt;Still not smooth. Music won&#39;t play sound. XBox linking is not working. Some other apps play sound (like MineSweeper). Tried many solutions suggested on net including updating drivers. Nothing helped.&lt;/li&gt;
&lt;li&gt;Decided to Refresh PC. But I had no DVD. Again there was a &lt;a href=&quot;http://www.tecflap.com/2012/05/07/reset-windows-8-dvd/&quot;&gt;solution&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;I was thinking it will remove just store apps. But it did not. Instead it removed everything else including Visual Studio. Still not good. No sound in Music, Games kept crashing.&lt;/li&gt;
&lt;li&gt;Tried Reset PC. Everything clean now. But still not good. No sound in Music, most games kept crashing.&lt;/li&gt;
&lt;li&gt;Decided to stick to VLC Player for playing music and video on desktop.&lt;/li&gt;
&lt;li&gt;Realized now that no good games are working on my laptop. May be it&#39;s an issue of graphic drivers? But it should tell me instead of resisting to load with no error messages.&lt;/li&gt;
&lt;li&gt;Getting back to Desktop often... but even that is confusing with no start button there.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
Conclusion:&lt;br /&gt;
I would prefer Windows 7 if my system is non-touch. I understand there are some extra features in Windows 8 like fast booting, less RAM consumption which are good and also some fancy features like new copy dialogue and picture password option. &amp;nbsp;I will give them a pass until I get a touch system. But again, would I buy a touch laptop? No I guess... a tablet with Windows 8 pro would be a better option there. And for home, an all in one big screen touch PC with Windows 8.&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</description><link>http://ctlabs.blogspot.com/2012/12/my-windows-8-experience-on-non-touch.html</link><author>noreply@blogger.com (Sameer C. Thiruthikad)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-17497884.post-2125697646147237006</guid><pubDate>Sat, 24 Sep 2011 12:30:00 +0000</pubDate><atom:updated>2011-09-24T18:00:26.989+05:30</atom:updated><title>Windows 8 Announcement and Microsoft Platforms for LOB Apps</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
It may seem that Microsoft is complicating things for enterprise developers with the announcement of Windows 8 and it&#39;s new&lt;br /&gt;
&lt;br /&gt;
development platform. After analyzing a lot of articles on Windows 8 and Metro features, here are my conclusions:&lt;br /&gt;
&lt;br /&gt;
If you are starting a new enterprise project (LOB or Line Of Business application), first decide whether it should be a web based app or client based app.&lt;br /&gt;
&lt;br /&gt;
Web apps are the new norms for LOBs as it provides maximum reach. Go for ASP.NET Web Forms if your application is heavily data driven and development time is very limited. Web Forms is also suitable if your developers are more familiar with Windows Forms than model-view-control architecture based development. Go for ASP.NET MVC if you have enough skilled developers and you want full control of the rendered HTML. MVC also provides other benefits like better testability and extensibility. If you have already not invested in Silverlight, forget about it. It is gonna be useful only to develop Windows Phone applications post Windows 8 release.&lt;br /&gt;
&lt;br /&gt;
If your application demand the full resources of a client computer, go for the stand-alone windows client option. If you have already invested in WPF, go for it, as your XAML skills will still be useful to develop Metro Style apps in Windows 8. If your investement is limited to Silverlight, you can still use it to develop out of browser desktop application. But if your developers have still not mastered WPF/Silverlight, better use Windows Forms to develop your next LOB application. This technology is already well matured, has enough controls for LOB scenarios and can use all latest .NET features like LINQ and MEF. It would be easy and faster for developers to build a Win Forms app than a WPF app if they are new to XAML. More over, your win Forms app will run on Windows 8, Windows 7/Vista and Windows XP.&lt;br /&gt;
&lt;/div&gt;
</description><link>http://ctlabs.blogspot.com/2011/09/windows-8-announcement-and-microsoft.html</link><author>noreply@blogger.com (Sameer C. Thiruthikad)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-17497884.post-36760767937944610</guid><pubDate>Thu, 06 Jan 2011 23:21:00 +0000</pubDate><atom:updated>2011-01-07T13:27:37.867+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Surface</category><title>Microsoft Surface 2.0: the multi-touch wonder</title><description>It was worth the wait and the game has completely changed with the release of Microsoft Surface 2.0, the latest version of &lt;a href=&quot;http://ctlabs.blogspot.com/2009/04/introduction-to-microsoft-surface.html&quot;&gt;Microsoft&#39;s multi-touch product&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Now Microsoft has a partner in Samsung who will help with the hardware. The old bulky Surface table is now replaced with a sleek LCD panel. The new product, named as &quot;Samsung SUR40 for Microsoft Surface&quot;, is similar to a large LCD TV but with the multi-touch capability. People have already started calling it the world&#39;s biggest iPad.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4a4OUNT3db7nA31TKTGavFpNgH-8_1k91vL4EBYVA1PV2uEQvsokBYAuugNAbdVL1s4WoXCFYk18D-mVJb4kR0izFZ5sY2c2HKUEa3WwXoSWDhoqKtvaProL4ePWgyaM_JZQcDw/s1600/surface2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;147&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4a4OUNT3db7nA31TKTGavFpNgH-8_1k91vL4EBYVA1PV2uEQvsokBYAuugNAbdVL1s4WoXCFYk18D-mVJb4kR0izFZ5sY2c2HKUEa3WwXoSWDhoqKtvaProL4ePWgyaM_JZQcDw/s400/surface2.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
It uses a new technology from Samsung, PixelSense, which gives LCD panels the power to see without the use of cameras. &amp;nbsp;The tiny infrared sensors wedged between pixels can sense touches, objects and tags.&lt;br /&gt;
&lt;br /&gt;
Here are some specs of Surface 2.0 with the specs of Surface 1.0 in brackets:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Device Display: 40-inch LCD panel with Gorilla Glass (30-inch reflective surface with acrylic)&lt;/li&gt;
&lt;li&gt;Resolution: 1920x1080, full HD 1080p, with a 16:9 aspect ratio (1024 x 768, no HD support)&lt;/li&gt;
&lt;li&gt;Multi-touch technology: PixelSense (Projector and 5-cameras system)&lt;/li&gt;
&lt;li&gt;Multi-touch capability: 50 simultaneous touches (52 simultaneous touches)&lt;/li&gt;
&lt;li&gt;Device Form: 40-inch diagonal panel with 4-inch thickness (30-inch display in a table-like form factor, 22 inches high, 21 inches deep, and 42 inches wide)&lt;/li&gt;
&lt;li&gt;Weight: 39.5 Kg (68 Kg)&lt;/li&gt;
&lt;li&gt;Mounting: Horizontal and Vertical (Only Horizontal)&lt;/li&gt;
&lt;li&gt;Processor: AMD Athlon™ II X2 Dual-Core Processor 2.9GHz paired with the AMD Radeon HD 6700M Series GPU featuring DirectX 11 support (Intel Core 2 Duo @ 2.13 GHz)&lt;/li&gt;
&lt;li&gt;RAM: 4 GB DDR3 (2 GB DDR2)&lt;/li&gt;
&lt;li&gt;Hard Disk: 320 GB/7200 RPM (250GB SATA Hard Drive)&lt;/li&gt;
&lt;li&gt;HDMI In / HDMI Out: Yes (No)&lt;/li&gt;
&lt;li&gt;Operating System: Windows 7 Professional 64-bit (Windows Vista Professional 32-bit)&lt;/li&gt;
&lt;li&gt;Development Platform: Surface 2.0 SDK / WPF 4.0 / .NET 4.0 (Surface 1.0 SP1 SDK &amp;nbsp;/ WPF 3.5 / .NET 3.5)&lt;/li&gt;
&lt;li&gt;Cost: $7,600 ($12,500) -- Approximate Values&lt;/li&gt;
&lt;/ul&gt;
I had enjoyed &lt;a href=&quot;http://ctlabs.blogspot.com/2009/05/developing-microsoft-surface.html&quot;&gt;developing applications for Surface 1.0&lt;/a&gt; and was always excited to explain about them to others (&quot;You don&#39;t use a mouse or keyboard... you just drag things with your fingers like you see in Avatar!&quot;). But it never took off as expected and was not seen in common use, mostly due to its bulky size. Now with Surface 2.0, I&#39;m sure things will be a lot different.&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;iframe allowfullscreen=&#39;allowfullscreen&#39; webkitallowfullscreen=&#39;webkitallowfullscreen&#39; mozallowfullscreen=&#39;mozallowfullscreen&#39; width=&#39;320&#39; height=&#39;266&#39; src=&#39;https://www.youtube.com/embed/IbCORzYW6lQ?feature=player_embedded&#39; frameborder=&#39;0&#39;&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;</description><link>http://ctlabs.blogspot.com/2011/01/microsoft-surface-20-multi-touch-wonder.html</link><author>noreply@blogger.com (Sameer C. Thiruthikad)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4a4OUNT3db7nA31TKTGavFpNgH-8_1k91vL4EBYVA1PV2uEQvsokBYAuugNAbdVL1s4WoXCFYk18D-mVJb4kR0izFZ5sY2c2HKUEa3WwXoSWDhoqKtvaProL4ePWgyaM_JZQcDw/s72-c/surface2.png" height="72" width="72"/><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-17497884.post-172915059191197718</guid><pubDate>Wed, 14 Apr 2010 12:10:00 +0000</pubDate><atom:updated>2010-04-14T17:40:42.612+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Visual Studio</category><title>Visual Studio 2010 / .NET 4.0 and WinForms</title><description>This week saw a major release from Microsoft: Visual Studio 2010 and .NET 4.0. There are not many feature changes from their &lt;a href=&quot;http://ctlabs.blogspot.com/2009/10/visual-studio-2010-and-net-40-features.html&quot;&gt;Beta Releases&lt;/a&gt;. (Also see &lt;a href=&quot;http://weblogs.asp.net/scottgu/archive/2010/04/12/visual-studio-2010-and-net-4-released.aspx&quot;&gt;ScottGu&lt;/a&gt;&#39;s and &lt;a href=&quot;http://www.hanselman.com/blog/VisualStudio2010Released.aspx&quot;&gt;Scott Hanselman&lt;/a&gt;&#39;s blogs).&lt;br /&gt;
&lt;br /&gt;
As expected, there is nothing new in WinForms except the fact that it can make use of many new .NET 4.0 features like &lt;a href=&quot;http://ctlabs.blogspot.com/2009/10/mef-in-net-40visual-studio-2010-simple.html&quot;&gt;MEF&lt;/a&gt;. And of course, there will be bug fixes and performance improvements as the Group Manager of WinForms says in response to a comment in &lt;a href=&quot;http://blogs.msdn.com/somasegar/archive/2008/11/12/net-fx-4.aspx&quot;&gt;Somasegar&#39;s Blog&lt;/a&gt;: &quot;We continue to invest in WinForms for .NET FX 4. &amp;nbsp;This includes the core expectation of maintaining compatibility for applications already written in WinForms, fixing bugs that developers have reported, contributing to overall developer experiences across Visual Studio, as well as perf work and some feature development.&quot;&lt;br /&gt;
&lt;br /&gt;
That &quot;some feature&quot; he mentioned is not to be seen any where. Look at the&amp;nbsp;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms171868(VS.100).aspx&quot;&gt;What&#39;s New in the .NET Framework 4&lt;/a&gt; article in MSDN. It doesn&#39;t even mention WinForms!&lt;br /&gt;
&lt;br /&gt;
Those who are still fond of WinForms find it comforting to say that &amp;nbsp;&quot;WPF is still growing and it need much attention unlike WinForms which is matured and used for many critical LOB applications around the world.&quot; :)</description><link>http://ctlabs.blogspot.com/2010/04/visual-studio-2010-net-40-and-winforms.html</link><author>noreply@blogger.com (Sameer C. Thiruthikad)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-17497884.post-6910076997804820316</guid><pubDate>Tue, 13 Apr 2010 10:08:00 +0000</pubDate><atom:updated>2010-04-13T15:38:46.725+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Surface</category><category domain="http://www.blogger.com/atom/ns#">WPF</category><title>ScatterView for Windows/WPF is here!</title><description>Finally, the wait is over and Microsoft has released Surface Toolkit for Windows Touch. Now we will be able to create Windows Applications that are touch enabled and works on Windows 7 computers with touch screens. The Toolkit brings many good old &lt;a href=&quot;http://ctlabs.blogspot.com/2009/04/introduction-to-microsoft-surface.html&quot;&gt;Surface&lt;/a&gt; touch controls including the much awaited ScatterView to the Windows platform. The good thing is that tremendous research has been done by Microsoft team in the areas of user experience and usability for these controls and hence we developers can save precious time otherwise spent on developing custom touch controls.&lt;br /&gt;
&lt;br /&gt;
The controls included are:&lt;br /&gt;
LibraryBar, LibraryContainer, LibraryStack, ScatterView, SurfaceButton, SurfaceCheckBox, SurfaceInkCanvas, SurfaceListBox, SurfaceRadioButton, SurfaceScrollViewer, SurfaceSlider, SurfaceWindow.&lt;br /&gt;
&lt;br /&gt;
These touch specific controls responds to touches, stylus and mouse clicks and have many special touch features (One example is the bulging out of scroll bars when touched).&lt;br /&gt;
&lt;br /&gt;
One thing that is missing from the Toolkit is a Simulator similar to the Surface Simulator to help out those developers who do not have a touch screen. &amp;nbsp;Also the applications written using these controls will now only work on Windows 7 and not on Surface. Hopefully these may change when they release the next version of Surface (Surface 2.0) based on .NET 4.0.&lt;br /&gt;
&lt;br /&gt;
Microsoft&amp;nbsp;Surface Toolkit for Windows Touch Beta&amp;nbsp;can be downloaded from &lt;a href=&quot;http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;amp;FamilyID=801907a7-b2dd-4e63-9ff3-8a2e63932a74&quot;&gt;here&lt;/a&gt;&amp;nbsp;and more details can be found at the &lt;a href=&quot;http://blogs.msdn.com/surface/archive/2010/04/12/launch-microsoft-surface-toolkit-for-windows-touch-beta.aspx&quot;&gt;Surface Blog&lt;/a&gt;.</description><link>http://ctlabs.blogspot.com/2010/04/scatterview-for-windowswpf-is-here.html</link><author>noreply@blogger.com (Sameer C. Thiruthikad)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-17497884.post-5004076712804801509</guid><pubDate>Thu, 25 Mar 2010 13:27:00 +0000</pubDate><atom:updated>2010-03-25T18:57:59.839+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Silverlight</category><title>I am a Mobile Phone Developer now!</title><description>The &lt;a href=&quot;http://blogs.msdn.com/somasegar/archive/2010/03/15/introducing-windows-phone-7-development-tools.aspx&quot;&gt;MIX10 Announcement&lt;/a&gt; from Microsoft that the Silverlight is the development platform for Windows Phone 7 series makes me and other Silverlight developers the happiest. Without any additional learning, now we are all mobile platform developers! Moreover, the tools required to develop a mobile phone application (including the simulator) is freely available now; even before the actual Windows Phone 7 mobile phone devices are out there in the market. &lt;br /&gt;
&lt;br /&gt;
The excellent post from Shawn Burke says how easy it is to develop a mobile app using Silverlight by comparing it with the iPhone app development. Read it &lt;a href=&quot;http://blogs.msdn.com/sburke/archive/2010/03/23/iphone-sdk-vs-windows-phone-7-series-sdk-challenge-part-1-hello-world.aspx&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
He agrees that MVC pattern is fairly complex and difficult to understand when you first walk up to it. &amp;nbsp;And that is why Microsoft chose “double click, write code!” pattern for mobile development. Cool... ain&#39;t it?</description><link>http://ctlabs.blogspot.com/2010/03/i-am-mobile-phone-developer-now.html</link><author>noreply@blogger.com (Sameer C. Thiruthikad)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-17497884.post-69007198423217017</guid><pubDate>Fri, 30 Oct 2009 12:16:00 +0000</pubDate><atom:updated>2009-10-30T17:56:41.602+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Visual Studio</category><title>MEF in .NET 4.0/Visual Studio 2010 – Simple Example</title><description>The Managed Extensibility Framework (MEF) is a new library in .NET Framework 4.0 that helps in simplifying the design of extensible applications and components. If you are developing a .NET application (WinForms, WPF, Silverlight or ASP.Net) that supports plugins (independent libraries with different functionalities), then MEF is very handy.&lt;br /&gt;&lt;br /&gt;
Let us examine the basics of MEF through a very plain example application. I am building a WinForms showroom application which will display different vehicles. I have my own vehicles to display, and the application also supports vehicles from other vendors (aka plugins). All they need to do is to stick to my contract (aka implement the interface I give) while they develop their vehicles.&lt;br /&gt;&lt;br /&gt;
Let us first define the required contract. In Visual Studio 2010 (My version is Beta 2), create a new C# class library project and name it as Showroom.Contracts. Add an interface to it as below:&lt;br /&gt;
&lt;pre class=&quot;wayformat&quot;&gt;
&lt;span class=&quot;kwrd&quot;&gt;namespace&lt;/span&gt; Showroom.Contracts
{
    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;interface&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;IVehicle&lt;/span&gt;
    {
        &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; GetVehicleDetails();
    }
}&lt;/pre&gt;
&lt;br /&gt;
Now let us assume that we distribute this contract (interface library) to other vendors so that they can create vehicles that will fit in our showroom. To portray this scenario add another class library project named Vehicle.Hyundai. Add Showroom.Contracts project as a reference to this project as we need to implement the contract interface. This is going to be a plugin (extension or ComposablePart in MEF terminology) and hence we need to also add a reference to the MEF library System.ComponentModel.Composition. Add a class as shown below to this project:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;wayformat&quot;&gt;
&lt;span class=&quot;kwrd&quot;&gt;namespace&lt;/span&gt; Vehicle.Hyundai
{
    &lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.ComponentModel.Composition;
    &lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; Showroom.Contracts;

    [&lt;span class=&quot;typ&quot;&gt;Export&lt;/span&gt;(&lt;span class=&quot;kwrd&quot;&gt;typeof&lt;/span&gt;(&lt;span class=&quot;typ&quot;&gt;IVehicle&lt;/span&gt;))]
    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;HyundaiSonata&lt;/span&gt; : &lt;span class=&quot;typ&quot;&gt;IVehicle&lt;/span&gt;
    {
        &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;IVehicle&lt;/span&gt;.GetVehicleDetails()
        {
            &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Hyundai Sonata&quot;&lt;/span&gt;;
        }
    }
}&lt;/pre&gt;
&lt;br /&gt;
Notice the Export attribute. This informs MEF that this is a plugin of type IVehicle. Now let us add one more similar class:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;wayformat&quot;&gt;
&lt;span class=&quot;kwrd&quot;&gt;namespace&lt;/span&gt; Vehicle.Hyundai
{
    &lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.ComponentModel.Composition;
    &lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; Showroom.Contracts;

    [&lt;span class=&quot;typ&quot;&gt;Export&lt;/span&gt;(&lt;span class=&quot;kwrd&quot;&gt;typeof&lt;/span&gt;(&lt;span class=&quot;typ&quot;&gt;IVehicle&lt;/span&gt;))]
    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;HyundaiSantro&lt;/span&gt; : &lt;span class=&quot;typ&quot;&gt;IVehicle&lt;/span&gt;
    {
        &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;IVehicle&lt;/span&gt;.GetVehicleDetails()
        {
            &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Hyundai Santro!&quot;&lt;/span&gt;;
        }
    }
}&lt;/pre&gt;
&lt;br /&gt;
To portray one more vendor, add another class library project named Vehicle.Maruti and add a similar class to this as well:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;wayformat&quot;&gt;
&lt;span class=&quot;kwrd&quot;&gt;namespace&lt;/span&gt; Vehicle.Maruti
{
    &lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.ComponentModel.Composition;
    &lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; Showroom.Contracts;

    [&lt;span class=&quot;typ&quot;&gt;Export&lt;/span&gt;(&lt;span class=&quot;kwrd&quot;&gt;typeof&lt;/span&gt;(&lt;span class=&quot;typ&quot;&gt;IVehicle&lt;/span&gt;))]
    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;MarutiSwift&lt;/span&gt; : &lt;span class=&quot;typ&quot;&gt;IVehicle&lt;/span&gt;
    {
        &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;IVehicle&lt;/span&gt;.GetVehicleDetails()
        {
            &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Maruti Swift&quot;&lt;/span&gt;;
        }
    }
}&lt;/pre&gt;
&lt;br /&gt;
Now that the contract and plugins based on these contracts are ready, let us build the showroom host or shell application to display these vehicles. Add a new WinForms project to the solution named Showroom.Shell. Add a project reference to Showroom.Contracts and reference to System.ComponentModel.Composition. Add a listbox to the form and name it as uxVehicles. This will display all the vehicles we have.&lt;br /&gt;&lt;br /&gt;
Remember we have our own vehicles to display in the showroom (besides vehicles from other vendors). Let us add a new class to the project:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;wayformat&quot;&gt;
&lt;span class=&quot;kwrd&quot;&gt;namespace&lt;/span&gt; Showroom.Shell
{
    &lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.ComponentModel.Composition;
    &lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; Showroom.Contracts;

    [&lt;span class=&quot;typ&quot;&gt;Export&lt;/span&gt;(&lt;span class=&quot;kwrd&quot;&gt;typeof&lt;/span&gt;(&lt;span class=&quot;typ&quot;&gt;IVehicle&lt;/span&gt;))]
    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;ShowroomVehicle1&lt;/span&gt;: &lt;span class=&quot;typ&quot;&gt;IVehicle&lt;/span&gt;
    {
        &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;IVehicle&lt;/span&gt;.GetVehicleDetails()
        {
            &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Showroom Vehicle Normal&quot;&lt;/span&gt;;
        }
    }
}&lt;/pre&gt;
&lt;br /&gt;
And one more similar one:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;wayformat&quot;&gt;
&lt;span class=&quot;kwrd&quot;&gt;namespace&lt;/span&gt; Showroom.Shell
{
    &lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.ComponentModel.Composition;
    &lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; Showroom.Contracts;

    [&lt;span class=&quot;typ&quot;&gt;Export&lt;/span&gt;(&lt;span class=&quot;kwrd&quot;&gt;typeof&lt;/span&gt;(&lt;span class=&quot;typ&quot;&gt;IVehicle&lt;/span&gt;))]
    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;ShowroomVehicle2&lt;/span&gt; : &lt;span class=&quot;typ&quot;&gt;IVehicle&lt;/span&gt;
    {
        &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;IVehicle&lt;/span&gt;.GetVehicleDetails()
        {
            &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Showroom Vehicle Special&quot;&lt;/span&gt;;
        }
    }
}&lt;/pre&gt;
&lt;br /&gt;
Note that these are also decorated with Export attribute for MEF to pick them up later. Now go to the source code of Form1 to build the shell logic:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;wayformat&quot;&gt;
&lt;span class=&quot;kwrd&quot;&gt;namespace&lt;/span&gt; Showroom.Shell
{
    &lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System;
    &lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.Collections.Generic;
    &lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.ComponentModel.Composition;
    &lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.ComponentModel.Composition.Hosting;
    &lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.Reflection;
    &lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.Windows.Forms;
    &lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; Showroom.Contracts;

    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;partial&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; Form1 : Form
    {
        [ImportMany(&lt;span class=&quot;kwrd&quot;&gt;typeof&lt;/span&gt;(IVehicle))]
        &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; List&amp;lt;IVehicle&amp;gt; Vehicles { get; set; }

        &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; Form1()
        {
            InitializeComponent();
        }

        &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; Form1_Load(&lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; sender, EventArgs e)
        {
            &lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.Vehicles = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; List&amp;lt;IVehicle&amp;gt;();

            AggregateCatalog cat = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; AggregateCatalog();
            cat.Catalogs.Add(&lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; AssemblyCatalog(Assembly.GetExecutingAssembly()));
            cat.Catalogs.Add(&lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; DirectoryCatalog(&lt;span class=&quot;str&quot;&gt;&quot;Plugins&quot;&lt;/span&gt;));

            CompositionContainer contnr = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; CompositionContainer(cat);

            contnr.ComposeParts(&lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;);

            &lt;span class=&quot;kwrd&quot;&gt;foreach&lt;/span&gt; (IVehicle item &lt;span class=&quot;kwrd&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.Vehicles)
            {
                uxVehicles.Items.Add(item.GetVehicleDetails());
            }
        }
    }
}&lt;/pre&gt;
&lt;br /&gt;
We have declared a property named Vehicles to contain all the vehicles we plan to display in our showroom. Notice the ‘ImportMany’ attribute. It tells MEF that this property need to be loaded using plugins of type ‘IVehicle’. We have used ‘ImportMany’ as there are more than one vehicle and will be using ‘Import’ instead if there is only one plugin.&lt;br /&gt;&lt;br /&gt;
MEF&#39;s core is comprised of a catalog and a CompositionContainer. A catalog is responsible for discovering extensions (plugins) and the container coordinates creation and satisfies dependencies. The AssemblyCatalog gathers plugins from an assembly. Here we have asked it to find all the plugins (classes with ‘Export’ attributes) from the currently executing assembly (Showroom.Shell). The DirectoryCatalog gathers plugins from a directory. Here we have asked the catalog to look in a directory named ‘Plugins’ for the assemblies containing classes that have ‘Export’ attribute. We have used AggregateCatalog to aggregate the tow different (Assembly and Directory) catalogs of plugins into one. The ComposeParts method of the CompositionContainer does all the magic by importing the required types from these plugins and loading them to the corresponding properties. Here in our code, the property ‘Vehicles’ will now be loaded with all the available vehicle plugins and we call their ‘GetVehicleDetails’ methods to add the results to a the listbox.&lt;br /&gt;&lt;br /&gt;
&lt;a href=&quot;http://lh3.ggpht.com/_R783RuSyUoM/SurZNJXEQEI/AAAAAAAABXs/hH3GzHsMXDY/s1600-h/mefsample%5B3%5D.png&quot;&gt;&lt;img alt=&quot;mefsample&quot; border=&quot;0&quot; height=&quot;300&quot; src=&quot;http://lh6.ggpht.com/_R783RuSyUoM/SurZOBUX1YI/AAAAAAAABXw/GtpIz_EWeSs/mefsample_thumb%5B1%5D.png?imgmax=800&quot; style=&quot;border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;&quot; title=&quot;mefsample&quot; width=&quot;410&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
Before running this application, copy the plugin assemblies (Vehicle.Hyundai.dll and Vehicle.Maruti.dll) to a folder named ‘Plugins’ under ..\bin\Debug\ folder of the Showroom.Shell project.&lt;br /&gt;&lt;br /&gt;
Download the complete sample (works in Visual Studio 2010 Beta 2) from here &lt;a href=&quot;http://wayfarer.bizhat.com/techbites/downloads/mef_showroom1.zip&quot;&gt;http://wayfarer.bizhat.com/techbites/downloads/mef_showroom1.zip&lt;/a&gt;&lt;br /&gt;</description><link>http://ctlabs.blogspot.com/2009/10/mef-in-net-40visual-studio-2010-simple.html</link><author>noreply@blogger.com (Sameer C. Thiruthikad)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh6.ggpht.com/_R783RuSyUoM/SurZOBUX1YI/AAAAAAAABXw/GtpIz_EWeSs/s72-c/mefsample_thumb%5B1%5D.png?imgmax=800" height="72" width="72"/><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-17497884.post-4886879621893013529</guid><pubDate>Thu, 29 Oct 2009 12:05:00 +0000</pubDate><atom:updated>2009-10-29T17:36:42.367+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Visual Studio</category><title>Visual Studio 2010 and .NET 4.0 Features</title><description>I started working in Visual Studio since its early Visual Basic days. The latest in that series was 6.0.&amp;nbsp; Then came a series of .NET platform versions: Visual Studio .NET (Rainier, 2003-Feb),&amp;nbsp; Visual Studio .NET 2003 (Everett, 2003-Apr), Visual Studio 2005 (Whidbey, 2005-Oct) and Visual Studio 2008 (Orcas, 2007-Nov). The latest version of Microsoft Visual Studio is VS 2010 (Code Name: Hawaii) and is expected to be available for public in March, 2010. I tried out the recently released Beta 2 version of VS 2010 and its cool.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://lh3.ggpht.com/_R783RuSyUoM/SumE6_m21VI/AAAAAAAABXk/NDtNWQcwsKs/s1600-h/vs2010%5B3%5D.jpg&quot;&gt;&lt;img alt=&quot;vs2010&quot; border=&quot;0&quot; height=&quot;124&quot; src=&quot;http://lh4.ggpht.com/_R783RuSyUoM/SumE7jgUCuI/AAAAAAAABXo/6CbRznIlPP4/vs2010_thumb%5B1%5D.jpg?imgmax=800&quot; style=&quot;border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;&quot; title=&quot;vs2010&quot; width=&quot;368&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
Here are some of the new features (collected from various blogs including &lt;a href=&quot;http://weblogs.asp.net/scottgu/archive/2009/08/25/vs-2010-and-net-4-series.aspx&quot;&gt;ScottGu&#39;s Blog&lt;/a&gt; and &lt;a href=&quot;http://msmvps.com/blogs/kevinmcneish/archive/2009/10/14/visual-studio-2010-net-4-0-c-and-vb-net-4-what-s-new.aspx&quot;&gt;Kevin McNeish&#39;s Blog&lt;/a&gt;):&lt;br /&gt;
Visual Studio&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Fresh look and feel with a blue based new logo and color theme. &lt;/li&gt;
&lt;li&gt;Works side by side with VS 2008 and supports Multi Targeting (.NET 2.0, 3.0, ...). &lt;/li&gt;
&lt;li&gt;New Product Lineup (Express, Professional, Premium, Ultimate). &lt;/li&gt;
&lt;li&gt;Multi-Monitor Support (editors, designers and tool-windows). &lt;/li&gt;
&lt;li&gt;Silverlight UI layout support. &lt;/li&gt;
&lt;li&gt;Data binding support for both WPF and Silverlight. &lt;/li&gt;
&lt;li&gt;Zoom in/out of any code editing window or text editing window. &lt;/li&gt;
&lt;li&gt;Call hierarchy for C# is available at design time (Similar to stack trace; Right click on a symbol(method or class, etc.) and choose View Call Hierarchy). &lt;/li&gt;
&lt;li&gt;Naviagate To (Edit &amp;gt; Navigate To or Ctrl+Comma) option to do quick search for a symbol or file in the source code (can search part of a name or abbreviation like IC for InitializeComponent, and can specify multiple strings separated by space). &lt;/li&gt;
&lt;li&gt;Highlight References: Put the cursor on a symbol and after a short delay, all its references are highlighted. Or use Find all references (Right click on a symbol and choose Find All References) to see all its instances.(Ctrl-Shift-up/down arrow to cycle) &lt;/li&gt;
&lt;li&gt;Consume First Development: Even if there is no class by name Person, you can type Person obj = new Person(); and then choose to generate the class. (Ctrl+ Dot)&lt;/li&gt;
&lt;li&gt;Tools &amp;gt; Extension Manager to manage add-ins.&lt;/li&gt;
&lt;/ul&gt;
.NET Framework 4.0&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Dynamic Language Support. [kind of late binding: dynamic Car = GetCar();] &lt;/li&gt;
&lt;li&gt;MEF (Managed Extensibility Framework) for developing applications that supports plugins.&lt;/li&gt;
&lt;li&gt;Optional Parameters [Supply a default value to make it optional: public void CreateBook(string title=&quot;No Title&quot;, string isbn = &quot;0-00000-000-0&quot;){}] &lt;/li&gt;
&lt;li&gt;Named Parameters [Supply parameter values in any order specifying its name: CreateBook(isbn: &quot;5-55555-5555-5&quot;); or CreateBook(&quot;Book Title&quot;, isbn: &quot;5-55555-5555-5&quot;);] &lt;/li&gt;
&lt;li&gt;Co-variance and Contra-variance support [IEnumerable&amp;lt;string&amp;gt; strings = GetStrings();IEnumerable&amp;lt;object&amp;gt; objects = strings; is now possible.]&lt;/li&gt;
&lt;/ul&gt;
ASP.NET 4.0&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Starter Project Templates (Installed &amp;amp; Online; Empty, Normal, MVC, Ajax, etc.). &lt;/li&gt;
&lt;li&gt;Clean Web.Config Files. &lt;/li&gt;
&lt;li&gt;Code Optimized Web Development Profile(Or Tools&amp;gt;Options&amp;gt;HTML Designer&amp;gt;Off Designer) &lt;/li&gt;
&lt;li&gt;ASP.NET, HTML, JavaScript Snippet Support. &lt;/li&gt;
&lt;li&gt;Auto start: Only on IIS 7.5 (well-defined approach to perform expensive application startup). &lt;/li&gt;
&lt;li&gt;URL Routing with ASP.NET 4 Web Forms. &lt;/li&gt;
&lt;/ul&gt;
WPF 4.0&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;New controls: DataGrid, DatePicker, and Calendar &lt;/li&gt;
&lt;li&gt;Bag O’ Tricks controls: AnimatingTilePanel, ColorPicker, InfoTextBox, ListPager, NumericUpDown, Reveal, TransitionsPresenter, TreeMapPanel. &lt;/li&gt;
&lt;li&gt;Extra control: Windows 7 &amp;amp; Office Ribbon Control &lt;/li&gt;
&lt;li&gt;Graphics improvements: Cached Composition, Pixel Shader 3 Support, LayoutRounding, Animation Easing Function, CleartypeHint &lt;/li&gt;
&lt;li&gt;Text improvements: New Text Rendering Stack, Display-optimized character layout, explicitly selecting aliased, grayscale, or ClearType rendering modes, optimizing text hinting and snapping, support for fonts with embedded bitmaps, BindableRun (Run.Text), Custom Dictionaries, Selection and Caret Brush &lt;/li&gt;
&lt;li&gt;Windows 7 Multitouch Support: Multi-touch Manipulation, Inertia (Pan, Zoom, Rotate) events on UIElement, Raw multi-touch events (Up, Move, Down) on UIElement, UIElement3D and ContentElement, Multiple capture supporting multiple active controls, ScrollViewer enhancement to support multi-touch panning, Touch device extensibility, Future Surface SDK compatibility &lt;/li&gt;
&lt;li&gt;Windows 7 Shell Integration: Jump List (Tasks, Items, Recent and Frequent Lists) and Taskbar (Progress bar, Overlay Icon, Thumbnail buttons with commanding support, Description Text) integration &lt;/li&gt;
&lt;li&gt;Fundamentals: New XAML/BAML Parser Engine, Data Binding Support for DLR, Visual State Manager (VSM), HTML-XBAP Script Interop, UIAutomation Virtualization, SynchronizedInput Pattern &lt;/li&gt;
&lt;li&gt;Deployment: .NET Framework 4 Client Profile, Full Trust XBAP Deployment&lt;/li&gt;
&lt;/ul&gt;
Win Forms 4.0&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;No new features or controls! &lt;/li&gt;
&lt;li&gt;Will maintain compatibility for applications already written in WinForms. &lt;/li&gt;
&lt;li&gt;Bug fixes and perf improvements.&lt;/li&gt;
&lt;/ul&gt;</description><link>http://ctlabs.blogspot.com/2009/10/visual-studio-2010-and-net-40-features.html</link><author>noreply@blogger.com (Sameer C. Thiruthikad)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh4.ggpht.com/_R783RuSyUoM/SumE7jgUCuI/AAAAAAAABXo/6CbRznIlPP4/s72-c/vs2010_thumb%5B1%5D.jpg?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-17497884.post-3022115739853754377</guid><pubDate>Fri, 16 Oct 2009 11:11:00 +0000</pubDate><atom:updated>2009-12-04T14:59:49.571+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">WiX</category><title>WiX - Windows Installer XML</title><description>&lt;h3&gt;
Windows Installer&lt;/h3&gt;
The Windows Installer is an engine for the installation, maintenance, and removal of software on modern Microsoft Windows systems. The installation information, and often the files themselves, are packaged in installation packages, commonly known as &quot;MSI files&quot;, from their default file extension.&lt;br /&gt;
Windows Installer is positioned as an alternative to stand-alone executable installer frameworks such as NSIS, and older versions of InstallShield and Wise.&lt;br /&gt;
MSI packages can be created using Visual Studio through a Setup project or using third party tools like InstallShield, Wise Installer and WiX.&lt;br /&gt;
&lt;h3&gt;
Windows Installer XML&lt;/h3&gt;
The Windows Installer XML (WiX, pronounced &quot;wicks&quot;), is a free software toolset that builds Windows Installer (MSI) packages from an XML document. It supports both command-line environment and integrated Visual Studio environment.&lt;br /&gt;
The WiX distribution includes Votive, a Visual Studio add-in that allows creating and building WiX setup projects using the Visual Studio IDE. Votive supports syntax highlighting and IntelliSense for .WXS source files and adds a WiX setup project type to Visual Studio.&lt;br /&gt;
&lt;h3&gt;
WiX Download&lt;/h3&gt;
WiX can be downloaded from &lt;a href=&quot;http://sourceforge.net/projects/wix/files/&quot;&gt;http://sourceforge.net/projects/wix/files/&lt;/a&gt;. The latest version is 3.0 and the downloaded zip file (wix3.0.5419.0-x86-setup.zip) will contain Wix3.msi. Double click on this after closing all the Visual Studio instances. This will install all the required Wix tools (there are a lot of them and they have interesting names all associated to the wicks of a candle) to %PROGRAMFILES%\ \Windows Installer XML v3\ and the required Visual Studio add-in and project templates.&lt;br /&gt;
The bin sub folder under this contains all the tools like candle.exe (compiler and that convert source code into object files), light.exe (linker that take multiple object files and resources to create final setup package), and other tools like dark, light, heat, smoke, torch, etc. The doc sub folder has a detailed help file by name Wix.chm. A detailed tutorial is available at&amp;nbsp;&lt;a href=&quot;http://wix.sourceforge.net/manual-wix3/main.htm&quot;&gt;http://wix.sourceforge.net/manual-wix3/main.htm&lt;/a&gt;.&lt;br /&gt;
&lt;h3&gt;
Visual Studio WiX Project&lt;/h3&gt;
First create a sample application to test the WiX. I created a simple Windows Application project. Now add a new WiX Project to the solution (Project Type: WiX, Template: WiX Project) and name it as SampleApp.Setup.&lt;br /&gt;
The project will have a default ‘Product.wxs’ file containing the WiX source code to create an MSI package. The WiX source code is nothing but a set of XML tags. Remove the commented tags in the default file and add application exe as shown below:&lt;br /&gt;
&lt;pre class=&quot;wayformat&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;
&amp;lt;Wix xmlns=&quot;http://schemas.microsoft.com/wix/2006/wi&quot;&amp;gt;
  &amp;lt;Product Id=&quot;b464316e-5c06-4cae-be36-0748d51ceb03&quot;
           Name=&quot;SampleApp.Setup&quot;
           Language=&quot;1033&quot;
           Version=&quot;1.0.0.0&quot;
           Manufacturer=&quot;SampleApp.Setup&quot;
           UpgradeCode=&quot;e0ad76e3-7ad8-436f-b3cd-9f30fcabb1d9&quot;&amp;gt;
    &amp;lt;Package InstallerVersion=&quot;200&quot;
             Compressed=&quot;yes&quot; /&amp;gt;

    &amp;lt;Media Id=&quot;1&quot;
           Cabinet=&quot;media1.cab&quot;
           EmbedCab=&quot;yes&quot; /&amp;gt;

    &amp;lt;Directory Id=&quot;TARGETDIR&quot;
               Name=&quot;SourceDir&quot;&amp;gt;
      &amp;lt;Directory Id=&quot;ProgramFilesFolder&quot;&amp;gt;
        &amp;lt;Directory Id=&quot;INSTALLLOCATION&quot;
                   Name=&quot;SampleApp.Setup&quot;&amp;gt;
          &amp;lt;Component Id=&quot;ProductComponent&quot;
                     Guid=&quot;9102229d-8f5c-474d-be69-00085b3230a2&quot;&amp;gt;
            &amp;lt;File Id=&quot;SampleApp.exe&quot;
                  Name=&quot;SampleApp.exe&quot;
                  Source=&quot;$(var.SolutionDir)\SampleApp\$(var.OutDir)SampleApp.exe&quot;
                  KeyPath=&quot;yes&quot;
                  Checksum=&quot;yes&quot;/&amp;gt;
          &amp;lt;/Component&amp;gt;
        &amp;lt;/Directory&amp;gt;
      &amp;lt;/Directory&amp;gt;
    &amp;lt;/Directory&amp;gt;

    &amp;lt;Feature Id=&quot;ProductFeature&quot;
             Title=&quot;SampleApp.Setup&quot;
             Level=&quot;1&quot;&amp;gt;
      &amp;lt;ComponentRef Id=&quot;ProductComponent&quot; /&amp;gt;
    &amp;lt;/Feature&amp;gt;
  &amp;lt;/Product&amp;gt;
&amp;lt;/Wix&amp;gt;&lt;/pre&gt;
Let us now inspect each elements of this file:&lt;br /&gt;
WiX: Root element of a WiX installer.&lt;br /&gt;
Product: An msi will always contain a single product which is the software we are planning to install. It requires a unique GUID and we can specify other properties like product name, version and manufacturer.&lt;br /&gt;
Package: Used to set the packaging properties. Basically we say compression is needed or not.&lt;br /&gt;
Media: Describes the installation media for the installer. By default it is a cabinet file named media1.cab which is embedded within the msi file. All the other files will be compressed to this cab file.&lt;br /&gt;
Directory: Now we need to specify a group of directory structure that we plan to build on the target machine. All these directories should be within the virtual TARGETDIR directory. In this case, we have the root folder as ‘ProgramFilesFolder’ which is the keyword for system folder ‘%PROGRAMFILES%\’ which will be typically to ‘C:\Program Files\’. Inside this directory we are creating another directory named ‘SampleApp.Setup’. So our final destination folder will be ‘C:\Program Files\SampleApp.Setup\’.&lt;br /&gt;
Component: The component is the atomic unit of things to be installed. It consists of resources—files, registry keys, shortcuts or anything else—that should always be installed as a single unit.&lt;br /&gt;
File: This represents a file that we need to copy to the target system. Here we are specifying the output exe of our simple application. Note that ‘$(var.SolutionDir)’ is a preprocessor variable that will point to the actual solution directory. Same way, ‘$(var.OutDir)’ represents the project output directory (bin\Debug or bin\Release).&lt;br /&gt;
Feature: Features are separated parts of the application that we offer the user to decide whether to install or not. Examples are core files, samples, documentation, etc. Here we have just single feature which is our lone app exe referred by Component Id.&lt;br /&gt;
Building this project will create an msi named SampleApp.Setup.msi at the bin\Debug folder of the setup project.&lt;br /&gt;
This is the very basic installer without any user interaction options, and it will just show a progress bar of the installation. After completion, you can see that SampleApp .exe is copied to C:\Program Files\SampleApp.Setup\ folder. There are no start menu items or shortcuts created, but there will be an entry in Add or Remove programs list (Programs and Features) from where you can uninstall this program.&lt;br /&gt;
&lt;h3&gt;
WiX User Interface&lt;/h3&gt;
Adding a standard user interface to the installer is very easy with WiX. First add a reference to WixUIExtension.dll (available in’ %PROGRAMFILES%\ Windows Installer XML v3\bin\’ folder) in the setup project. Now add the following line just above the Product closing tag.&lt;br /&gt;
&lt;pre class=&quot;wayformat&quot;&gt;&amp;lt;UIRef Id=&quot;WixUI_Minimal&quot;/&amp;gt;&lt;/pre&gt;
UIRef tells WiX which UI style should be used and we have chosen the ‘Minimal’ with basic options. That’s it.  Now build the project and run the installer. It will have a default user interface with license page, progress page and a finish page.&lt;br /&gt;
If you re-run the installer after installing it once, the UI will change to provide a ‘Repair’ or ‘Remove’ option. ‘Remove’ can be used to uninstall the program.&lt;br /&gt;
Providing the user with an option to choose the installation directory is also very easy. Instead of the UIRef element used above, add the following two lines:&lt;br /&gt;
&lt;pre class=&quot;wayformat&quot;&gt;&amp;lt;Property Id=&quot;WIXUI_INSTALLDIR&quot;
              Value=&quot;INSTALLLOCATION&quot; /&amp;gt;
&amp;lt;UIRef Id=&quot;WixUI_InstallDir&quot;/&amp;gt;
&lt;/pre&gt;
Here we have chosen the ‘InstallDir’ UI style and the selected directory is assigned to the ‘INSTALLLOCATION’ value which we are referring within the directory structure. Now when you run this new installer, the user will have an option to choose the installation directory.&lt;br /&gt;
Other UIRef include WixUI_FeatureTree (allows features to be selected) and WixUI_Mondo (provides typical, custom and complete install options).&lt;br /&gt;
&lt;h3&gt;
WiX User Interface Customization&lt;/h3&gt;
You can customize some visual aspects of the user interface by simply providing replacement files. To add your own license file for example, add a license rtf file to the setup project and then add the below line just above Produc&amp;gt; closing tag:&lt;br /&gt;
&lt;pre class=&quot;wayformat&quot;&gt;&amp;lt;WixVariable Id=&quot;WixUILicenseRtf&quot; Value=&quot;license.rtf&quot; /&amp;gt;
&lt;/pre&gt;
Other such options are:&lt;br /&gt;
&lt;pre class=&quot;wayformat&quot;&gt;&amp;lt;WixVariable Id=&quot;WixUIBannerBmp&quot; Value=&quot;mybanner.bmp&quot; /&amp;gt;
&amp;lt;WixVariable Id=&quot;WixUIDialogBmp&quot; Value=&quot;mydialog.bmp&quot; /&amp;gt;
&lt;/pre&gt;
Dialog is the first install page’s background image (493 x 312 pixels bmp) and Banner is the top banner image on subsequent pages (493 x 58 pixels bmp).&lt;br /&gt;
Download a complete Visual Studio 2008 Solution with sample WiX project from here: &lt;a href=&quot;http://wayfarer.bizhat.com/techbites/reference/wixsample.zip&quot;&gt;wixsample.zip&lt;/a&gt;.
And here is the complete WiX code for that:
&lt;br /&gt;
&lt;pre class=&quot;wayformat&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;
&amp;lt;!--Author: Sameer C Thiruthikad | Last Modified: 2009-Oct-16--&amp;gt;
&amp;lt;!--Defining some constants--&amp;gt;
&amp;lt;?define Property_ProductName = &quot;My Sample App&quot; ?&amp;gt;
&amp;lt;?define Property_Manufacturer = &quot;My Company&quot; ?&amp;gt;

&amp;lt;Wix xmlns=&quot;http://schemas.microsoft.com/wix/2006/wi&quot;&amp;gt;
  &amp;lt;Product Name=&#39;$(var.Property_ProductName)&#39;
           Id=&#39;{C24FBDCE-AD5D-4f0d-AD4B-9E75EB78D231}&#39;
           UpgradeCode=&#39;{DCE43671-9C09-4fb0-AC05-34D4AF71563E}&#39;
           Language=&#39;1033&#39;
           Codepage=&#39;1252&#39;
           Version=&#39;1.0.0&#39;
           Manufacturer=&#39;$(var.Property_Manufacturer)&#39;&amp;gt;

    &amp;lt;!--These properties will appear in Windows Explorer--&amp;gt;
    &amp;lt;Package Id=&#39;*&#39;
             Keywords=&#39;Installer&#39;
             Description=&quot;$(var.Property_ProductName) Installer&quot;
             Comments=&#39;$(var.Property_Manufacturer) $(var.Property_ProductName)&#39;
             Manufacturer=&#39;$(var.Property_Manufacturer)&#39;
             InstallerVersion=&#39;100&#39;
             Languages=&#39;1033&#39;
             Compressed=&#39;yes&#39;
             SummaryCodepage=&#39;1252&#39; /&amp;gt;
    
    &amp;lt;Media Id=&quot;1&quot;
           Cabinet=&quot;media1.cab&quot;
           EmbedCab=&quot;yes&quot; /&amp;gt;

    &amp;lt;!--Defining target directory structure--&amp;gt;
    &amp;lt;Directory Id=&#39;TARGETDIR&#39;
               Name=&#39;SourceDir&#39;&amp;gt;
      &amp;lt;!--Primary install folder: %PROGRAMFILES%\My Company\My Sample App\ ; Sub folders: Resources--&amp;gt;
      &amp;lt;Directory Id=&#39;ProgramFilesFolder&#39;
                 Name=&#39;PFiles&#39;&amp;gt;
        &amp;lt;Directory Id=&#39;ManufacturerFolder&#39;
                   Name=&#39;$(var.Property_Manufacturer)&#39;&amp;gt;
          &amp;lt;!--Application files to the primary install fodler--&amp;gt;
          &amp;lt;Directory Id=&#39;INSTALLDIR&#39;
                     Name=&#39;$(var.Property_ProductName)&#39;&amp;gt;

            &amp;lt;Component Id=&#39;MyCompany.MyApp&#39;
                       Guid=&#39;{36EF4819-D4C6-4bc6-AA7D-4D41DC2E2342}&#39;&amp;gt;
              &amp;lt;File Id=&#39;SampleApp.exe&#39;
                    Name=&#39;SampleApp.exe&#39;
                    DiskId=&#39;1&#39;
                    Source=&#39;$(var.SolutionDir)\SampleApp\$(var.OutDir)SampleApp.exe&#39;
                    KeyPath=&#39;yes&#39;&amp;gt;
                &amp;lt;Shortcut Id=&quot;ProgramMenu.Shortcut.App&quot;
                          Directory=&quot;ProgramMenuSubFolder&quot;
                          Name=&quot;$(var.Property_ProductName)&quot;
                          WorkingDirectory=&#39;INSTALLDIR&#39;
                          Icon=&quot;AppIcon.ico&quot;
                          IconIndex=&quot;0&quot;
                          Advertise=&quot;yes&quot; /&amp;gt;
                &amp;lt;Shortcut Id=&quot;Desktop.Shortcut.App&quot;
                          Directory=&quot;DesktopFolder&quot;
                          Name=&quot;$(var.Property_ProductName)&quot;
                          WorkingDirectory=&#39;INSTALLDIR&#39;
                          Icon=&quot;AppIcon.ico&quot;
                          IconIndex=&quot;0&quot;
                          Advertise=&quot;yes&quot; /&amp;gt;
              &amp;lt;/File&amp;gt;
            &amp;lt;/Component&amp;gt;

            &amp;lt;Component Id=&#39;MyCompany.MyApp.Helpers&#39;
                       Guid=&#39;{C60F6F97-CBC1-4ee7-89D8-3D4E5F72DD00}&#39;&amp;gt;
              &amp;lt;File Id=&#39;HelperDLL&#39;
                    Name=&#39;Helper.dll&#39;
                    DiskId=&#39;1&#39;
                    Source=&#39;$(var.SolutionDir)\SampleApp\$(var.OutDir)Helper.dll&#39;
                    KeyPath=&#39;yes&#39; /&amp;gt;
            &amp;lt;/Component&amp;gt;

            &amp;lt;Component Id=&#39;MyCompany.MyApp.Manual&#39;
                       Guid=&#39;{DB40393C-2D35-4007-A0EF-E0846F1A70E4}&#39;&amp;gt;
              &amp;lt;File Id=&#39;Manual&#39;
                    Name=&#39;Manual.pdf&#39;
                    DiskId=&#39;1&#39;
                    Source=&#39;$(var.SolutionDir)\SampleApp\$(var.OutDir)Manual.pdf&#39;
                    KeyPath=&#39;yes&#39;&amp;gt;
                &amp;lt;Shortcut Id=&quot;ProgramMenu.Shortcut.Manual&quot;
                          Directory=&quot;ProgramMenuSubFolder&quot;
                          Name=&quot;Instruction Manual&quot;
                          Advertise=&quot;yes&quot; /&amp;gt;
              &amp;lt;/File&amp;gt;
            &amp;lt;/Component&amp;gt;

            &amp;lt;!--Resources to the Resources sub folder--&amp;gt;
            &amp;lt;Directory Id=&quot;AppResources&quot;
                       Name=&quot;Resources&quot; &amp;gt;
              &amp;lt;Component Id=&quot;MyCompany.MyApp.Resources&quot;
                         Guid=&quot;{F25B9D53-9924-4a6c-B0F7-C5188943F474}&quot;&amp;gt;
                &amp;lt;File Id=&quot;image.jpg&quot;
                      Name=&quot;image.jpg&quot;
                      Source=&quot;$(var.SolutionDir)\SampleApp\$(var.OutDir)Resources\image.jpg&quot;
                      Checksum=&quot;yes&quot;/&amp;gt;
              &amp;lt;/Component&amp;gt;
            &amp;lt;/Directory&amp;gt;
          &amp;lt;/Directory&amp;gt;
        &amp;lt;/Directory&amp;gt;
      &amp;lt;/Directory&amp;gt;

      &amp;lt;!--Define Start menu folder--&amp;gt;
      &amp;lt;Directory Id=&quot;ProgramMenuFolder&quot;
                 Name=&quot;Programs&quot;&amp;gt;
          &amp;lt;Directory Id=&quot;ProgramMenuSubFolder&quot;
                     Name=&quot;$(var.Property_Manufacturer) $(var.Property_ProductName)&quot;&amp;gt;
            &amp;lt;Component Id=&quot;MyCompany.MyApp.Shortcut&quot;
                       Guid=&quot;{3C08CF93-5203-49fe-B545-005C225DA334}&quot;&amp;gt;
              &amp;lt;!--Any extra folder we creare under user profile need to be marked for deletion--&amp;gt;
              &amp;lt;RemoveFolder Id=&#39;ProgramMenuSubFolder&#39;
                            On=&#39;uninstall&#39; /&amp;gt;
              &amp;lt;!--This is also required?!--&amp;gt;
              &amp;lt;RegistryValue Root=&#39;HKCU&#39;
                             Key=&#39;Software\[Manufacturer]\[ProductName]&#39;
                             Type=&#39;string&#39;
                             Value=&#39;&#39;
                             KeyPath=&#39;yes&#39; /&amp;gt;
            &amp;lt;/Component&amp;gt;
          &amp;lt;/Directory&amp;gt;
      &amp;lt;/Directory&amp;gt;

      &amp;lt;!--Define Desktop folder--&amp;gt;
      &amp;lt;Directory Id=&quot;DesktopFolder&quot;
                 Name=&quot;Desktop&quot; /&amp;gt;
    &amp;lt;/Directory&amp;gt;

    &amp;lt;!--Register all components under a single feature--&amp;gt;
    &amp;lt;Feature Id=&#39;Complete&#39;
             Level=&#39;1&#39;&amp;gt;
      &amp;lt;ComponentRef Id=&#39;MyCompany.MyApp&#39; /&amp;gt;
      &amp;lt;ComponentRef Id=&#39;MyCompany.MyApp.Helpers&#39; /&amp;gt;
      &amp;lt;ComponentRef Id=&#39;MyCompany.MyApp.Manual&#39; /&amp;gt;
      &amp;lt;ComponentRef Id=&#39;MyCompany.MyApp.Shortcut&#39; /&amp;gt;
      &amp;lt;ComponentRef Id=&#39;MyCompany.MyApp.Resources&#39; /&amp;gt;
    &amp;lt;/Feature&amp;gt;
    
    &amp;lt;!-- The icon that appears in Add &amp;amp; Remove Programs. --&amp;gt;
    &amp;lt;Property Id=&quot;ARPPRODUCTICON&quot;
              Value=&quot;appicon.ico&quot; /&amp;gt;

    &amp;lt;!--UI style is set to InstallDir (User will have directory selection)--&amp;gt;
    &amp;lt;UIRef Id=&quot;WixUI_InstallDir&quot;/&amp;gt;
    &amp;lt;Property Id=&quot;WIXUI_INSTALLDIR&quot;
              Value=&quot;INSTALLDIR&quot; /&amp;gt;

    &amp;lt;!--Sepcify license file--&amp;gt;
    &amp;lt;WixVariable Id=&quot;WixUILicenseRtf&quot;
                 Value=&quot;license.rtf&quot; /&amp;gt;

    &amp;lt;!--Specify initial page&#39;s background image--&amp;gt;
    &amp;lt;WixVariable Id=&quot;WixUIDialogBmp&quot;
                 Value=&quot;welcome.bmp&quot; /&amp;gt;

    &amp;lt;!--Specify subsequent page&#39;s banner image--&amp;gt;
    &amp;lt;WixVariable Id=&quot;WixUIBannerBmp&quot;
                 Value=&quot;banner.bmp&quot; /&amp;gt;

    &amp;lt;!--Define the icon used for shortcuts and installer--&amp;gt;
    &amp;lt;Icon Id=&quot;AppIcon.ico&quot;
          SourceFile=&quot;appicon.ico&quot; /&amp;gt;
  &amp;lt;/Product&amp;gt;
&amp;lt;/Wix&amp;gt;
                            &lt;/pre&gt;</description><link>http://ctlabs.blogspot.com/2009/10/wix-windows-installer-xml.html</link><author>noreply@blogger.com (Sameer C. Thiruthikad)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-17497884.post-7865596670574849849</guid><pubDate>Tue, 01 Sep 2009 13:34:00 +0000</pubDate><atom:updated>2009-09-01T19:06:24.295+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">DotNet</category><category domain="http://www.blogger.com/atom/ns#">Silverlight</category><title>Desklighter Update: Beta 2 with more customization options</title><description>&lt;p&gt;The latest version of the Desklighter tool is now available for free download from IdentityMine Blendables Labs: &lt;a href=&quot;http://blendables.com/labs/Desklighter/Default.aspx&quot;&gt;http://blendables.com/labs/Desklighter/Default.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;http://lh5.ggpht.com/_R783RuSyUoM/Sp0jU44EolI/AAAAAAAABWU/gHIP5H7N5RQ/s1600-h/desklighterbutton_white%5B2%5D.png&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px&quot; title=&quot;desklighterbutton_white&quot; border=&quot;0&quot; alt=&quot;desklighterbutton_white&quot; src=&quot;http://lh4.ggpht.com/_R783RuSyUoM/Sp0jVkdQo6I/AAAAAAAABWY/CiqEN89InbA/desklighterbutton_white_thumb.png?imgmax=800&quot; width=&quot;204&quot; height=&quot;204&quot; /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;“Desklighter is a windows utility that creates standalone windows applications from Silverlight xap files. Desklighter helps you in sharing your Silverlight applications as independent executables without having to worry about the hosting infrastructure. Unlike Silverlight Out-of-Browser(OOB) applications that run only on the installed computer, executables created by Desklighter are truly portable.”&lt;/p&gt;  &lt;p&gt;See some sample games and demos created using Desklighter at &lt;a href=&quot;http://sites.google.com/site/silverlightoffline&quot;&gt;http://sites.google.com/site/silverlightoffline&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;This new version of Desklighter has a settings panel providing more options to customize the executable application window. The settings available are Height and Width to control default application window size, border type (Re-sizable, fixed, none), application icon, background color, and window title. If the Silverlight application is expecting initial parameters, that can be supplied as well. It also supports transparency and it is possible to create custom shaped Silverlight standalone applications by setting the Background as &#39;Transparent&#39; and choosing the &#39;No Border&#39; option.&lt;/p&gt;  &lt;p&gt;The recently released Silverlight 3.0 &lt;a href=&quot;http://ctlabs.blogspot.com/2009/08/silverlight-3-offline-oob-out-of.html&quot;&gt;Out-of-Browser (OOB)&lt;/a&gt; feature opens up a lot of new scenarios as explained by &lt;a href=&quot;http://nerddawg.blogspot.com/2009/04/silverlight-out-of-browser-support-what.html&quot;&gt;Ashish Shetty&lt;/a&gt;. It surely is a great feature and will evolve to provide more options with upcoming releases of Silverlight. But it doesn’t help you in making your application portable. OOB helps in storing a hosted Silverlight application onto your desktop for running it from outside the browser. These applications will run only from the systems where they were installed. &lt;/p&gt;  &lt;p&gt;However, applications created using Desklighter can be copied to another computer and it will work from it without any issues. If the computer doesn’t have Silverlight installed, the application will show a banner (default ‘No Silverlight’ experience) prompting the user to download and install the Silverlight plug-in.&lt;/p&gt;  &lt;p&gt;Note that Desklighter is best suited for making already existing self contained Silverlight applications (where all the dependent resources are available within the xap file) portable. Examples include games, demos, proof-of-concepts, presentations, electronic brochures, tools and utilities.&lt;/p&gt;  </description><link>http://ctlabs.blogspot.com/2009/09/desklighter-update-beta-2-with-more.html</link><author>noreply@blogger.com (Sameer C. Thiruthikad)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh4.ggpht.com/_R783RuSyUoM/Sp0jVkdQo6I/AAAAAAAABWY/CiqEN89InbA/s72-c/desklighterbutton_white_thumb.png?imgmax=800" height="72" width="72"/><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-17497884.post-53567856183496676</guid><pubDate>Tue, 18 Aug 2009 09:59:00 +0000</pubDate><atom:updated>2009-08-19T12:03:51.161+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">DotNet</category><category domain="http://www.blogger.com/atom/ns#">Silverlight</category><title>Silverlight 3 Offline / OOB/ Out Of Browser Feature</title><description>&lt;h3&gt;

Introduction&lt;/h3&gt;
&lt;div&gt;
It is possible to configure Silverlight-based applications so that users can install them from their host Web pages and run them outside the browser. This feature is known by the name ‘OOB’ or ‘Out-of-Browser’ support, and sometimes just ‘Offline’ support.&lt;br /&gt;
&lt;br /&gt;
Try a&amp;nbsp;&lt;a href=&quot;http://wayfarer.bizhat.com/techbites/workshop/silverlight/mysloob/index.html&quot;&gt;sample online&lt;/a&gt;&amp;nbsp;or download the&amp;nbsp;&lt;a href=&quot;http://wayfarer.bizhat.com/techbites/workshop/silverlight/mysloob.zip&quot;&gt;source code&lt;/a&gt;.&lt;/div&gt;
&lt;h3&gt;

Configuration&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Go to the Project Properties window (Right click on the Silverlight project in Visual Studio 2008 and choose ‘Properties’). &lt;/li&gt;
&lt;li&gt;On the ‘Silverlight’ tab, select ‘Enable running application out of the browser’. &lt;/li&gt;
&lt;li&gt;Click on the ‘Out-of-Browser Settings…’ button. &lt;/li&gt;
&lt;li&gt;Fill or change the details like Window Title (Appears in the title bar of the out-of-browser application window), Width and Height (Indicates the dimensions of the out-of-browser application window; default is 800x600), Shortcut name (Appears in the out-of-browser installation dialog box and on the installed application shortcut or shortcuts), and Download description (Appears as a tooltip on the installed application shortcuts). Also assign application icon in a set of standard sizes (The operating system chooses the most appropriate icon to display in the installation dialog box, the application window, Windows Explorer, and Windows taskbar/Macintosh dock bar). These icons must be ‘png’ files and need to be added to the project initially with ‘Build Action’ set as ‘Content’. Optionally, &#39;Enable GPU Acceleration&#39; can be turned on for graphics rich applications to enhance graphics performance by using hardware acceleration.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrHcVKH-nl8e-JLFUKinCoTm5cFKry8cbYiJ7ge3thXt8lLJcFAu0WHWO9HuduP7F6y9THTwc2s2R3G_9mqx9CHIDhxRFjwPKpERfimGqi4Goe2DunHzRKWcBC2wbLbVfinqOI7Q/s1600-h/sloobsettings.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrHcVKH-nl8e-JLFUKinCoTm5cFKry8cbYiJ7ge3thXt8lLJcFAu0WHWO9HuduP7F6y9THTwc2s2R3G_9mqx9CHIDhxRFjwPKpERfimGqi4Goe2DunHzRKWcBC2wbLbVfinqOI7Q/s320/sloobsettings.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
The values in the ‘Out-of-Browser Settings’ dialog box is used to generate an ‘OutOfBrowserSettings.xml’ file located in the project Properties folder. Any changes to this file are reflected in the designer. This file is used to populate the application manifest (AppManifest.xaml) with the specified values.   &lt;br /&gt;
&lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;background-color: #f4f4f4; border-bottom: silver 1px solid; border-left: silver 1px solid; border-right: silver 1px solid; border-top: silver 1px solid; cursor: text; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 20px 0px 10px; max-height: 200px; overflow: auto; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px; text-align: left; width: 97.5%;&quot;&gt;
&lt;pre id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;OutOfBrowserSettings&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;ShortName&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;MySloob Application&quot;&lt;/span&gt; 
                      &lt;span style=&quot;color: red;&quot;&gt;EnableGPUAcceleration&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;False&quot;&lt;/span&gt; 
                      &lt;span style=&quot;color: red;&quot;&gt;ShowInstallMenuItem&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;True&quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;OutOfBrowserSettings.Blurb&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;MySloob Application on your desktop; at home, at work or on the go.&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;OutOfBrowserSettings.Blurb&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;OutOfBrowserSettings.WindowSettings&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;WindowSettings&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;Title&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;MySloob Application&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;Height&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;400&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;Width&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;600&quot;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;
  &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;OutOfBrowserSettings.WindowSettings&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;OutOfBrowserSettings.Icons&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;Icon&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;Size&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;16,16&quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;Icons/MySloob16.png&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;Icon&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;Icon&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;Size&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;32,32&quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;Icons/MySloob32.png&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;Icon&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;Icon&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;Size&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;48,48&quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;Icons/MySloob48.png&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;Icon&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;Icon&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;Size&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;128,128&quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;Icons/MySloob128.png&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;Icon&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;OutOfBrowserSettings.Icons&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;OutOfBrowserSettings&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;span style=&quot;font-size: 22px; font-weight: bold;&quot;&gt;Installation&lt;/span&gt;&lt;br /&gt;
When an application is properly configured for OOB, a new right-click menu option will be available as ‘Install &amp;lt;ApplicationName&amp;gt; Application onto this computer…’. Clicking on this will launch the installer dialog where the user can choose to create shortcuts on Start menu and Desktop. When ‘OK’ is clicked, the application will be installed to the local computer and it will be launched in a new application window. ‘Remove this application…’ right-click menu will now be available within this application to uninstall it from the computer. &lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrKUKLFilWtBqRll7140xlKfGagfLr11gee54Z9u3YS9xSL-eve2zCg_GkoyEs-SK-MdAuQiJdfKHHPcGtQ1AIdKGDT3oOx0BiEBT6U4FslWNPOWL56gh016x6wlUdy7dzBc0LHg/s1600-h/sloobmenu.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrKUKLFilWtBqRll7140xlKfGagfLr11gee54Z9u3YS9xSL-eve2zCg_GkoyEs-SK-MdAuQiJdfKHHPcGtQ1AIdKGDT3oOx0BiEBT6U4FslWNPOWL56gh016x6wlUdy7dzBc0LHg/s320/sloobmenu.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaU7ncPmDQKwy9PsenFCA2uJk2LL4H6omX_cRp7gK5oJSo8TqwHb5hudODwtjh80wg5wVzwQmHeIftoGRDsYcJqGx9GuWHCqNlxIj1trhRenuQFIIYrAfRnTNx8i7ovLfgXKHOog/s1600-h/sloobinstall.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaU7ncPmDQKwy9PsenFCA2uJk2LL4H6omX_cRp7gK5oJSo8TqwHb5hudODwtjh80wg5wVzwQmHeIftoGRDsYcJqGx9GuWHCqNlxIj1trhRenuQFIIYrAfRnTNx8i7ovLfgXKHOog/s320/sloobinstall.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh470_vOksTpnmRHoM4as7jCom4YzS9erBsmUke8MYO9mZ8RxP2sj2Lw7cic2zCVD5hSy010UxvsR4b8MmiJslOM3p9FMaa6WIlUA6iGLuU6RMCeeVgKPuvIM5zR2OkB3reZAuggg/s1600-h/sloobapp.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh470_vOksTpnmRHoM4as7jCom4YzS9erBsmUke8MYO9mZ8RxP2sj2Lw7cic2zCVD5hSy010UxvsR4b8MmiJslOM3p9FMaa6WIlUA6iGLuU6RMCeeVgKPuvIM5zR2OkB3reZAuggg/s320/sloobapp.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 22px; font-weight: bold;&quot;&gt;Internals&lt;/span&gt;&lt;br /&gt;
If you look at the installed application’s shortcut properties, you will see that the target points to ‘C:\Program Files\Microsoft Silverlight\sllauncher.exe 1527765212.localhost’. &lt;br /&gt;
&lt;br /&gt;
If you search for that random number (in my case: 1527765212) in Windows explorer, you will find a folder like this: &lt;br /&gt;
&lt;br /&gt;
C:\Users\&amp;lt;user.name&amp;gt;\AppData\LocalLow\Microsoft\Silverlight\OutOfBrowser\1527765212.localhost &lt;br /&gt;
&lt;br /&gt;
sllauncher.exe is the ‘Microsoft Silverlight Out-of-Browser Launcher’ application that gets installed along with Silverlight. It is a win32 application that loads the Silverlight application in its own browser host. &lt;br /&gt;
&lt;br /&gt;
When you install a Silverlight OOB application, the XAP file is downloaded to the local computer and is stored in a folder within the user’s local app data called as ‘offline application cache’. The folder is named with a unique AppId which consists of a random number and the source of origin of the application (in this case: localhost). This folder will also have the application meta data and an index.html which has an object tag to load the Silverlight application. &lt;br /&gt;
&lt;br /&gt;
sllauncher.exe takes this AppId (Examples: 1527765212.localhost, 1930341777.wayfarer.bizhat.com) as a parameter and then sets its window according to the metadata available in the specified offline application cache. It then loads the index.html in its browser host which in turn will display the Silverlight application.&lt;br /&gt;
metadata:&lt;br /&gt;
&lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;background-color: #f4f4f4; border-bottom: silver 1px solid; border-left: silver 1px solid; border-right: silver 1px solid; border-top: silver 1px solid; cursor: text; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 20px 0px 10px; max-height: 200px; overflow: auto; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px; text-align: left; width: 97.5%;&quot;&gt;
&lt;div style=&quot;text-align: auto;&quot;&gt;
&lt;span style=&quot;white-space: pre;&quot;&gt;ShortcutName=MySloob Application&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;white-space: pre;&quot;&gt;Name=MySloob Application&lt;/span&gt;&lt;br /&gt;
&lt;pre id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;Title=MySloob Application
Description=MySloob Application on your desktop; at home, at work or on the go.
AppID=1527765212.localhost
RuntimeVersion=3.0.40624.0
FinalAppUri=file:///C:/Temp/MySloob/MySloob/Bin/Debug/MySloob.xap
OriginalSourceUri=file:///C:/Temp/MySloob/MySloob/Bin/Debug/MySloob.xap
SourceDomain=localhost
WindowHeight=400
WindowWidth=600
EnableGPUAcceleration=False
TrimmedName=MySloob Application
TrimmedTitle=MySloob Application
TrimmedSourceDomain=localhost
CustomIcon=1
LaunchPath=C:\Users\sameer.thiruthikad\AppData\LocalLow\Microsoft\Silverlight\OutOfBrowser\1527765212.localhost\index.html&lt;/pre&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-size: 16px; line-height: normal;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: small;&quot;&gt;&lt;span style=&quot;font-size: 11px; line-height: 16px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
index.html: &lt;br /&gt;
&lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;background-color: #f4f4f4; border-bottom: silver 1px solid; border-left: silver 1px solid; border-right: silver 1px solid; border-top: silver 1px solid; cursor: text; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 20px 0px 10px; max-height: 200px; overflow: auto; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px; text-align: left; width: 97.5%;&quot;&gt;
&lt;div style=&quot;text-align: auto;&quot;&gt;
&lt;span style=&quot;white-space: pre;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;!&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;DOCTYPE&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;html&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;PUBLIC&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;&quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;html&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;xmlns&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;http://www.w3.org/1999/xhtml&quot;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span style=&quot;color: green;&quot;&gt;&amp;lt;!-- saved from url=(0014)about:internet --&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;head&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;style&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&#39;text/css&#39;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
    html, body { height: 100%; overflow: auto; }
    body { padding: 0; margin: 0; }
    #silverlightControlHost { height: 100%; }
  &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;style&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;head&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;body&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;scroll&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;no&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;onload&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;document.getElementById(&#39;_sl&#39;).focus()&quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;div&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;silverlightControlHost&quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;object&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&#39;_sl&#39;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;data&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;data:application/x-silverlight,&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;application/x-silverlight&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;width&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;100%&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;height&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;100%&quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
          &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;param&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;source&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;offline://1527765212.localhost&quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;
          &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;param&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;background&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;White&quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;
          &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;param&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;enableGPUAcceleration&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;False&quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;
          &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;a&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;href&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;http://go.microsoft.com/fwlink/?LinkID=124807&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;style&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;text-decoration: none;&quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
              &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;img&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;src&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;http://go.microsoft.com/fwlink/?LinkId=108181&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;alt&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;Get Microsoft Silverlight&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;style&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;border-style: none&quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;
          &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;a&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;object&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;iframe&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;style&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&#39;visibility:hidden;height:0;width:0;border:0px&#39;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;iframe&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;div&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;body&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;html&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-size: 16px; line-height: normal;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: small;&quot;&gt;&lt;span style=&quot;font-size: 11px; line-height: 16px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;h3&gt;

Sample Application&lt;/h3&gt;
There are a set of classes and methods available in Silverlight to install an application through code, to check for updates, to determine network status, etc. These are illustrated through the sample below:&lt;br /&gt;
&lt;br /&gt;
XAML:&lt;br /&gt;
&lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;background-color: #f4f4f4; border-bottom: silver 1px solid; border-left: silver 1px solid; border-right: silver 1px solid; border-top: silver 1px solid; cursor: text; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 20px 0px 10px; max-height: 200px; overflow: auto; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px; text-align: left; width: 97.5%;&quot;&gt;
&lt;div style=&quot;text-align: auto;&quot;&gt;
&lt;span style=&quot;white-space: pre;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;Grid&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;x:Name&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;LayoutRoot&quot;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;pre id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;          &lt;span style=&quot;color: red;&quot;&gt;Background&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;Beige&quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
        &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;StackPanel&lt;/span&gt;  &lt;span style=&quot;color: red;&quot;&gt;HorizontalAlignment&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;Center&quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;TextBlock&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;Text&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;Welcome to &#39;MySloob&#39; - A sample Silverlight Out-Of-Browser Application!&quot;&lt;/span&gt;
                       &lt;span style=&quot;color: red;&quot;&gt;HorizontalAlignment&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;Center&quot;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;
            &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;TextBlock&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;x:Name&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;uxDescription&quot;&lt;/span&gt;
                       &lt;span style=&quot;color: red;&quot;&gt;Text&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;()&quot;&lt;/span&gt;
                       &lt;span style=&quot;color: red;&quot;&gt;HorizontalAlignment&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;Center&quot;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;
            &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;Button&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;x:Name&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;uxInstall&quot;&lt;/span&gt;
                    &lt;span style=&quot;color: red;&quot;&gt;Margin&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;20&quot;&lt;/span&gt;
                    &lt;span style=&quot;color: red;&quot;&gt;Height&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;50&quot;&lt;/span&gt;
                    &lt;span style=&quot;color: red;&quot;&gt;Width&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;200&quot;&lt;/span&gt;
                    &lt;span style=&quot;color: red;&quot;&gt;Content&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;Install Me&quot;&lt;/span&gt;
                    &lt;span style=&quot;color: red;&quot;&gt;Click&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;uxInstall_Click&quot;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;
            &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;Ellipse&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;Height&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;100&quot;&lt;/span&gt;
                     &lt;span style=&quot;color: red;&quot;&gt;Width&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;{Binding ElementName=uxSlider,Path=Value}&quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
                &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;Ellipse.Fill&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
                    &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;LinearGradientBrush&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;EndPoint&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;0.5,1&quot;&lt;/span&gt;
                                         &lt;span style=&quot;color: red;&quot;&gt;StartPoint&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;0.5,0&quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
                        &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;GradientStop&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;Color&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;Orange&quot;&lt;/span&gt;
                                      &lt;span style=&quot;color: red;&quot;&gt;Offset&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;0&quot;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;
                        &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;GradientStop&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;Color&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;Red&quot;&lt;/span&gt;
                                      &lt;span style=&quot;color: red;&quot;&gt;Offset&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;.5&quot;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;
                        &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;GradientStop&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;Color&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;Yellow&quot;&lt;/span&gt;
                                      &lt;span style=&quot;color: red;&quot;&gt;Offset&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;1&quot;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;
                    &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;LinearGradientBrush&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
                &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;Ellipse.Fill&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;Ellipse&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;Slider&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;x:Name&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;uxSlider&quot;&lt;/span&gt;
                    &lt;span style=&quot;color: red;&quot;&gt;Margin&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;25&quot;&lt;/span&gt;
                    &lt;span style=&quot;color: red;&quot;&gt;Width&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;300&quot;&lt;/span&gt;
                    &lt;span style=&quot;color: red;&quot;&gt;Value&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;200&quot;&lt;/span&gt;
                    &lt;span style=&quot;color: red;&quot;&gt;Minimum&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;100&quot;&lt;/span&gt;
                    &lt;span style=&quot;color: red;&quot;&gt;Maximum&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;300&quot;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;
            &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;Button&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;x:Name&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;uxCheckUpdate&quot;&lt;/span&gt;
                    &lt;span style=&quot;color: red;&quot;&gt;Height&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;50&quot;&lt;/span&gt;
                    &lt;span style=&quot;color: red;&quot;&gt;Width&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;200&quot;&lt;/span&gt;
                    &lt;span style=&quot;color: red;&quot;&gt;Content&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;Check Update&quot;&lt;/span&gt;
                    &lt;span style=&quot;color: red;&quot;&gt;Click&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;uxCheckUpdate_Click&quot;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;
            &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;TextBlock&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;x:Name&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;uxOOBStatus&quot;&lt;/span&gt;
                       &lt;span style=&quot;color: red;&quot;&gt;Margin&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;0,25,0,0&quot;&lt;/span&gt;
                       &lt;span style=&quot;color: red;&quot;&gt;Foreground&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;Blue&quot;&lt;/span&gt;
                       &lt;span style=&quot;color: red;&quot;&gt;Text&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;OOB Status&quot;&lt;/span&gt;
                       &lt;span style=&quot;color: red;&quot;&gt;HorizontalAlignment&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;Center&quot;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;
            &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;TextBlock&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;x:Name&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;uxInstallStatus&quot;&lt;/span&gt;
                       &lt;span style=&quot;color: red;&quot;&gt;Foreground&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;Brown&quot;&lt;/span&gt;
                       &lt;span style=&quot;color: red;&quot;&gt;Text&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;Install Status&quot;&lt;/span&gt;
                       &lt;span style=&quot;color: red;&quot;&gt;HorizontalAlignment&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;Center&quot;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;
            &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;TextBlock&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;x:Name&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;uxNetworkStatus&quot;&lt;/span&gt;
                       &lt;span style=&quot;color: red;&quot;&gt;Foreground&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;Black&quot;&lt;/span&gt;
                       &lt;span style=&quot;color: red;&quot;&gt;Text&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;Network Status&quot;&lt;/span&gt;
                       &lt;span style=&quot;color: red;&quot;&gt;HorizontalAlignment&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;Center&quot;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;
            &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;TextBlock&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;Text&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;Last Modified: 2009-August-18, 05:00 PM IST by Sameer C Thiruthikad&quot;&lt;/span&gt;
                       &lt;span style=&quot;color: red;&quot;&gt;HorizontalAlignment&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;Center&quot;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;
        &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;StackPanel&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;Grid&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
C# Code:&lt;br /&gt;
&lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;background-color: #f4f4f4; border-bottom: silver 1px solid; border-left: silver 1px solid; border-right: silver 1px solid; border-top: silver 1px solid; cursor: text; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 20px 0px 10px; max-height: 200px; overflow: auto; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px; text-align: left; width: 97.5%;&quot;&gt;
&lt;span style=&quot;white-space: pre;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; MainPage()&lt;/span&gt;&lt;br /&gt;
&lt;pre id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;{
    InitializeComponent();

    UpdateUI();
    Application.Current.InstallStateChanged += &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; EventHandler(app_InstallStateChanged);
    Application.Current.CheckAndDownloadUpdateCompleted += &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; CheckAndDownloadUpdateCompletedEventHandler(app_CheckAndDownloadUpdateCompleted);
    System.Net.NetworkInformation.NetworkChange.NetworkAddressChanged += &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; System.Net.NetworkInformation.NetworkAddressChangedEventHandler(NetworkChange_NetworkAddressChanged);
}

&lt;span style=&quot;color: blue;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; uxInstall_Click(&lt;span style=&quot;color: blue;&quot;&gt;object&lt;/span&gt; sender, RoutedEventArgs e)
{
    &lt;span style=&quot;color: blue;&quot;&gt;try&lt;/span&gt;
    {
        Application.Current.Install();
    }
    &lt;span style=&quot;color: blue;&quot;&gt;catch&lt;/span&gt; (InvalidOperationException)
    {
        MessageBox.Show(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;The application is already installed.&quot;&lt;/span&gt;);
    }
}

&lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; app_InstallStateChanged(&lt;span style=&quot;color: blue;&quot;&gt;object&lt;/span&gt; sender, EventArgs e)
{
    UpdateUI();
}


&lt;span style=&quot;color: blue;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; uxCheckUpdate_Click(&lt;span style=&quot;color: blue;&quot;&gt;object&lt;/span&gt; sender, RoutedEventArgs e)
{
    Application.Current.CheckAndDownloadUpdateAsync();
}

&lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; app_CheckAndDownloadUpdateCompleted(&lt;span style=&quot;color: blue;&quot;&gt;object&lt;/span&gt; sender, CheckAndDownloadUpdateCompletedEventArgs e)
{
    &lt;span style=&quot;color: blue;&quot;&gt;if&lt;/span&gt; (e.UpdateAvailable)
    {
        MessageBox.Show(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;An application update has been downloaded. Please restart.&quot;&lt;/span&gt;);
    }
    &lt;span style=&quot;color: blue;&quot;&gt;else&lt;/span&gt;
    {
        MessageBox.Show(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;There is no update available.&quot;&lt;/span&gt;);
    }
}

&lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; NetworkChange_NetworkAddressChanged(&lt;span style=&quot;color: blue;&quot;&gt;object&lt;/span&gt; sender, EventArgs e)
{
    UpdateUI();
}

&lt;span style=&quot;color: blue;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; UpdateUI()
{
    &lt;span style=&quot;color: blue;&quot;&gt;if&lt;/span&gt; (Application.Current.InstallState == InstallState.Installed)
    {
        &lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;.uxInstall.IsEnabled = &lt;span style=&quot;color: blue;&quot;&gt;false&lt;/span&gt;;
    }
    &lt;span style=&quot;color: blue;&quot;&gt;else&lt;/span&gt;
    {
        &lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;.uxInstall.IsEnabled = &lt;span style=&quot;color: blue;&quot;&gt;true&lt;/span&gt;;
    }

    &lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;.uxOOBStatus.Text = &lt;span style=&quot;color: #006080;&quot;&gt;&quot;OOB Status: &quot;&lt;/span&gt; + Application.Current.IsRunningOutOfBrowser.ToString();
    &lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;.uxInstallStatus.Text = &lt;span style=&quot;color: #006080;&quot;&gt;&quot;Install Status: &quot;&lt;/span&gt; + Application.Current.InstallState.ToString();
    &lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;.uxDescription.Text = &lt;span style=&quot;color: #006080;&quot;&gt;&quot;(&quot;&lt;/span&gt; + Deployment.Current.OutOfBrowserSettings.Blurb + &lt;span style=&quot;color: #006080;&quot;&gt;&quot;)&quot;&lt;/span&gt;;
   
    &lt;span style=&quot;color: blue;&quot;&gt;bool&lt;/span&gt; online = System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable();

    &lt;span style=&quot;color: blue;&quot;&gt;if&lt;/span&gt; (online)
    {
        &lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;.uxNetworkStatus.Foreground = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; SolidColorBrush(Colors.Green);
        &lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;.uxNetworkStatus.Text = &lt;span style=&quot;color: #006080;&quot;&gt;&quot;Network Status: Online&quot;&lt;/span&gt;;
    }
    &lt;span style=&quot;color: blue;&quot;&gt;else&lt;/span&gt;
    {
        &lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;.uxNetworkStatus.Foreground = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; SolidColorBrush(Colors.Red);
        &lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;.uxNetworkStatus.Text = &lt;span style=&quot;color: #006080;&quot;&gt;&quot;Network Status: Offline&quot;&lt;/span&gt;;
    }
}&lt;/pre&gt;
&lt;/div&gt;
Try this &lt;a href=&quot;http://wayfarer.bizhat.com/techbites/workshop/silverlight/mysloob/index.html&quot;&gt;sample online&lt;/a&gt;&amp;nbsp;or download the &lt;a href=&quot;http://wayfarer.bizhat.com/techbites/workshop/silverlight/mysloob.zip&quot;&gt;source code&lt;/a&gt;.</description><link>http://ctlabs.blogspot.com/2009/08/silverlight-3-offline-oob-out-of.html</link><author>noreply@blogger.com (Sameer C. Thiruthikad)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrHcVKH-nl8e-JLFUKinCoTm5cFKry8cbYiJ7ge3thXt8lLJcFAu0WHWO9HuduP7F6y9THTwc2s2R3G_9mqx9CHIDhxRFjwPKpERfimGqi4Goe2DunHzRKWcBC2wbLbVfinqOI7Q/s72-c/sloobsettings.png" height="72" width="72"/><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-17497884.post-7993233808995190955</guid><pubDate>Tue, 11 Aug 2009 07:22:00 +0000</pubDate><atom:updated>2009-08-11T12:52:26.024+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Windows</category><title>My Windows 7 Experience</title><description>&lt;p&gt;I installed Winodws 7 on my work computer yesterday. It is the latest Operating System from Microsoft after Vista. I was &lt;a href=&quot;http://ctlabs.blogspot.com/2007/03/my-windows-vista-experience.html&quot;&gt;using Vista&lt;/a&gt; since long and had felt it was much better than XP. The initial release had many issues but the service pack that followed (SP1) fixed most of them. But still there were many areas for improvement in Vista, especially on the performance side. &lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;http://lh4.ggpht.com/_R783RuSyUoM/SoEcLaUdE-I/AAAAAAAABT8/MVqfX_dCFh8/s1600-h/win7%5B3%5D.jpg&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px&quot; title=&quot;win7&quot; border=&quot;0&quot; alt=&quot;win7&quot; src=&quot;http://lh5.ggpht.com/_R783RuSyUoM/SoEcMMin8nI/AAAAAAAABUA/S0cvZr0Is3c/win7_thumb%5B1%5D.jpg?imgmax=800&quot; width=&quot;273&quot; height=&quot;52&quot; /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Windows 7 has successfully addressed many such pain areas in Vista and it performs better. Apart from the multi-touch support, there aren&#39;t many new visible features, as the Win 7 team has focused more on performance and compatibility issues.&lt;/p&gt;  &lt;p&gt;It installed quickly and booted fast. The Enterprise edition (there are &lt;a href=&quot;http://en.wikipedia.org/wiki/Windows_7_editions&quot;&gt;many editions&lt;/a&gt; to choose from) took only around 9 GB of my hard disk space after installation. The changing desktop background images are nice. The changes in taskbar look and behavior will not be missed. ‘Show desktop’ is now at the right most corner and has a new ‘peek’ feature. The quick launch bar is missing and taskbar takes up that role as well. Here you will have to do ‘Pin to Taskbar’ on applications in start menu to make them stick to task bar as quick launch icons. Then you wonder how to launch another instance of an application as the quick launch icon turns to a minimized application during launch. Well, learn a new short cut (Shift + Click) to do this. There are many such &lt;a href=&quot;http://en.wikipedia.org/wiki/Features_new_to_Windows_7&quot;&gt;new features&lt;/a&gt; that is supposed to make our lives better. :)&lt;/p&gt;  &lt;p&gt;I installed all my work applications and &lt;a href=&quot;http://wayfarer.bizhat.com/techbites/reference/software.html&quot;&gt;favorite tools&lt;/a&gt; and configured them to &lt;a href=&quot;http://wayfarer.bizhat.com/techbites/reference/systemsetup.html&quot;&gt;my liking&lt;/a&gt;. All of them worked without any issues. The touch feature in Windows 7 require a supporting hardware. We have one big HP Touch Smart system here where the touch features work nicely.&lt;/p&gt;  </description><link>http://ctlabs.blogspot.com/2009/08/my-windows-7-experience.html</link><author>noreply@blogger.com (Sameer C. Thiruthikad)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh5.ggpht.com/_R783RuSyUoM/SoEcMMin8nI/AAAAAAAABUA/S0cvZr0Is3c/s72-c/win7_thumb%5B1%5D.jpg?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-17497884.post-2815383377176708783</guid><pubDate>Mon, 03 Aug 2009 09:13:00 +0000</pubDate><atom:updated>2009-08-03T14:43:12.369+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Misc Products</category><title>Microsoft Tag</title><description>&lt;p&gt;A High Capacity Color Barcode (HCCB), also branded Microsoft Tag, is a type of barcode that uses shapes, instead of black-and-white lines or squares used by other barcode systems. HCCB is not intended to replace traditional barcodes, but rather enhance them by allowing more information to be stored.&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;http://lh3.ggpht.com/_R783RuSyUoM/SnaqI-XJ2GI/AAAAAAAABT0/2ukmx6dk9Ls/s1600-h/tag_custom%5B21%5D.png&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px&quot; title=&quot;Custom Tag&quot; border=&quot;0&quot; alt=&quot;Custom Tag&quot; src=&quot;http://lh6.ggpht.com/_R783RuSyUoM/SnaqJjodbJI/AAAAAAAABT4/JO5znuFmytY/tag_custom_thumb%5B19%5D.png?imgmax=800&quot; width=&quot;190&quot; height=&quot;191&quot; /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;h5&gt;Creating Tags&lt;/h5&gt;  &lt;ul&gt;   &lt;li&gt;Go to &lt;a href=&quot;http://tag.microsoft.com&quot;&gt;http://tag.microsoft.com&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;Associate your Live id (hotmail email address is fine) with the Tag site and sign in. &lt;/li&gt;    &lt;li&gt;Click on the &#39;Create Tag&#39; button and follow the directions. &lt;/li&gt;    &lt;li&gt;Tag can be of type Url, Contact card, or plain text. &lt;/li&gt;    &lt;li&gt;Once tag is created, the information we provided is stored in Microsoft servers and a unique id is associated with it. This id is encoded in a graphical image to generate the tag. &lt;/li&gt;    &lt;li&gt;Click on the &#39;Render&#39; button to get the generated tag in the format of your choice (png, pdf, jpg, etc). &lt;/li&gt;    &lt;li&gt;It is also possible to get it in custom format so that it can be used by overlaying on another image.&lt;/li&gt; &lt;/ul&gt;  &lt;h5&gt;Using Tags&lt;/h5&gt;  &lt;ul&gt;   &lt;li&gt;The tags can be used anywhere in web (sites, blogs, etc.) as images. &lt;/li&gt;    &lt;li&gt;Tags can be printed and used on real world objects like books, product package, etc. &lt;/li&gt;    &lt;li&gt;They can even be printed big for displaying on a hoarding.&lt;/li&gt; &lt;/ul&gt;  &lt;h5&gt;Reading Tags&lt;/h5&gt;  &lt;ul&gt;   &lt;li&gt;Tags are read using a mobile device having camera. &lt;/li&gt;    &lt;li&gt;The device need to have a software named &#39;Microsoft Tag Application&#39; or simply &#39;Tag Reader&#39; which can be installed freely from &lt;a href=&quot;http://gettag.mobi/&quot;&gt;http://gettag.mobi&lt;/a&gt;. &lt;/li&gt;    &lt;li&gt;Start this application in your device and just point the camera onto to a tag to read it. &lt;/li&gt;    &lt;li&gt;It works by decoding the id encoded in the image and then connecting to internet to get the associated details from Microsoft servers.&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;To see more samples, visit my workshop page on this at: &lt;a href=&quot;http://wayfarer.bizhat.com/techbites/workshop/tag.html&quot;&gt;wayfarer.bizhat.com/techbites/workshop/tag.html&lt;/a&gt;&lt;/p&gt;  </description><link>http://ctlabs.blogspot.com/2009/08/microsoft-tag.html</link><author>noreply@blogger.com (Sameer C. Thiruthikad)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh6.ggpht.com/_R783RuSyUoM/SnaqJjodbJI/AAAAAAAABT4/JO5znuFmytY/s72-c/tag_custom_thumb%5B19%5D.png?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-17497884.post-8161142805257571151</guid><pubDate>Mon, 01 Jun 2009 09:54:00 +0000</pubDate><atom:updated>2009-06-01T15:28:22.441+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Misc Products</category><title>Microsoft Bing Decision Engine</title><description>Here comes a new &lt;strike&gt;search&lt;/strike&gt; decision engine from Microsoft to replace it’s existing Live Search: &lt;br /&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;a href=&quot;http://www.bing.com/&quot;&gt;www.bing.com&lt;/a&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot;&gt;
Here is a pretty looking view of it:&lt;/div&gt;
&lt;div align=&quot;left&quot;&gt;
&lt;/div&gt;
&lt;div align=&quot;left&quot;&gt;
&lt;a href=&quot;http://lh3.ggpht.com/_R783RuSyUoM/SiOlbZ8i9KI/AAAAAAAABTU/jA5-nqxDCS4/s1600-h/bing%5B3%5D.jpg&quot;&gt;&lt;img alt=&quot;bing&quot; border=&quot;0&quot; height=&quot;370&quot; src=&quot;http://lh5.ggpht.com/_R783RuSyUoM/SiOlcYBcvRI/AAAAAAAABTY/6dHpa8V_IEw/bing_thumb%5B1%5D.jpg?imgmax=800&quot; style=&quot;border: 0px none; display: block; float: none; margin-left: auto; margin-right: auto;&quot; title=&quot;bing&quot; width=&quot;459&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Read more about it at: &lt;a href=&quot;http://www.microsoft.com/presspass/presskits/bing/default.mspx&quot;&gt;http://www.microsoft.com/presspass/presskits/bing/default.mspx&lt;/a&gt;</description><link>http://ctlabs.blogspot.com/2009/06/microsoft-bing-decision-engine.html</link><author>noreply@blogger.com (Sameer C. Thiruthikad)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh5.ggpht.com/_R783RuSyUoM/SiOlcYBcvRI/AAAAAAAABTY/6dHpa8V_IEw/s72-c/bing_thumb%5B1%5D.jpg?imgmax=800" height="72" width="72"/><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-17497884.post-5042445659695654149</guid><pubDate>Mon, 18 May 2009 08:45:00 +0000</pubDate><atom:updated>2009-05-18T14:15:12.435+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Misc Products</category><title>Wolfram Alpha Computational Knowledge Engine</title><description>&lt;p&gt;Wolfram Alpha Answer Engine gets us to what people thought computers would be able to do 50 years ago: quickly find answers to all the factual questions! &lt;/p&gt;  &lt;p&gt;Stephen Wolfram, the British physicist behind this recently launched project clarifies that Wolfram Alpha is a website with one simple input field that gives access to a huge system, with trillions of pieces of curated data and millions of lines of algorithms. &lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;http://www.wolframalpha.com/&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px&quot; title=&quot;wolframalpha&quot; border=&quot;0&quot; alt=&quot;wolframalpha&quot; src=&quot;http://lh3.ggpht.com/_R783RuSyUoM/ShEgFwEWsDI/AAAAAAAABTQ/4ruvh00__u0/wolframalpha%5B4%5D.jpg?imgmax=800&quot; width=&quot;412&quot; height=&quot;110&quot; /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;It is not a search engine that lists out numerous links to information that exist on the web. Instead, it actually computes the answer using the available data and displays it in a easily readable format. &lt;/p&gt;  &lt;p&gt;Link: &lt;a href=&quot;http://www.wolframalpha.com/&quot;&gt;http://www.wolframalpha.com/&lt;/a&gt;&lt;/p&gt;  </description><link>http://ctlabs.blogspot.com/2009/05/wolfram-alpha-computational-knowledge.html</link><author>noreply@blogger.com (Sameer C. Thiruthikad)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh3.ggpht.com/_R783RuSyUoM/ShEgFwEWsDI/AAAAAAAABTQ/4ruvh00__u0/s72-c/wolframalpha%5B4%5D.jpg?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-17497884.post-6381249503602034058</guid><pubDate>Thu, 14 May 2009 11:38:00 +0000</pubDate><atom:updated>2009-05-14T17:43:35.187+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">DotNet</category><category domain="http://www.blogger.com/atom/ns#">Surface</category><title>Microsoft Surface Applications - Deployment and Object Routing</title><description>Continued from: &lt;a href=&quot;http://ctlabs.blogspot.com/2009/05/microsoft-surface-tagged-objects-and.html&quot;&gt;Microsoft Surface Tagged Objects and Tag Visualizations&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
When users interact with a Microsoft Surface unit, they launch the applications from Launcher.&amp;nbsp; Launcher is the menu that displays the applications that are available to users in a horizontal interactive strip.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://lh6.ggpht.com/_R783RuSyUoM/SgwCnTZQTZI/AAAAAAAABTA/SJieM6ZeN7Y/s1600-h/surfacelauncher%5B4%5D.jpg&quot;&gt;&lt;img alt=&quot;surfacelauncher&quot; border=&quot;0&quot; height=&quot;212&quot; src=&quot;http://lh5.ggpht.com/_R783RuSyUoM/SgwCoCoIOXI/AAAAAAAABTE/E1MlEQhevqA/surfacelauncher_thumb%5B2%5D.jpg?imgmax=800&quot; style=&quot;border: 0px none; display: block; float: none; margin-left: auto; margin-right: auto;&quot; title=&quot;surfacelauncher&quot; width=&quot;445&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
&amp;nbsp;As part of deploying the Surface application, we must register it with Surface so that it is available in the Launcher. This is done by copying the application’s xml file to the Surface’s program data folder (%PROGRAMDATA%\Microsoft\Surface\Programs).&lt;br /&gt;
&lt;br /&gt;
This application xml file is created by default when the Visual Studio project template is used. Otherwise, we can create a normal xml file with the file name equivalent as the project (executable) name and with the following tags.&lt;br /&gt;
&lt;div style=&quot;background-color: #f4f4f4; border: 1px solid gray; cursor: text; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 8pt; line-height: 12pt; margin: 20px 0px 10px; max-height: 200px; overflow: auto; padding: 4px; width: 97.5%;&quot;&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-style: none; color: black; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 100%;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;xml&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;version&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;1.0&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;encoding&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;utf-8&quot;&lt;/span&gt; ?&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;ss:ApplicationInfo&lt;/span&gt;
 &lt;span style=&quot;color: red;&quot;&gt;xmlns:xsi&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&lt;/span&gt;
 &lt;span style=&quot;color: red;&quot;&gt;xmlns:ss&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;http://schemas.microsoft.com/Surface/2007/ApplicationMetadata&quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;Application&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;Title&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;My Surface App&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;Title&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;Description&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;This is a sample Surface application.&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;Description&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;ExecutableFile&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;%ProgramFiles%\MyCompany\MyApp\MyApp.exe&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;ExecutableFile&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;Arguments&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;Arguments&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;IconImageFile&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;%ProgramFiles%\MyCompany\MyApp\Resources\icon.png&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;IconImageFile&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;Preview&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;PreviewImageFile&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;%ProgramFiles%\MyCompany\MyApp\Resources\iconPreview.png&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;PreviewImageFile&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;Preview&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;Tags&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;ByteTag&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;Value&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;C0&quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
        &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;Actions&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
          &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;Launch&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;
        &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;Actions&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;ByteTag&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;Tags&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;Application&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;ss:ApplicationInfo&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
The &lt;b&gt;&amp;lt;Application&amp;gt;&lt;/b&gt; tag specifies that this is a normal Surface application. Other options are &lt;b&gt;&amp;lt;AttractApplication&amp;gt;&lt;/b&gt; for attract mode (similar to screen saver) applications and &lt;b&gt;&amp;lt;ServiceApplication&amp;gt;&lt;/b&gt; for apps that run in the background and does not have a UI.&lt;br /&gt;
&lt;br /&gt;
The &lt;b&gt;&amp;lt;Title&amp;gt;&lt;/b&gt; is displayed on the Launcher all the time, and &amp;lt;Description&amp;gt; is displayed when the application is selected from the Launcher. &lt;b&gt;&amp;lt;ExecutableFile&amp;gt;&lt;/b&gt; specifies the path to the actual application exe. If the application is accepting any command line arguments it can be supplied through &lt;b&gt;&amp;lt;Arguments&amp;gt;&lt;/b&gt; tag. &lt;b&gt;&amp;lt;IconImageFile&amp;gt;&lt;/b&gt; specifies the png image to be displayed in the Launcher as application icon and &lt;b&gt;&amp;lt;Preview&amp;gt;&lt;/b&gt; specifies the image to be displayed when the application is selected in the Launcher. This can be a bigger static image(&lt;b&gt;&amp;lt;PreviewImageFile&amp;gt;&lt;/b&gt;) or a slideshow of images(&lt;b&gt;&amp;lt;SlideshowImageFile&amp;gt;&lt;/b&gt;) or a movie (&lt;b&gt;&amp;lt;MovieFile&amp;gt;&lt;/b&gt;).&lt;br /&gt;
&lt;br /&gt;
The &lt;b&gt;&amp;lt;Tags&amp;gt;&lt;/b&gt; specify the tags used by the application and &lt;b&gt;&amp;lt;Launch&amp;gt;&lt;/b&gt; is used to specify that the particular tag value is used for object routing (which is discussed later).&lt;br /&gt;
&lt;br /&gt;
To summarize the deployment steps again:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Build your Surface application in Release mode.  &lt;/li&gt;
&lt;li&gt;Copy all the files from the build folder to any location in the Surface computer (typically %ProgramFiles%\CompanyName\ApplicationName\).  &lt;/li&gt;
&lt;li&gt;Make sure that this path is specified in the Application’s xml file.  &lt;/li&gt;
&lt;li&gt;Copy the Application’s xml file to (%PROGRAMDATA%\Microsoft\Surface\Programs folder.&lt;/li&gt;
&lt;/ul&gt;
That’s all to it and the application will now be available in the Launcher for the user to see and launch.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Tagged Object Routing&lt;/b&gt;&lt;br /&gt;
On 2009-May-10, Microsoft released its first Service Pack (SP1) to Surface 1.0 with lots of new features and improvements. Read about them at &lt;a href=&quot;http://blogs.msdn.com/surface/archive/2009/05/10/service-pack-1-officially-released-today.aspx&quot;&gt;official Surface blog&lt;/a&gt;. &lt;br /&gt;
&lt;br /&gt;
Object Routing is one of the new SP1 features that enable the developer to configure tagged objects which can open applications without using Launcher. The tagged object can be placed anywhere on the Surface interface (attract applications, other non-registered applications or the Launcher) to bring up the list of applications that are registered with that tag. The applications will appear as tiny bubbly icons that smoothly pops up from the object and can be launched by touching them.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://lh6.ggpht.com/_R783RuSyUoM/SgwCo4oqP3I/AAAAAAAABTI/b5OIrJ3MbK0/s1600-h/surfaceobjectrouting%5B4%5D.jpg&quot;&gt;&lt;img alt=&quot;surfaceobjectrouting&quot; border=&quot;0&quot; height=&quot;217&quot; src=&quot;http://lh6.ggpht.com/_R783RuSyUoM/SgwCpoHj9II/AAAAAAAABTM/-8ry0sCMr5k/surfaceobjectrouting_thumb%5B2%5D.jpg?imgmax=800&quot; style=&quot;border: 0px none; display: block; float: none; margin-left: auto; margin-right: auto;&quot; title=&quot;surfaceobjectrouting&quot; width=&quot;464&quot; /&gt;&lt;/a&gt;&amp;nbsp; &lt;br /&gt;To enable the object routing for an applications:  &lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Specify the required type of tag (Byte/Identity) within the &lt;b&gt;&amp;lt;Tags&amp;gt;&lt;/b&gt; section of the application’s xml file and specify its value and have the &lt;b&gt;&amp;lt;Actions&amp;gt;&lt;/b&gt; as &lt;b&gt;&amp;lt;Launch&amp;gt;&lt;/b&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;background-color: #f4f4f4; border: 1px solid gray; cursor: text; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 8pt; line-height: 12pt; margin: 20px 0px 10px; max-height: 200px; overflow: auto; padding: 4px; width: 97.5%;&quot;&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-style: none; color: black; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 100%;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;ByteTag&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;Value&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;C0&quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;Actions&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;Launch&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;
  &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;Actions&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;ByteTag&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
or&lt;br /&gt;
&lt;div style=&quot;background-color: #f4f4f4; border: 1px solid gray; cursor: text; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 8pt; line-height: 12pt; margin: 20px 0px 10px; max-height: 200px; overflow: auto; padding: 4px; width: 97.5%;&quot;&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-style: none; color: black; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 100%;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;IdentityTag&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;Series&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;4245A8E4901C2C0B&quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;Actions&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;Launch&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt; 
  &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;Actions&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;IdentityTag&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
I have used an example value of C0 for Byte tag and 4245A8E4901C2C0B for Identity tag.  &lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Create a new registry key using this tag value under TagInfo section as below:&lt;/li&gt;
&lt;/ul&gt;
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Surface\TagInfo\v1.0\ByteTags\C0&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Surface\TagInfo\v1.0\IdentityTags\4245A8E4901C2C0B&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Add the following String Value items on this key    &lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Text : ‘object routing card title’.    &lt;/li&gt;
&lt;li&gt;BoundingBoxWidth : ‘3.25’.    &lt;/li&gt;
&lt;li&gt;BoundingBoxHeight : ‘2.125’.    &lt;/li&gt;
&lt;li&gt;PhysicalCenterOffsetFromTagX : ‘0’.    &lt;/li&gt;
&lt;li&gt;PhysicalCenterOffsetFromTagY : ‘0’.    &lt;/li&gt;
&lt;li&gt;OrientationOffsetFromTag : ‘0’.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
This specifies the size of tagged object (business card size is 3.25 x 2.125 inches) and the location of the tag within this object (Zero means there is no offset from the center of the object; the tag is exactly on the center of this business card sized object)&lt;br /&gt;
&lt;br /&gt;
Note that the other registry settings (enabled by default) to enable Object Routing (HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Surface\v1.0\Shell\EnableObjectRouting ) must be set as well.&lt;br /&gt;
&lt;br /&gt;
That’s all the settings we need to do to get object routing work. Now if you place a tag with the specified value, all the applications that have this tag value in their xml file registered will popup from this object.&lt;br /&gt;
&lt;br /&gt;
If you have done everything right, and still its not working as expected, refer the event log (run the command eventvwr) and navigate to Applications and Services Logs/Microsoft/Surface/Shell/Operational for any possible warnings or errors. Chances are that there is some error in the application&#39;s xml file or the registry settings. A sample warning (when the required registry entry is not present) looks like below:&lt;br /&gt;
&lt;blockquote&gt;
&lt;i&gt;The application info file C:\ProgramData\Microsoft\Surface\Programs\Macroni.xml refers to tag 29EB049F73061803, however, some configuration information for 29EB049F73061803 is missing from the registry. The default value &#39;2.125&#39; will be used for the missing setting. &lt;br /&gt;Path to the tag&#39;s missing configuration setting in the registry: &lt;br /&gt;HKEY_LOCAL_MACHINE\Software\Microsoft\Surface\TagInfo\v1.0\IdentityTags\29EB049F73061803\BoundingBoxHeight&lt;/i&gt;&lt;/blockquote&gt;
Happy coding!</description><link>http://ctlabs.blogspot.com/2009/05/microsoft-surface-applications.html</link><author>noreply@blogger.com (Sameer C. Thiruthikad)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh5.ggpht.com/_R783RuSyUoM/SgwCoCoIOXI/AAAAAAAABTE/E1MlEQhevqA/s72-c/surfacelauncher_thumb%5B2%5D.jpg?imgmax=800" height="72" width="72"/><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-17497884.post-7737924648310507588</guid><pubDate>Mon, 11 May 2009 14:18:00 +0000</pubDate><atom:updated>2009-05-14T17:12:35.630+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Surface</category><title>Microsoft Surface Tagged Objects and Tag Visualizations</title><description>Continued from &lt;a href=&quot;http://ctlabs.blogspot.com/2009/05/developing-microsoft-surface.html&quot;&gt;Developing Microsoft Surface Applications&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Microsoft Surface applications can recognize special tags besides fingers and&amp;nbsp; objects. These tags are similar to bar codes in concept and can store a particular value which can be retrieved by Surface’s vision system.&lt;br /&gt;
&lt;br /&gt;
Tags are a pattern of white dots (infrared reflective) in black background (infrared absorbing) and are normally printed on a card or are printed and stuck to the plain surface of an object. Such objects with a tag are called as Tagged Objects.&lt;br /&gt;
&lt;br /&gt;
Microsoft Surface supports two types of tags:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://lh5.ggpht.com/_R783RuSyUoM/Sggzj4gRaaI/AAAAAAAABSw/wm6iBfwlc_U/s1600-h/surfacetags%5B3%5D.jpg&quot;&gt;&lt;img alt=&quot;surfacetags&quot; border=&quot;0&quot; height=&quot;201&quot; src=&quot;http://lh6.ggpht.com/_R783RuSyUoM/Sggzku6ThLI/AAAAAAAABS0/nfYgzZ2KYfU/surfacetags_thumb%5B1%5D.jpg?imgmax=800&quot; style=&quot;border: 0px none; display: block; float: none; margin-left: auto; margin-right: auto;&quot; title=&quot;surfacetags&quot; width=&quot;309&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
&lt;b&gt;Byte Tags&lt;/b&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Stores 8 bits of data (1 byte).&lt;/li&gt;
&lt;li&gt;256 possible unique values.&lt;/li&gt;
&lt;li&gt;Smaller size (3/4 x 3/4 inches).&lt;/li&gt;
&lt;li&gt;Reliable tracking even for faster moving tags.&lt;/li&gt;
&lt;li&gt;Represented in code by ByteTag structure.&lt;/li&gt;
&lt;li&gt;ByteTag.Value property represents the tag value.&lt;/li&gt;
&lt;/ul&gt;
&lt;b&gt;Identity Tags&lt;/b&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Stores 128 bits of data (two 64 bit values).&lt;/li&gt;
&lt;li&gt;Larger range of possible unique values (i.e. 340,282,366,920,938,000,000,000,000,000,000,000,000).&lt;/li&gt;
&lt;li&gt;Larger size (1 x 1 inches).&lt;/li&gt;
&lt;li&gt;Functions better when tags are stationary or nearly stationary.&lt;/li&gt;
&lt;li&gt;Represented in code by IdentityTag structure.&lt;/li&gt;
&lt;li&gt;IdentityTag.Series and IdentityTag.Value together represents the tag value.&lt;/li&gt;
&lt;/ul&gt;
These tags are usually pre-printed and available from Microsoft or are printed using special tools that come with the Surface SDK.&lt;br /&gt;
&lt;br /&gt;
Now let us build a sample application that deals with tagged objects. Create a new Surface project and add three Tag Visualization items (Add &amp;gt; New Item &amp;gt; Visual C# &amp;gt; Surface &amp;gt; v1.0 &amp;gt; Tag Visualization (WPF)). These items defines the UI that appears when a tagged object is placed on Surface. For now, let us just specify a height and width for it and then have a blank grid with a background color.&lt;br /&gt;
&lt;div style=&quot;background-color: #f4f4f4; border: 1px solid gray; cursor: text; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 8pt; line-height: 12pt; margin: 20px 0px 10px; max-height: 200px; overflow: auto; padding: 4px; width: 97.5%;&quot;&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-style: none; color: black; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 100%;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;s:TagVisualization&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;x:Class&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;TagSample.BlueTags&quot;&lt;/span&gt;
    &lt;span style=&quot;color: red;&quot;&gt;xmlns&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;&lt;/span&gt;
    &lt;span style=&quot;color: red;&quot;&gt;xmlns:x&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;&lt;/span&gt;
    &lt;span style=&quot;color: red;&quot;&gt;xmlns:s&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;http://schemas.microsoft.com/surface/2008&quot;&lt;/span&gt;
    &lt;span style=&quot;color: red;&quot;&gt;Loaded&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;BlueTags_Loaded&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;Height&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;50&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;Width&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;50&quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;Grid&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;Background&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;Blue&quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
            
    &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;Grid&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;s:TagVisualization&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
Now add the following XAML code in the SurfaceWindow1.xaml&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: #f4f4f4; border: 1px solid gray; cursor: text; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 8pt; line-height: 12pt; margin: 20px 0px 10px; max-height: 200px; overflow: auto; padding: 4px; width: 97.5%;&quot;&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-style: none; color: black; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 100%;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;Grid&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;Background&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;{StaticResource WindowBackground}&quot;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;s:TagVisualizer&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;VisualizationAdded&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;OnVisualizationAdded&quot;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;s:TagVisualizer.Definitions&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span style=&quot;color: green;&quot;&gt;&amp;lt;!-- ByteTag: 10 = A --&amp;gt;&lt;/span&gt;
      &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;s:ByteTagVisualizationDefinition&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;Value&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;10&quot;&lt;/span&gt;
                                        &lt;span style=&quot;color: red;&quot;&gt;Source&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;BlueTags.xaml&quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;s:ByteTagVisualizationDefinition&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
      
      &lt;span style=&quot;color: green;&quot;&gt;&amp;lt;!-- ByteTag: 250 = FA --&amp;gt;&lt;/span&gt;
      &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;s:ByteTagVisualizationDefinition&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;Value&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;250&quot;&lt;/span&gt;
                                        &lt;span style=&quot;color: red;&quot;&gt;Source&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;RedTags.xaml&quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;s:ByteTagVisualizationDefinition&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;

      &lt;span style=&quot;color: green;&quot;&gt;&amp;lt;!-- IdentityTag: 500 = 1F4, 1000 = 3E8 --&amp;gt;&lt;/span&gt;
      &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;s:IdentityTagVisualizationDefinition&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;Series&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;500&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;Value&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;1000&quot;&lt;/span&gt;
                                        &lt;span style=&quot;color: red;&quot;&gt;Source&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;YellowTags.xaml&quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;s:IdentityTagVisualizationDefinition&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
      
    &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;s:TagVisualizer.Definitions&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;DockPanel&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;LastChildFill&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;False&quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;TextBlock&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;x:Name&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;uxDisplay&quot;&lt;/span&gt;
                 &lt;span style=&quot;color: red;&quot;&gt;HorizontalAlignment&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;Center&quot;&lt;/span&gt;
                 &lt;span style=&quot;color: red;&quot;&gt;DockPanel&lt;/span&gt;.&lt;span style=&quot;color: red;&quot;&gt;Dock&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;Bottom&quot;&lt;/span&gt;
                 &lt;span style=&quot;color: red;&quot;&gt;Text&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;Watch here&quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;DockPanel&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;s:TagVisualizer&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;Grid&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
TagVisualizer is a content control that automatically displays visualization objects when a tag is placed on the control.&amp;nbsp; We keep this as the root containing control within Grid. Then we define three tags using TagVisualizationDefinition. Each definition specifies what kind of tag (Byte or Identity) we are using, its value, and the source file for TagVisualization. Finally we have a TextBlock to display the values.&lt;br /&gt;
&lt;br /&gt;
Also note that we have defined VisualizationAdded event on the TagVisualizer. This gets fired whenever a tag is placed. Add the following code to handle this event.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: #f4f4f4; border: 1px solid gray; cursor: text; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 8pt; line-height: 12pt; margin: 20px 0px 10px; max-height: 200px; overflow: auto; padding: 4px; width: 97.5%;&quot;&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-style: none; color: black; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 100%;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; OnVisualizationAdded(&lt;span style=&quot;color: blue;&quot;&gt;object&lt;/span&gt; sender, TagVisualizerEventArgs e)
{
    String type = &lt;span style=&quot;color: #006080;&quot;&gt;&quot;&quot;&lt;/span&gt;;
    String &lt;span style=&quot;color: blue;&quot;&gt;value&lt;/span&gt; = &lt;span style=&quot;color: #006080;&quot;&gt;&quot;&quot;&lt;/span&gt;;

    &lt;span style=&quot;color: blue;&quot;&gt;if&lt;/span&gt; (e.TagVisualization.VisualizedTag.Type == TagType.Byte)
    {
        type = &lt;span style=&quot;color: #006080;&quot;&gt;&quot;Byte Tag&quot;&lt;/span&gt;;
        &lt;span style=&quot;color: blue;&quot;&gt;value&lt;/span&gt; = e.TagVisualization.VisualizedTag.Byte.Value.ToString();
    }
    &lt;span style=&quot;color: blue;&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;if&lt;/span&gt; (e.TagVisualization.VisualizedTag.Type == TagType.Identity)
    {
        type = &lt;span style=&quot;color: #006080;&quot;&gt;&quot;Identity Tag&quot;&lt;/span&gt;;
        &lt;span style=&quot;color: blue;&quot;&gt;value&lt;/span&gt; = e.TagVisualization.VisualizedTag.Identity.Series.ToString() + &lt;span style=&quot;color: #006080;&quot;&gt;&quot; - &quot;&lt;/span&gt; + e.TagVisualization.VisualizedTag.Identity.Value.ToString();
    }

    uxDisplay.Text = type + &lt;span style=&quot;color: #006080;&quot;&gt;&quot;:&quot;&lt;/span&gt; + &lt;span style=&quot;color: blue;&quot;&gt;value&lt;/span&gt;;
}&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
In this code, we are retrieving the tag information from the event arguments and then display it in a text box. &lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://lh3.ggpht.com/_R783RuSyUoM/SggzlFKmvvI/AAAAAAAABS4/tRqo-xwU2ZE/s1600-h/surfacetagsample%5B3%5D.jpg&quot;&gt;&lt;img alt=&quot;surfacetagsample&quot; border=&quot;0&quot; height=&quot;258&quot; src=&quot;http://lh4.ggpht.com/_R783RuSyUoM/SggzlzAwd9I/AAAAAAAABS8/fe_5o_PyzAo/surfacetagsample_thumb%5B1%5D.jpg?imgmax=800&quot; style=&quot;border: 0px none; display: block; float: none; margin-left: auto; margin-right: auto;&quot; title=&quot;surfacetagsample&quot; width=&quot;377&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
&lt;br /&gt;
Run the application and try placing different tags. Note that the integer values need to be converted to Hexadecimal format while using in the simulator (I use Windows Calculator, change its View to Scientific, use ‘Dec’ option for decimal, type in a number and then choose ‘Hex’ option to convert it to Hexadecimal value) (E.g.: Value 10 in Hex = A).&lt;br /&gt;
&lt;br /&gt;
Continued to: &lt;a href=&quot;http://ctlabs.blogspot.com/2009/05/microsoft-surface-applications.html&quot;&gt;Microsoft Surface Applications - Deployment and Object Routing&lt;/a&gt; &lt;br /&gt;</description><link>http://ctlabs.blogspot.com/2009/05/microsoft-surface-tagged-objects-and.html</link><author>noreply@blogger.com (Sameer C. Thiruthikad)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh6.ggpht.com/_R783RuSyUoM/Sggzku6ThLI/AAAAAAAABS0/nfYgzZ2KYfU/s72-c/surfacetags_thumb%5B1%5D.jpg?imgmax=800" height="72" width="72"/><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-17497884.post-5823238655628829624</guid><pubDate>Wed, 06 May 2009 10:24:00 +0000</pubDate><atom:updated>2009-05-11T20:08:08.789+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Surface</category><title>Developing Microsoft Surface Applications</title><description>Continued from: &lt;a href=&quot;http://ctlabs.blogspot.com/2009/04/microsoft-surface-development.html&quot;&gt;Microsoft Surface Development Environment&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Let us create a simple Surface Application to learn the development process.&lt;br /&gt;
&lt;br /&gt;
Launch Visual Studio 2008 and create a new Surface project (File &amp;gt; New &amp;gt; Project &amp;gt; Visual C# &amp;gt; Surface &amp;gt; v1.0 &amp;gt; Surface Application (WPF))&lt;br /&gt;
The template will create all required files. Open the SurfaceWindow1.xaml file and following controls to it:&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-style: none; color: black; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 100%;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;DockPanel&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;s:SurfaceButton&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;DockPanel&lt;/span&gt;.&lt;span style=&quot;color: red;&quot;&gt;Dock&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;Bottom&quot;&lt;/span&gt;
&lt;span style=&quot;color: red;&quot;&gt;x:Name&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;uxButton&quot;&lt;/span&gt;
&lt;span style=&quot;color: red;&quot;&gt;Content&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;Click Me&quot;&lt;/span&gt;
&lt;span style=&quot;color: red;&quot;&gt;Height&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;50&quot;&lt;/span&gt;
&lt;span style=&quot;color: red;&quot;&gt;Width&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;100&quot;&lt;/span&gt;
&lt;span style=&quot;color: red;&quot;&gt;Click&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;uxButton_Click&quot;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;s:ScatterView&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;x:Name&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;uxScatterView&quot;&lt;/span&gt;
&lt;span style=&quot;color: red;&quot;&gt;Background&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;LemonChiffon&quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;s:ScatterView&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;DockPanel&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
We have just added Surface version of the button and a new Surface specific control called ScatterView. The ScatterView control is the control that you should use when you have one or more UI elements that you want users to be able to move, rotate, or resize freely within a fixed area. It supports all these features without writing any extra code.&lt;br /&gt;
&lt;br /&gt;
Now let us add the code to create ellipses and add them as ScatterView items in the button’s click handler:&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-style: none; color: black; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 100%;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; uxButton_Click(&lt;span style=&quot;color: blue;&quot;&gt;object&lt;/span&gt; sender, RoutedEventArgs e)
{
Ellipse ell = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; Ellipse();
ell.Height = 50;
ell.Width = 50;
ell.Fill = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; SolidColorBrush(Colors.Red);

ScatterViewItem item = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; ScatterViewItem();
item.Content = ell;
uxScatterView.Items.Add(item);
}&lt;/pre&gt;
Now launch the Surface Simulator and run this application. The application will appear within the simulator. Keep clicking on the buttons to add items to the scatter view.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://lh3.ggpht.com/_R783RuSyUoM/SgFlQ0hOixI/AAAAAAAABSo/Oqmzq1gvYMg/s1600-h/surfacesample%5B3%5D.jpg&quot;&gt;&lt;img alt=&quot;surfacesample&quot; border=&quot;0&quot; height=&quot;390&quot; src=&quot;http://lh6.ggpht.com/_R783RuSyUoM/SgFlRt2agkI/AAAAAAAABSs/6qbFtUtS1NM/surfacesample_thumb%5B1%5D.jpg?imgmax=800&quot; style=&quot;border-width: 0px; display: block; float: none; margin-left: auto; margin-right: auto;&quot; title=&quot;surfacesample&quot; width=&quot;461&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
Note that the items get added to random positions. You can move and rotate the items with one finger. You can hold one finger to the edge of an item and use another finger to drag and then resize the item. Notice that the active item has a shadow effect and the shadow changes smoothly according to the items position. You can push the item to an edge with some speed and it will bounce back with smooth physics behavior.&lt;br /&gt;
&lt;br /&gt;
All the Surface controls have contact events and this can be used to find the location of contact. Here is an example:&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-style: none; color: black; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 100%;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; uxButton_ContactDown(&lt;span style=&quot;color: blue;&quot;&gt;object&lt;/span&gt; sender, ContactEventArgs e)
{
Point contactPosition = e.Contact.GetPosition(&lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;);
}&lt;/pre&gt;
&lt;br /&gt;
For non-Surface controls, the contacts events can be attached like this:&lt;br /&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-style: none; color: black; font-family: consolas,&#39;Courier New&#39;,courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; width: 100%;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;Canvas&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;s:Contacts&lt;/span&gt;.&lt;span style=&quot;color: red;&quot;&gt;ContactDown&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;Canvas_ContactDown&quot;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
Using the combination of standard WPF controls and Surface special controls, it is possible to create multi-touch applications for Surface very easily.&lt;br /&gt;
&lt;br /&gt;
Here are the list of Surface version of the standard controls:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;SurfaceWindow &lt;/li&gt;
&lt;li&gt;SurfaceButton &lt;/li&gt;
&lt;li&gt;SurfaceInkCanvas &lt;/li&gt;
&lt;li&gt;SurfaceSlider &lt;/li&gt;
&lt;li&gt;SurfaceScrollViewer &lt;/li&gt;
&lt;li&gt;SurfaceListBox &lt;/li&gt;
&lt;li&gt;SurfaceTextBox &lt;/li&gt;
&lt;li&gt;SurfacePasswordBox &lt;/li&gt;
&lt;li&gt;SurfaceMenu &lt;/li&gt;
&lt;li&gt;SurfaceContextMenu &lt;/li&gt;
&lt;li&gt;SurfaceCheckBox &lt;/li&gt;
&lt;li&gt;SurfaceRadioButton &lt;/li&gt;
&lt;/ul&gt;
And here is the list of Special Surface controls:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;ScatterView &lt;/li&gt;
&lt;li&gt;ScatterViewItem &lt;/li&gt;
&lt;li&gt;TagVisualizer &lt;/li&gt;
&lt;li&gt;TagVisualization &lt;/li&gt;
&lt;/ul&gt;
TagVisualizer helps in the use of tagged objects and can be used to show a visual when a tag is placed on the Surface unit.&lt;br /&gt;
&lt;br /&gt;
Continued to &lt;a href=&quot;http://ctlabs.blogspot.com/2009/05/microsoft-surface-tagged-objects-and.html&quot;&gt;Microsoft Surface Tagged Objects and Tag Visualizations&lt;/a&gt;</description><link>http://ctlabs.blogspot.com/2009/05/developing-microsoft-surface.html</link><author>noreply@blogger.com (Sameer C. Thiruthikad)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh6.ggpht.com/_R783RuSyUoM/SgFlRt2agkI/AAAAAAAABSs/6qbFtUtS1NM/s72-c/surfacesample_thumb%5B1%5D.jpg?imgmax=800" height="72" width="72"/><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-17497884.post-5095771309287021501</guid><pubDate>Thu, 30 Apr 2009 12:15:00 +0000</pubDate><atom:updated>2009-05-11T10:14:45.274+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Surface</category><title>Microsoft Surface Development Environment</title><description>Continued from my previous post: &lt;a href=&quot;http://ctlabs.blogspot.com/2009/04/introduction-to-microsoft-surface.html&quot;&gt;Introduction to Microsoft Surface&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Surface Application Development Kit&lt;/b&gt;&lt;br /&gt;
Microsoft Surface applications are developed using &lt;a href=&quot;http://ctlabs.blogspot.com/2008/01/windows-presentation-foundation-wpf.html&quot;&gt;WPF&lt;/a&gt;. You need Surface SDK Version 1.0 which is available only to some conference attendees and Microsoft partners. If you don’t have an actual Surface device, the SDK can be installed on a Windows computer; and the Surface Simulator from the SDK can be used to test the applications.&lt;br /&gt;
&lt;br /&gt;
Here are the prerequisites for Surface SDK 1.0&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Windows Vista SP1 32 bit (Business/Enterprise/Ultimate)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://go.microsoft.com/fwlink/?LinkID=119652&quot;&gt;.NET Framework version 3.5&lt;/a&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://go.microsoft.com/fwlink/?LinkID=117810&quot;&gt;Microsoft XNA Framework Redistributable 2.0&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://go.microsoft.com/fwlink/?LinkId=119656&quot;&gt;Microsoft DirectX End-User Runtime Web Installer&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://go.microsoft.com/fwlink/?LinkId=119657&quot;&gt;Microsoft Visual Studio 2008&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
The SDK will install all required Surface libraries, Surface Simulator, Sample Applications, Documentation and Visual Studio project templates for Surface.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Surface User Experience&lt;/b&gt;&lt;br /&gt;
Before we get into the actual application development, let us see how Surface UX is different from conventional windows based applications. Even though the Surface application is running on top of Windows, the end user will not see any signs of it. Instead, the Surface device will be showing an &lt;i&gt;&lt;b&gt;attract application&lt;/b&gt;&lt;/i&gt; (similar to screensaver) which fills the complete display area. There will be four &lt;b&gt;&lt;i&gt;access points&lt;/i&gt;&lt;/b&gt; in the corners to open &lt;b&gt;&lt;i&gt;Launcher&lt;/i&gt;&lt;/b&gt; and explore available Surface applications. Note that only one application will be visible at a time. There is also an &lt;b&gt;&lt;i&gt;I’m done&lt;/i&gt;&lt;/b&gt; button to close all the applications and to return to the attract mode.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://lh5.ggpht.com/_R783RuSyUoM/SfmWWyzcoRI/AAAAAAAABSY/O-wihEruH08/s1600-h/surfacelauncher%5B4%5D.jpg&quot;&gt;&lt;img alt=&quot;surfacelauncher&quot; border=&quot;0&quot; height=&quot;347&quot; src=&quot;http://lh5.ggpht.com/_R783RuSyUoM/SfmWYK4zXzI/AAAAAAAABSc/5ttEEeC1qTA/surfacelauncher_thumb%5B2%5D.jpg?imgmax=800&quot; style=&quot;border: 0px none; display: block; float: none; margin-left: auto; margin-right: auto;&quot; title=&quot;surfacelauncher&quot; width=&quot;417&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
The above screenshot from the SDK documentation shows various parts of the Launcher (1. Application title | 2. Application description | 3. Application preview image | 4. Application icon image | 5. Access points | 6. I&#39;m done button)&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Surface Simulator&lt;/b&gt;&lt;br /&gt;
Surface Simulator is a Windows application with a fixed size (1224 × 868) used to simulate the actual Surface unit experience. It can be launched from ‘Start Menu &amp;gt; All Programs &amp;gt; Microsoft Surface SDK 1.0 &amp;gt; Tools &amp;gt; Surface Simulator’. Once the Surface Simulator is launched, any Surface applications launched there after will get displayed within the Simulator window.&lt;br /&gt;
&lt;br /&gt;
Surface recognizes three types of contacts viz. &lt;b&gt;&lt;i&gt;Finger&lt;/i&gt;&lt;/b&gt;, &lt;b&gt;&lt;i&gt;Blob&lt;/i&gt;&lt;/b&gt; (any objects), and &lt;b&gt;&lt;i&gt;Tagged object&lt;/i&gt;&lt;/b&gt; (objects with a tag mark similar to barcode). There are two types of tags namely &lt;b&gt;&lt;i&gt;byte tags&lt;/i&gt;&lt;/b&gt; (up to 256 unique values) and &lt;b&gt;&lt;i&gt;identity tags&lt;/i&gt;&lt;/b&gt; (still in beta but supports more values).&lt;br /&gt;
&lt;br /&gt;
All these contacts can be placed on the Simulator using the equivalent buttons as shown in the image below.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://lh4.ggpht.com/_R783RuSyUoM/SfmWYulIEAI/AAAAAAAABSg/pmmcI2K2vhM/s1600-h/surfacesimulator%5B3%5D.jpg&quot;&gt;&lt;img alt=&quot;surfacesimulator&quot; border=&quot;0&quot; height=&quot;362&quot; src=&quot;http://lh6.ggpht.com/_R783RuSyUoM/SfmWZqO-17I/AAAAAAAABSk/4lgqrrndE38/surfacesimulator_thumb%5B1%5D.jpg?imgmax=800&quot; style=&quot;border: 0px none; display: block; float: none; margin-left: auto; margin-right: auto;&quot; title=&quot;surfacesimulator&quot; width=&quot;430&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
This screenshot shows the Data Visualizer sample application from SDK which is displaying the contact information.&lt;br /&gt;
&lt;br /&gt;
To choose a contact on the application, the equivalent button is selected from the tool bar using mouse or its short key is pressed. The mouse pointer is then changed to the selected contact icon. For Tagged objects, the tag value can be specified in the adjacent text box.&lt;br /&gt;
&lt;br /&gt;
To place a contact click and hold using the left mouse button, and to leave the contact there, click on the right moue button after that.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
To remove a contact, choose the same contact selector, hover it on the placed contact, click left button and hold and then click right button of the mouse.&lt;br /&gt;
&lt;br /&gt;
To rotate contact, use the mouse scroll wheel.&lt;br /&gt;
&lt;br /&gt;
To select placed contacts, use the Contact Selector button. Drag a box around required contacts to select more than one. After selection, the contact can be moved around, rotated, and resized. To remove the selection click anywhere outside the contacts.&lt;br /&gt;
&lt;br /&gt;
Below are the short cut keys available in Surface Simulator:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Ctrl+F: Finger contact&lt;/li&gt;
&lt;li&gt;Ctrl+B: Blob contact&lt;/li&gt;
&lt;li&gt;Ctrl+T: Byte tag contact&lt;/li&gt;
&lt;li&gt;Ctrl+I: Identity tag contact&lt;/li&gt;
&lt;li&gt;Ctrl+S: Contact selector&lt;/li&gt;
&lt;li&gt;Ctrl+H: Hides all contacts&lt;/li&gt;
&lt;li&gt;Ctrl+S: Removes all contacts&lt;/li&gt;
&lt;/ul&gt;
The Surface Simulator also has a recording tab which can be used to record a set of actions (placing and movements of contacts) on the application. The recording is saved as a script file (*.scs) which is nothing but an xml file with key frames of contacts against time.&amp;nbsp; It is very useful to reproduce scenarios during testing of an application.&lt;br /&gt;
&lt;br /&gt;
Continued to &lt;a href=&quot;http://ctlabs.blogspot.com/2009/05/developing-microsoft-surface.html&quot;&gt;Developing Microsoft Surface Applications&lt;/a&gt;&lt;br /&gt;</description><link>http://ctlabs.blogspot.com/2009/04/microsoft-surface-development.html</link><author>noreply@blogger.com (Sameer C. Thiruthikad)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh5.ggpht.com/_R783RuSyUoM/SfmWYK4zXzI/AAAAAAAABSc/5ttEEeC1qTA/s72-c/surfacelauncher_thumb%5B2%5D.jpg?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-17497884.post-6385413237297146061</guid><pubDate>Thu, 30 Apr 2009 07:50:00 +0000</pubDate><atom:updated>2009-04-30T17:54:08.744+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Surface</category><title>Introduction to Microsoft Surface</title><description>&lt;a href=&quot;http://www.microsoft.com/surface/&quot;&gt;Microsoft Surface&lt;/a&gt; is a multi-touch product from Microsoft which is developed as a software and hardware combination technology that allows user interaction with natural gestures and physical objects.&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;a href=&quot;http://lh4.ggpht.com/_R783RuSyUoM/SflYUl9EPjI/AAAAAAAABSQ/XhnhlRehmbg/s1600-h/surfacelogo%5B2%5D.png&quot;&gt;&lt;img alt=&quot;surfacelogo&quot; border=&quot;0&quot; height=&quot;115&quot; src=&quot;http://lh6.ggpht.com/_R783RuSyUoM/SflYVQ2vkXI/AAAAAAAABSU/RL-JUwBdNGA/surfacelogo_thumb.png?imgmax=800&quot; style=&quot;border-width: 0px; display: block; float: none; margin-left: auto; margin-right: auto;&quot; title=&quot;surfacelogo&quot; width=&quot;220&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
&amp;nbsp;It was announced on May 29, 2007 in US, and even now its availability is limited to companies in few countries like USA, UK, UAE, etc. Microsoft doesn’t say anything in their &lt;a href=&quot;http://www.microsoft.com/surface/How-to-Buy.aspx&quot;&gt;how to buy&lt;/a&gt; section about when they will release it to end users and to other countries like India.&lt;br /&gt;
&lt;br /&gt;
This new surface computing platform opens up a a variety of possibilities for applications with Natural User Interfaces (NUI) as is evident from the following marketing video from Microsoft.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;object height=&quot;364&quot; width=&quot;445&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/rP5y7yp06n0&amp;amp;hl=en&amp;amp;fs=1&amp;amp;rel=0&amp;amp;color1=0x006699&amp;amp;color2=0x54abd6&amp;amp;border=1&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://www.youtube.com/v/rP5y7yp06n0&amp;amp;hl=en&amp;amp;fs=1&amp;amp;rel=0&amp;amp;color1=0x006699&amp;amp;color2=0x54abd6&amp;amp;border=1&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;445&quot; height=&quot;364&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;
&lt;br /&gt;
But its huge size and high price prevents many from appreciating this next generation device for digital interaction. See the following parody video which raises this exact point.&lt;br /&gt;
&lt;br /&gt;
&lt;object height=&quot;364&quot; width=&quot;445&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/CZrr7AZ9nCY&amp;amp;hl=en&amp;amp;fs=1&amp;amp;rel=0&amp;amp;color1=0x006699&amp;amp;color2=0x54abd6&amp;amp;border=1&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://www.youtube.com/v/CZrr7AZ9nCY&amp;amp;hl=en&amp;amp;fs=1&amp;amp;rel=0&amp;amp;color1=0x006699&amp;amp;color2=0x54abd6&amp;amp;border=1&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;445&quot; height=&quot;364&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.identitymine.com/&quot;&gt;IdentityMine&lt;/a&gt; had ventured into the field of Surface application development from its earlier days itself and still continues to deliver products with remarkable user experiences.&lt;br /&gt;
&lt;br /&gt;
&lt;object height=&quot;364&quot; width=&quot;445&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/N2iT-0z8Xxs&amp;amp;hl=en&amp;amp;fs=1&amp;amp;rel=0&amp;amp;color1=0x006699&amp;amp;color2=0x54abd6&amp;amp;border=1&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://www.youtube.com/v/N2iT-0z8Xxs&amp;amp;hl=en&amp;amp;fs=1&amp;amp;rel=0&amp;amp;color1=0x006699&amp;amp;color2=0x54abd6&amp;amp;border=1&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;445&quot; height=&quot;364&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;
&lt;br /&gt;
Continued to &lt;a href=&quot;http://ctlabs.blogspot.com/2009/04/microsoft-surface-development.html&quot;&gt;Microsoft Surface Application Development Environment&lt;/a&gt;.</description><link>http://ctlabs.blogspot.com/2009/04/introduction-to-microsoft-surface.html</link><author>noreply@blogger.com (Sameer C. Thiruthikad)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh6.ggpht.com/_R783RuSyUoM/SflYVQ2vkXI/AAAAAAAABSU/RL-JUwBdNGA/s72-c/surfacelogo_thumb.png?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-17497884.post-7034995358416887898</guid><pubDate>Thu, 05 Mar 2009 12:56:00 +0000</pubDate><atom:updated>2009-03-05T18:41:30.560+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Misc Products</category><title>Upload Photos using Flickr API in .NET</title><description>&lt;p&gt;You know there is &lt;a href=&quot;http://www.flickr.com/&quot;&gt;Flickr&lt;/a&gt;, and you know they provide free &lt;a href=&quot;http://www.flickr.com/services/api/&quot;&gt;API Service&lt;/a&gt; for accessing the online photos repository programmatically. Now let us see how easy it is to use those APIs in .NET. &lt;/p&gt;  &lt;p&gt;In this example I am creating a .NET 2.0 Windows Forms Application (I used Visual Studio 2008) in C# to upload a photo to your Flickr account and then create a new set (album) and assign that photo to this set.&lt;/p&gt;  &lt;p&gt;Here are the steps to do this:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;strong&gt;Get the API Key from Flickr&lt;/strong&gt; (This key and its secret code are required to access the service)&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;Go to &lt;a title=&quot;Your API Keys&quot; href=&quot;http://www.flickr.com/services/api/keys/&quot;&gt;Your API Keys&lt;/a&gt; section on Flickr.&lt;/li&gt;      &lt;li&gt;Click on ‘Apply for a new key online’ link.&lt;/li&gt;      &lt;li&gt;Complete the process. I used the Non-Commercial option to get the key immediately. You will have to provide the details of your application. Once this is done, click on Edit key details and update all the information.&lt;/li&gt;      &lt;li&gt;Note down the Key (it will look like 3e1f3c83c5e92ead353be33162fr4883) and Shared Secret (it will look like 700f4d5220833d34)&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;&lt;strong&gt;Get the FlickrNet API Library &lt;/strong&gt;(This is a .NET wrapper class library around Flickr API and makes it very easy to call the services)&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;Go to &lt;a title=&quot;http://flickrnet.codeplex.com/&quot; href=&quot;http://flickrnet.codeplex.com/&quot;&gt;http://flickrnet.codeplex.com/&lt;/a&gt;&lt;/li&gt;      &lt;li&gt;Download either just the binaries or the source code if you would like to debug into the library.&lt;/li&gt;      &lt;li&gt;FlickrNet.dll is the only one file you will require.&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;&lt;strong&gt;Design the application interface&lt;/strong&gt;&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;I created a WinForm application as shown below with options to authenticate the user and to choose a picture file for uploading.&lt;/li&gt;   &lt;/ul&gt; &lt;/ul&gt;  &lt;p&gt;&lt;a href=&quot;http://lh6.ggpht.com/_R783RuSyUoM/Sa_MPzyrdPI/AAAAAAAABPo/oNioz0YuF5Q/s1600-h/FlickrTest%5B7%5D.jpg&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px&quot; title=&quot;FlickrTest&quot; border=&quot;0&quot; alt=&quot;FlickrTest&quot; src=&quot;http://lh6.ggpht.com/_R783RuSyUoM/Sa_MRTN5UTI/AAAAAAAABPs/RgH9Xe9bdjw/FlickrTest_thumb%5B5%5D.jpg?imgmax=800&quot; width=&quot;447&quot; height=&quot;410&quot; /&gt;&lt;/a&gt; Now let us understand some theories behind Flickr API before we get into coding. Skip this if all you bother is to get your code working. :)&lt;/p&gt;  &lt;p&gt;You need to do an authentication to the flickr account you are trying to access. This is a one time process and is done by directing the user to a URL (generated using the service) which will then open up in a browser. This process is initiated using ‘Start Auth’ button. Once the user logs into the flickr account and approve the access request from this application, he or she will have to come back to this application and click on ‘Complete Auth’. In this method, we get a ‘Token’ which uniquely identifies the user. This token can be saved and used again to access this user’s account without requiring further authentication process.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;strong&gt;Add code to call Flickr API methods&lt;/strong&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;First thing is to add a reference to the FlickrNet (either direct dll or the project reference if you use source code) in your project. Next declare the required variables.&lt;/p&gt;  &lt;div style=&quot;border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px&quot;&gt;   &lt;pre style=&quot;border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt; flickrFrob = &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;long&lt;/span&gt; fileSize = 1;&lt;br /&gt;FlickrNet.Flickr myFlickr;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;Then in the Form’s load event, provide your API Key and Share Secret codes and create the Flickr object. Event handlers are also added here.&lt;/p&gt;&lt;div style=&quot;border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px&quot;&gt;&lt;br /&gt;  &lt;pre style=&quot;border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; MainForm_Load(&lt;span style=&quot;color: #0000ff&quot;&gt;object&lt;/span&gt; sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;    uxKey.Text = &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;3e1f3c83c5e92ead353be33162fr4883&amp;quot;&lt;/span&gt;;&lt;br /&gt;    uxSecret.Text = &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;700f4d5220833d34&amp;quot;&lt;/span&gt;;&lt;br /&gt;    myFlickr = &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; FlickrNet.Flickr(uxKey.Text, uxSecret.Text);&lt;br /&gt;    uxOpen.Click += &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; EventHandler(uxOpen_Click);&lt;br /&gt;    uxAuthStart.Click += &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; EventHandler(uxAuthStart_Click);&lt;br /&gt;    uxAuthComplete.Click += &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; EventHandler(uxAuthComplete_Click);&lt;br /&gt;    uxUpload.Click+=&lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; EventHandler(uxUpload_Click);&lt;br /&gt;    myFlickr.OnUploadProgress += &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; FlickrNet.Flickr.UploadProgressHandler(myFlickr_OnUploadProgress);&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;Now let us open an image for uploading…&lt;/p&gt;&lt;div style=&quot;border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px&quot;&gt;&lt;br /&gt;  &lt;pre style=&quot;border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; uxOpen_Click(&lt;span style=&quot;color: #0000ff&quot;&gt;object&lt;/span&gt; sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;    OpenFileDialog ofd = &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; OpenFileDialog();&lt;br /&gt;    ofd.Filter = &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;Pictures|*.jpg&amp;quot;&lt;/span&gt;;&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (ofd.ShowDialog() == DialogResult.OK)&lt;br /&gt;    {&lt;br /&gt;        uxFile.Text = ofd.FileName;&lt;br /&gt;        fileSize = ofd.OpenFile().Length;&lt;br /&gt;        Image img = Image.FromFile(ofd.FileName);&lt;br /&gt;        uxPicture.Image = img;&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;and then start authentication. &lt;/p&gt;&lt;div style=&quot;border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px&quot;&gt;&lt;br /&gt;  &lt;pre style=&quot;border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; uxAuthStart_Click(&lt;span style=&quot;color: #0000ff&quot;&gt;object&lt;/span&gt; sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;    flickrFrob = myFlickr.AuthGetFrob();&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt; url = myFlickr.AuthCalcUrl(flickrFrob, FlickrNet.AuthLevel.Write);&lt;br /&gt;    System.Diagnostics.Process.Start(url);&lt;br /&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This uses something called Frob (cookie kinda stuff) and generates a URL which is then opened up in the user’s default browser. Remember, at this point, user will have to sign in and authenticate the access request from this application.&lt;/p&gt;&lt;p&gt;Once the user completes the authentication and comes back to the application, we gets the token for that user.&lt;/p&gt;&lt;div style=&quot;border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px&quot;&gt;&lt;br /&gt;  &lt;pre style=&quot;border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; uxAuthComplete_Click(&lt;span style=&quot;color: #0000ff&quot;&gt;object&lt;/span&gt; sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;try&lt;/span&gt;&lt;br /&gt;    {&lt;br /&gt;        FlickrNet.Auth auth = myFlickr.AuthGetToken(flickrFrob);&lt;br /&gt;        myFlickr.AuthToken = auth.Token;&lt;br /&gt;        uxToken.Text = auth.Token;&lt;br /&gt;        uxUser.Text = auth.User.UserId;&lt;br /&gt;    }&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;catch&lt;/span&gt; (FlickrNet.FlickrException ex)&lt;br /&gt;    {&lt;br /&gt;        MessageBox.Show(&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;User didn&#39;t approve!\n\n&amp;quot;&lt;/span&gt; + ex.Message);&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;The token is assigned to the Flickr object to enable access to that user’s account. It can be saved for later use without doing this authentication process again.&lt;/p&gt;&lt;p&gt;Now we are all set to upload the picture to flickr.&lt;/p&gt;&lt;div style=&quot;border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px&quot;&gt;&lt;br /&gt;  &lt;pre style=&quot;border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; uxUpload_Click(&lt;span style=&quot;color: #0000ff&quot;&gt;object&lt;/span&gt; sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;    uxProgress.Maximum = Convert.ToInt32(fileSize / 1000);&lt;br /&gt;    uxProgress.Value = 0;    &lt;span style=&quot;color: #0000ff&quot;&gt;try&lt;/span&gt;&lt;br /&gt;    {&lt;br /&gt;        FlickrNet.Photo p = &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; FlickrNet.Photo();&lt;br /&gt;        System.Threading.Thread threadUpload = &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; System.Threading.Thread(&lt;span style=&quot;color: #0000ff&quot;&gt;delegate&lt;/span&gt;()&lt;br /&gt;        {&lt;br /&gt;            p.PhotoId = myFlickr.UploadPicture(uxFile.Text, &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;Sample Title&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;Sample Description&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;Sample Tag&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #0000ff&quot;&gt;false&lt;/span&gt;, &lt;span style=&quot;color: #0000ff&quot;&gt;false&lt;/span&gt;, &lt;span style=&quot;color: #0000ff&quot;&gt;true&lt;/span&gt;);&lt;br /&gt;            p.UserId = uxUser.Text;&lt;br /&gt;            FlickrNet.Photoset mySet = myFlickr.PhotosetsCreate(&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;New Photoset&amp;quot;&lt;/span&gt;, p.PhotoId);&lt;br /&gt;            System.Diagnostics.Process.Start(p.WebUrl);&lt;br /&gt;        });        threadUpload.Start();&lt;br /&gt;    }&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;catch&lt;/span&gt; (Exception ex)&lt;br /&gt;    {&lt;br /&gt;        MessageBox.Show(&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;Upload failed!\n\n&amp;quot;&lt;/span&gt; + ex.Message);&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;Here we set the progress bar values and then use a new thread different from UI thread to call the Upload method. We also create a new photo set and add this photo to it.&lt;/p&gt;&lt;p&gt;The last thing is to make sure that the progress bar is updated properly.&lt;/p&gt;&lt;div style=&quot;border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px&quot;&gt;&lt;br /&gt;  &lt;pre style=&quot;border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; myFlickr_OnUploadProgress(&lt;span style=&quot;color: #0000ff&quot;&gt;object&lt;/span&gt; sender, FlickrNet.UploadProgressEventArgs e)&lt;br /&gt;{&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (e.UploadComplete)&lt;br /&gt;    {&lt;br /&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;this&lt;/span&gt;.Invoke((MethodInvoker)&lt;span style=&quot;color: #0000ff&quot;&gt;delegate&lt;/span&gt;()&lt;br /&gt;        {&lt;br /&gt;            uxProgress.Value = 0;&lt;br /&gt;        });&lt;br /&gt;    }&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;else&lt;/span&gt;&lt;br /&gt;    {&lt;br /&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;this&lt;/span&gt;.Invoke((MethodInvoker)&lt;span style=&quot;color: #0000ff&quot;&gt;delegate&lt;/span&gt;()&lt;br /&gt;        {&lt;br /&gt;            uxProgress.Value = e.Bytes / 1000;&lt;br /&gt;        });&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;That’s it… Hope this was useful to you and as always, feel free to ask any questions you may have on this…&lt;/p&gt;</description><link>http://ctlabs.blogspot.com/2009/03/upload-photos-using-flickr-api-in-net.html</link><author>noreply@blogger.com (Sameer C. Thiruthikad)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh6.ggpht.com/_R783RuSyUoM/Sa_MRTN5UTI/AAAAAAAABPs/RgH9Xe9bdjw/s72-c/FlickrTest_thumb%5B5%5D.jpg?imgmax=800" height="72" width="72"/><thr:total>12</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-17497884.post-1243231195173084503</guid><pubDate>Tue, 24 Feb 2009 10:01:00 +0000</pubDate><atom:updated>2009-02-24T15:47:05.188+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Misc Products</category><title>Nullsoft Scriptable Install System (NSIS)</title><description>&lt;p&gt;
I have been using Visual Studio’s ‘Setup Project’ template for creating Windows installers to install my applications on a Windows computer. It’s pretty straight forward and easy, but gets a bit complicated when we need to do something more advanced. I knew there were things like InstallShield but they cost money.&lt;/p&gt;
&lt;p&gt;
Recently I was introduced to a new tool named as Nullsoft Scriptable Install System (NSIS). It’s completely free, and is a professional open source system to create Windows installers. It is driven by scripts (using a custom language) and offers a myriad of built-in features and functions covering all the basic installer necessities, from layout of install wizard dialogs, to manipulating files and registry keys.&lt;/p&gt;
&lt;p&gt;
Installing NSIS is very easy. Go to its home page at &lt;a href=&quot;http://nsis.sourceforge.net&quot;&gt;http://nsis.sourceforge.net&lt;/a&gt; and download the latest version. I used 2.43.&lt;/p&gt;
&lt;p&gt;
There are two types of installers that can be created using NSIS. The simple one is based on zip file. You package all your files into a single zip file and then feed it to the NSIS (Main Menu &amp;gt; Compiler &amp;gt; Installer based on ZIP file). &lt;/p&gt;
&lt;p&gt;
&lt;a href=&quot;http://lh3.ggpht.com/_R783RuSyUoM/SaPFLviR7gI/AAAAAAAABOY/KJzAJ6BYnBs/s1600-h/Zip2Exe%5B10%5D.jpg&quot;&gt;&lt;img title=&quot;Zip2Exe&quot; style=&quot;border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px&quot; height=&quot;225&quot; alt=&quot;Zip2Exe&quot; src=&quot;http://lh6.ggpht.com/_R783RuSyUoM/SaPFMklApDI/AAAAAAAABOc/wpsBCOHVaf4/Zip2Exe_thumb%5B8%5D.jpg?imgmax=800&quot; width=&quot;260&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; It will generate a setup exe which the end user can execute to copy your files into a specified directory.&lt;/p&gt;
&lt;p&gt;
&lt;a href=&quot;http://lh6.ggpht.com/_R783RuSyUoM/SaPFNwX3daI/AAAAAAAABOg/hyU74OJvOJI/s1600-h/Zip2ExeSetup%5B2%5D.jpg&quot;&gt;&lt;img title=&quot;Zip2ExeSetup&quot; style=&quot;border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px&quot; height=&quot;206&quot; alt=&quot;Zip2ExeSetup&quot; src=&quot;http://lh3.ggpht.com/_R783RuSyUoM/SaPFPNJLMoI/AAAAAAAABOk/BQ59D8jhzF8/Zip2ExeSetup_thumb.jpg?imgmax=800&quot; width=&quot;260&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;
The next option is the more powerful and flexible one. You create a NSIS script file (which is just a text file with extension as .nsi) with all the details of the installer like how many navigation pages it should have, what files need to be copied, and what values to be added to registry, etc. All these are specified through NSIS&#39;s own script language which is fairly easy to learn. &lt;/p&gt;
&lt;p&gt;
Once the script is ready and all the required files mentioned in the script are placed at the proper folders, you can right click on the script file and choose &#39;Compile NSIS Script&#39; option. NSIS will then compile this script and will create a single setup exe file.&lt;/p&gt;
&lt;p&gt;
Now let us see the internals of such a script file. In this example, I am creating a Windows installer for my free software tool &lt;a href=&quot;http://www.codeplex.com/sqlanalyzer&quot;&gt;SQL Analyzer&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;
[Remember to get a fine text editing tool such as &lt;a href=&quot;http://notepad-plus.sourceforge.net&quot;&gt;Notepad++&lt;/a&gt; which has line number support and syntax highlighting for NSIS]. &lt;/p&gt;
&lt;p&gt;
Initially I am defining some constants using the &lt;strong&gt;!define&lt;/strong&gt; keyword. These are some string constants that will be used later on.&lt;/p&gt;
&lt;div style=&quot;border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4&quot;&gt;
&lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none&quot;&gt;!define PRODUCT_NAME &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;SQL Analyzer&amp;quot;&lt;/span&gt;
!define PRODUCT_VERSION_MAJOR 7
!define PRODUCT_VERSION_MINOR 0
!define PRODUCT_DISPLAY_VERSION &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;7.0&amp;quot;&lt;/span&gt;
!define PRODUCT_PUBLISHER &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;Coolwayfarer&amp;quot;&lt;/span&gt;
!define PRODUCT_WEB_SITE &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;http://www.codeplex.com/sqlanalyzer&amp;quot;&lt;/span&gt;
!define PRODUCT_UNINST_KEY &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}&amp;quot;&lt;/span&gt; ; 
!define PRODUCT_UNINST_ROOT_KEY &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;HKLM&amp;quot;&lt;/span&gt;
!define PRODUCT_INSTALL_DIR &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;$PROGRAMFILES\SQL Analyzer&amp;quot;&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;
Anything that comes after a $ sign is a predefined constant or variable. For example &lt;strong&gt;$PROGRAMFILES &lt;/strong&gt;will translate into the user’s program files folder (typically C:\Program Files\).&lt;/p&gt;


&lt;p&gt;
Next we need to specify what compression technique we are using and what kind of user interface is required for the installer.&lt;/p&gt;


&lt;div style=&quot;border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4&quot;&gt;

&lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none&quot;&gt;SetCompressor /SOLID lzma
!include &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;MUI2.nsh&amp;quot;&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;
Here I am using the lzma. Don’t worry about that, it gives maximum compression. I also include a header file (you don’t need to get a copy of that file to include it) for the settings for Modern UI 2 (MUI2) which is the latest version of a user interface in a wizard style.&lt;/p&gt;


&lt;p&gt;
Next, the settings for the installer interface are specified.&lt;/p&gt;


&lt;div style=&quot;border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4&quot;&gt;

&lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none&quot;&gt;!define MUI_ABORTWARNING
!define MUI_ICON &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;resources\sqlanalyzer.ico&amp;quot;&lt;/span&gt;
!define MUI_UNICON &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;resources\sqlanalyzer.ico&amp;quot;&lt;/span&gt;
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;resources\sqlanalyzerheader.bmp&amp;quot;&lt;/span&gt;
!define MUI_HEADERIMAGE_RIGHT
!define MUI_HEADER_TRANSPARENT_TEXT
!define MUI_WELCOMEFINISHPAGE_BITMAP &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;resources\sqlanalyzerwelcome.bmp&amp;quot;&lt;/span&gt;
!define MUI_WELCOMEFINISHPAGE_BITMAP_NOSTRETCH&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;
As you can see, things like MUI_ICON are predefined properties/settings. Here I have specified an icon for the installer and two images, one for the header and another one for the welcome page. Note that the files are put in a relative path to the script file.&lt;/p&gt;


&lt;p&gt;
Now the different wizard pages in the installer are specified.&lt;/p&gt;


&lt;div style=&quot;border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4&quot;&gt;

&lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none&quot;&gt;; Welcome page
!insertmacro MUI_PAGE_WELCOME

; License page
!define MUI_LICENSEPAGE_CHECKBOX
!insertmacro MUI_PAGE_LICENSE &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;resources\license.txt&amp;quot;&lt;/span&gt;

; Instfiles page
!insertmacro MUI_PAGE_INSTFILES

; Finish page
!define MUI_FINISHPAGE_SHOWREADME &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;$INSTDIR\README.txt&amp;quot;&lt;/span&gt;
!define MUI_FINISHPAGE_NOREBOOTSUPPORT
!insertmacro MUI_PAGE_FINISH

; Uninstaller pages
!insertmacro MUI_UNPAGE_INSTFILES

; Language files
!insertmacro MUI_LANGUAGE &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;English&amp;quot;&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;
Anything that starts with a semicolon is a comment. So I have pages like Welcome page, license page, etc. defined here. Note that in the finish page, I have an option specified to show readme file and it points to the file README.txt in the installed location ($INSTALLDIR). We will see in a moment that as part of our installation, we are copying this file as well.&lt;/p&gt;


&lt;p&gt;
Now we specify some basic settings for the installer itself.&lt;/p&gt;


&lt;div style=&quot;border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4&quot;&gt;

&lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none&quot;&gt;Name &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;${PRODUCT_NAME}&amp;quot;&lt;/span&gt;
OutFile &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;${PRODUCT_NAME} Setup.exe&amp;quot;&lt;/span&gt;
InstallDir &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;${PRODUCT_INSTALL_DIR}&amp;quot;&lt;/span&gt;
ShowInstDetails show
ShowUnInstDetails show
BrandingText &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;${PRODUCT_PUBLISHER}&amp;quot;&lt;/span&gt;
RequestExecutionLevel admin&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;
We are making use of the constants we defined earlier here to specify things like the installer file (OutFile: which will be now ‘SQL Analyzer Setup.exe’).&lt;/p&gt;


&lt;p&gt;
Now the settings are complete and we need to define the actions during the installation. This is done by defining a section with some name.&lt;/p&gt;


&lt;div style=&quot;border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4&quot;&gt;

&lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none&quot;&gt;Section &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;MainSection&amp;quot;&lt;/span&gt; MainSection
;Action goes here...
SectionEnd&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;
&lt;/p&gt;


&lt;p&gt;
&lt;/p&gt;


&lt;p&gt;
&lt;/p&gt;


&lt;p&gt;
&lt;/p&gt;


&lt;p&gt;
&lt;/p&gt;


&lt;p&gt;
&lt;/p&gt;


&lt;p&gt;
Within this section, first we need to set the out path (which is the installation directory) and then copy all the required files to this path.&lt;/p&gt;


&lt;div style=&quot;border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4&quot;&gt;

&lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none&quot;&gt;SetOutPath &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;$INSTDIR&amp;quot;&lt;/span&gt;
SetOverwrite ifnewer

;Copy files
File &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;/oname=sqlanalyzer.ico&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;resources\sqlanalyzer.ico&amp;quot;&lt;/span&gt; ;Binary of the application.
File &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;/oname=SQLAnalyzer.exe&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;files\SQLAnalyzer.exe&amp;quot;&lt;/span&gt; ;Binary of the application.
File &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;/oname=sqlanalyzer.gif&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;files\sqlanalyzer.gif&amp;quot;&lt;/span&gt; ;A sample screen shot.
File &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;/oname=README.txt&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;files\README.txt&amp;quot;&lt;/span&gt; ;Readme file.
File &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;/oname=RICHTX32.OCX&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;files\RICHTX32.OCX&amp;quot;&lt;/span&gt; ;Required OCX control: Rich Text Box.
File &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;/oname=COMDLG32.OCX&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;files\COMDLG32.OCX&amp;quot;&lt;/span&gt; ;Required OCX control: Common Dialog. 
File &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;/oname=MSFLXGRD.OCX&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;files\MSFLXGRD.OCX&amp;quot;&lt;/span&gt; ;Required OCX control: Flex Grid.&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;
&lt;/p&gt;


&lt;p&gt;
Next, I am registering the dependent OCX controls and creating Start Menu shortcuts.&lt;/p&gt;


&lt;div style=&quot;border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4&quot;&gt;

&lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none&quot;&gt;;Register the OCX controls.
Exec &lt;span style=&quot;color: #006080&quot;&gt;&#39;regsvr32 &amp;quot;$INSTDIR\RICHTX32.OCX&amp;quot; /S&#39;&lt;/span&gt;
Exec &lt;span style=&quot;color: #006080&quot;&gt;&#39;regsvr32 &amp;quot;$INSTDIR\COMDLG32.OCX&amp;quot; /S&#39;&lt;/span&gt;
Exec &lt;span style=&quot;color: #006080&quot;&gt;&#39;regsvr32 &amp;quot;$INSTDIR\MSFLXGRD.OCX&amp;quot; /S&#39;&lt;/span&gt;

;Create Start Menu folders and shortcuts.
CreateDirectory &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;$STARTMENU\Programs\${PRODUCT_NAME}&amp;quot;&lt;/span&gt;
CreateShortCut &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;$STARTMENU\Programs\${PRODUCT_NAME}\${PRODUCT_NAME}.lnk&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;$INSTDIR\SQLAnalyzer.exe&amp;quot;&lt;/span&gt;
CreateShortCut &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;$STARTMENU\Programs\${PRODUCT_NAME}\README.lnk&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;$INSTDIR\README.txt&amp;quot;&lt;/span&gt;
CreateShortCut &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;$STARTMENU\Programs\${PRODUCT_NAME}\Sample.lnk&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;$INSTDIR\sqlanalyzer.gif&amp;quot;&lt;/span&gt;
CreateShortCut &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;$STARTMENU\Programs\${PRODUCT_NAME}\Uninstall.lnk&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;$INSTDIR\Uninstall.exe&amp;quot;&lt;/span&gt;

;Create uninstaller
WriteUninstaller &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;$INSTDIR\Uninstall.exe&amp;quot;&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;
&lt;/p&gt;


&lt;p&gt;
Any external tool can be used using the &lt;strong&gt;Exec&lt;/strong&gt; keyword. If you need to run your own custom tool as part of installation, first copy that tool and then use this command. NSIS can create an uninstaller automatically using the keyword &lt;strong&gt;WriteUninstaller&lt;/strong&gt;.&lt;/p&gt;


&lt;p&gt;
If we need this product to appear on Windows installed programs list (Add/Remove Programs), then we need to write a registry entry as below.&lt;/p&gt;


&lt;div style=&quot;border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4&quot;&gt;

&lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none&quot;&gt;WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;${PRODUCT_UNINST_KEY}&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;DisplayName&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;${PRODUCT_NAME}&amp;quot;&lt;/span&gt;
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;${PRODUCT_UNINST_KEY}&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;UninstallString&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;$INSTDIR\Uninstall.exe&amp;quot;&lt;/span&gt;
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;${PRODUCT_UNINST_KEY}&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;DisplayIcon&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;$INSTDIR\sqlanalyzer.ico&amp;quot;&lt;/span&gt;
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;${PRODUCT_UNINST_KEY}&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;DisplayVersion&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;${PRODUCT_DISPLAY_VERSION}&amp;quot;&lt;/span&gt;
WriteRegDWORD ${PRODUCT_UNINST_ROOT_KEY} &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;${PRODUCT_UNINST_KEY}&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;VersionMajor&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;${PRODUCT_VERSION_MAJOR}&amp;quot;&lt;/span&gt;
WriteRegDWORD ${PRODUCT_UNINST_ROOT_KEY} &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;${PRODUCT_UNINST_KEY}&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;VersionMinor&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;${PRODUCT_VERSION_MINOR}&amp;quot;&lt;/span&gt;
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;${PRODUCT_UNINST_KEY}&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;URLInfoAbout&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;${PRODUCT_WEB_SITE}&amp;quot;&lt;/span&gt;
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;${PRODUCT_UNINST_KEY}&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;Publisher&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;${PRODUCT_PUBLISHER}&amp;quot;&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;
&lt;/p&gt;


&lt;p&gt;
We are almost done and only thing left now is to instruct NSIS on what to do while the uninstaller is executed. Well, we need to remove whatever files we have copied, directories and shortcuts we have created, and registry entries we have made. This is specified in a section named &lt;strong&gt;Uninstall &lt;/strong&gt;as below.&lt;/p&gt;


&lt;div style=&quot;border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4&quot;&gt;

&lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none&quot;&gt;Section &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;Uninstall&amp;quot;&lt;/span&gt;
;Unregister the OCX controls.
Exec &lt;span style=&quot;color: #006080&quot;&gt;&#39;regsvr32 -u &amp;quot;$INSTDIR\RICHTX32.OCX&amp;quot; /S&#39;&lt;/span&gt;
Exec &lt;span style=&quot;color: #006080&quot;&gt;&#39;regsvr32 -u &amp;quot;$INSTDIR\COMDLG32.OCX&amp;quot; /S&#39;&lt;/span&gt;
Exec &lt;span style=&quot;color: #006080&quot;&gt;&#39;regsvr32 -u &amp;quot;$INSTDIR\MSFLXGRD.OCX&amp;quot; /S&#39;&lt;/span&gt;

;Delete all the files
Delete &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;$INSTDIR\sqlanalyzer.ico&amp;quot;&lt;/span&gt;
Delete &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;$INSTDIR\SQLAnalyzer.exe&amp;quot;&lt;/span&gt;
Delete &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;$INSTDIR\sqlanalyzer.gif&amp;quot;&lt;/span&gt;
Delete &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;$INSTDIR\README.txt&amp;quot;&lt;/span&gt;
Delete &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;$INSTDIR\RICHTX32.OCX&amp;quot;&lt;/span&gt;
Delete &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;$INSTDIR\COMDLG32.OCX&amp;quot;&lt;/span&gt;
Delete &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;$INSTDIR\MSFLXGRD.OCX&amp;quot;&lt;/span&gt;
Delete &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;$INSTDIR\Uninstall.exe&amp;quot;&lt;/span&gt;

;Remove the installation folder.
RMDir &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;$INSTDIR&amp;quot;&lt;/span&gt;

;Remove the Shortcuts
Delete &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;$STARTMENU\Programs\${PRODUCT_NAME}\${PRODUCT_NAME}.lnk&amp;quot;&lt;/span&gt;
Delete &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;$STARTMENU\Programs\${PRODUCT_NAME}\README.lnk&amp;quot;&lt;/span&gt;
Delete &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;$STARTMENU\Programs\${PRODUCT_NAME}\Sample.lnk&amp;quot;&lt;/span&gt;
Delete &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;$STARTMENU\Programs\${PRODUCT_NAME}\Uninstall.lnk&amp;quot;&lt;/span&gt;
RMDir /r &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;$STARTMENU\Programs\${PRODUCT_NAME}&amp;quot;&lt;/span&gt;

;Remove the entry from &lt;span style=&quot;color: #006080&quot;&gt;&#39;installed programs list&#39;&lt;/span&gt;
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;${PRODUCT_UNINST_KEY}&amp;quot;&lt;/span&gt;
SectionEnd&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;
&lt;/p&gt;


&lt;p&gt;
That’s it! Now make sure that the extension of this script file is .&lt;strong&gt;nsi&lt;/strong&gt; (download the complete file from &lt;a href=&quot;http://sites.google.com/site/sameerct/sourcecode/SQLAnalyzerInstaller.nsi&quot;&gt;here&lt;/a&gt;). Right click on this file from Windows Explorer and you will see an option ‘Compile NSIS Script’ if you have successfully installed NSIS. &lt;/p&gt;


&lt;p&gt;
&lt;a href=&quot;http://lh5.ggpht.com/_R783RuSyUoM/SaPFQP1hxSI/AAAAAAAABOo/6kqkl0wm36Y/s1600-h/sa9%5B2%5D.jpg&quot;&gt;&lt;img title=&quot;sa9&quot; style=&quot;border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px&quot; height=&quot;129&quot; alt=&quot;sa9&quot; src=&quot;http://lh4.ggpht.com/_R783RuSyUoM/SaPFRNnUwhI/AAAAAAAABOs/4ZNsTzhAJ3w/sa9_thumb.jpg?imgmax=800&quot; width=&quot;260&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;If there is any error, the compiler will inform about it specifying the line number in the script. So it is easy to fix issues. If everything went fine, the installer exe will be created at the same location.&lt;/p&gt;


&lt;p&gt;
Now let us see how the installer interface looks like with the settings in the script file.&lt;/p&gt;


&lt;p&gt;
&lt;a href=&quot;http://lh3.ggpht.com/_R783RuSyUoM/SaPFSVQaRlI/AAAAAAAABOw/7kPHhSkaXRI/s1600-h/sa1%5B2%5D.jpg&quot;&gt;&lt;img title=&quot;sa1&quot; style=&quot;border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px&quot; height=&quot;206&quot; alt=&quot;sa1&quot; src=&quot;http://lh3.ggpht.com/_R783RuSyUoM/SaPFTSDy8oI/AAAAAAAABO0/caOXLNzE9yo/sa1_thumb.jpg?imgmax=800&quot; width=&quot;260&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;This is the first welcome screen. The image on the left is the onwe we specified with ‘sqlanalyzerwelcome.bmp’. &lt;/p&gt;


&lt;p&gt;
&lt;a href=&quot;http://lh4.ggpht.com/_R783RuSyUoM/SaPFU909ZyI/AAAAAAAABO4/NvmuCH5_6xw/s1600-h/sa2%5B2%5D.jpg&quot;&gt;&lt;img title=&quot;sa2&quot; style=&quot;border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px&quot; height=&quot;206&quot; alt=&quot;sa2&quot; src=&quot;http://lh3.ggpht.com/_R783RuSyUoM/SaPFWTDShjI/AAAAAAAABO8/ZAD2M0ln0Ls/sa2_thumb.jpg?imgmax=800&quot; width=&quot;260&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;Here in the second page the license from a text file is displayed. The ‘Install’ button will be enabled only when&amp;#160; ‘I accept…’ checkbox is checked.&lt;/p&gt;


&lt;p&gt;
&lt;a href=&quot;http://lh5.ggpht.com/_R783RuSyUoM/SaPFYN6Rl_I/AAAAAAAABPA/ynbqlF0_1M0/s1600-h/sa3%5B2%5D.jpg&quot;&gt;&lt;img title=&quot;sa3&quot; style=&quot;border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px&quot; height=&quot;208&quot; alt=&quot;sa3&quot; src=&quot;http://lh6.ggpht.com/_R783RuSyUoM/SaPFZMWmioI/AAAAAAAABPE/ZposAJTXokI/sa3_thumb.jpg?imgmax=800&quot; width=&quot;260&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; This screen shows the progress of the installation.&lt;/p&gt;


&lt;p&gt;
&lt;a href=&quot;http://lh4.ggpht.com/_R783RuSyUoM/SaPFaTYrxtI/AAAAAAAABPI/UXR94gJ2xME/s1600-h/sa4%5B2%5D.jpg&quot;&gt;&lt;img title=&quot;sa4&quot; style=&quot;border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px&quot; height=&quot;206&quot; alt=&quot;sa4&quot; src=&quot;http://lh5.ggpht.com/_R783RuSyUoM/SaPFbQ08QVI/AAAAAAAABPM/wc9r3_5VVdk/sa4_thumb.jpg?imgmax=800&quot; width=&quot;260&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; This is the final page with an option to show Readme file. After the installation, the Start Menu shortcuts are created as below.&lt;/p&gt;


&lt;p&gt;
&lt;a href=&quot;http://lh5.ggpht.com/_R783RuSyUoM/SaPFcaasXQI/AAAAAAAABPQ/61fy3gkcGHQ/s1600-h/sa5%5B2%5D.jpg&quot;&gt;&lt;img title=&quot;sa5&quot; style=&quot;border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px&quot; height=&quot;162&quot; alt=&quot;sa5&quot; src=&quot;http://lh5.ggpht.com/_R783RuSyUoM/SaPFdd70XuI/AAAAAAAABPU/LvKYGSJkL0w/sa5_thumb.jpg?imgmax=800&quot; width=&quot;260&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;The product will also be listed under ‘Add/Remove Programs’&lt;/p&gt;


&lt;p&gt;
&lt;a href=&quot;http://lh6.ggpht.com/_R783RuSyUoM/SaPFfN9qdPI/AAAAAAAABPY/NRzXk0ye4Po/s1600-h/sa6%5B2%5D.jpg&quot;&gt;&lt;img title=&quot;sa6&quot; style=&quot;border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px&quot; height=&quot;92&quot; alt=&quot;sa6&quot; src=&quot;http://lh5.ggpht.com/_R783RuSyUoM/SaPFgao8mtI/AAAAAAAABPc/Kk3Xx9UdvW4/sa6_thumb.jpg?imgmax=800&quot; width=&quot;260&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;Now on clicking the Uninstall button, the uninstaller will get executed and will remove all the changes we have done.&lt;/p&gt;


&lt;p&gt;
&lt;a href=&quot;http://lh3.ggpht.com/_R783RuSyUoM/SaPFh6GoIoI/AAAAAAAABPg/OuwUyny_NTk/s1600-h/sa7%5B2%5D.jpg&quot;&gt;&lt;img title=&quot;sa7&quot; style=&quot;border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px&quot; height=&quot;206&quot; alt=&quot;sa7&quot; src=&quot;http://lh6.ggpht.com/_R783RuSyUoM/SaPFjgUchrI/AAAAAAAABPk/gLkKXGwrPEs/sa7_thumb.jpg?imgmax=800&quot; width=&quot;260&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/p&gt;


&lt;p&gt;
&lt;/p&gt;


&lt;p&gt;
&lt;/p&gt;


&lt;p&gt;
&lt;/p&gt;


&lt;p&gt;
&lt;/p&gt;


&lt;p&gt;
&lt;/p&gt;


&lt;p&gt;
&lt;/p&gt;


&lt;p&gt;
&lt;/p&gt;


&lt;p&gt;
You can download all the files and the script as a zip from &lt;a href=&quot;http://sites.google.com/site/sameerct/sourcecode/SQLAnalyzerInstaller.zip&quot;&gt;here&lt;/a&gt; or just try out the installer from &lt;a href=&quot;http://sites.google.com/site/sameerct/sourcecode/SQLAnalyzerSetup.zip&quot;&gt;here&lt;/a&gt;. Let me know if this article helped you and feel free to post any questions you may have. Remember to first check out the tutorial and documentation on NSIS site which is very detailed.&lt;/p&gt;</description><link>http://ctlabs.blogspot.com/2009/02/nullsoft-scriptable-install-system-nsis.html</link><author>noreply@blogger.com (Sameer C. Thiruthikad)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh6.ggpht.com/_R783RuSyUoM/SaPFMklApDI/AAAAAAAABOc/wpsBCOHVaf4/s72-c/Zip2Exe_thumb%5B8%5D.jpg?imgmax=800" height="72" width="72"/><thr:total>11</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-17497884.post-5024537269131558610</guid><pubDate>Thu, 27 Nov 2008 10:55:00 +0000</pubDate><atom:updated>2008-11-27T16:36:48.934+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Misc Products</category><title>Windows Live Writer Plugin Development</title><description>&lt;a href=&quot;http://get.live.com/writer/overview&quot;&gt;Windows Live Writer&lt;/a&gt; is a cute small free blog publishing desktop application. If you are tired of the browser based tools to post your blogs, you must try Writer where you can create rich content posts offline and then publish to your blog hosting server when you are online. &lt;br /&gt;
&lt;a href=&quot;http://lh4.ggpht.com/_R783RuSyUoM/SS58YIXNEYI/AAAAAAAABA0/O2qGjvkxslM/s1600-h/lwplugin0%5B12%5D.jpg&quot;&gt;&lt;img alt=&quot;lwplugin0&quot; border=&quot;0&quot; height=&quot;413&quot; src=&quot;http://lh3.ggpht.com/_R783RuSyUoM/SS58Z5tZSzI/AAAAAAAABA4/LYvh3uP95Y4/lwplugin0_thumb%5B10%5D.jpg?imgmax=800&quot; style=&quot;border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px;&quot; width=&quot;556&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
Windows Live Writer can be easily installed by double clicking the downloaded WLinstaller.exe file. To The initial wizard during the startup will help to configure to an existing blog or to create a new blog. There are no other additional configurations or settings involved.&lt;br /&gt;
Plugins helps in extending the capabilities of Writer to insert, edit, and publish new types of content. It is very easy to develop a plugin if you are a .NET developer. For the plugin development no separate SDK is required as all the APIs comes with the installation and will be available in the installation folder typically at C:\Program Files\Windows Live\Writer.&lt;br /&gt;
&lt;a href=&quot;http://lh4.ggpht.com/_R783RuSyUoM/SS58a32a1iI/AAAAAAAABA8/1LZ8RiCYJco/s1600-h/lwplugin4%5B7%5D.jpg&quot;&gt;&lt;img alt=&quot;lwplugin4&quot; border=&quot;0&quot; height=&quot;448&quot; src=&quot;http://lh6.ggpht.com/_R783RuSyUoM/SS58bxhIBbI/AAAAAAAABBA/uWPy0DUDo2s/lwplugin4_thumb%5B5%5D.jpg?imgmax=800&quot; style=&quot;border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px;&quot; width=&quot;611&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
&lt;a href=&quot;http://lh6.ggpht.com/_R783RuSyUoM/SS58dHg_KII/AAAAAAAABBE/C5f_qrPSaZM/s1600-h/lwplugin1%5B7%5D.jpg&quot;&gt;&lt;img alt=&quot;lwplugin1&quot; border=&quot;0&quot; height=&quot;306&quot; src=&quot;http://lh4.ggpht.com/_R783RuSyUoM/SS58eBVx8QI/AAAAAAAABBI/iAk5OlT3rQ8/lwplugin1_thumb%5B5%5D.jpg?imgmax=800&quot; style=&quot;border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px;&quot; width=&quot;518&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
&lt;a href=&quot;http://lh6.ggpht.com/_R783RuSyUoM/SS58fWWSOWI/AAAAAAAABBM/rX8GVmmaP9c/s1600-h/lwplugin2%5B7%5D.jpg&quot;&gt;&lt;img alt=&quot;lwplugin2&quot; border=&quot;0&quot; height=&quot;327&quot; src=&quot;http://lh6.ggpht.com/_R783RuSyUoM/SS58gIzrrlI/AAAAAAAABBQ/c0FutjYwoBw/lwplugin2_thumb%5B5%5D.jpg?imgmax=800&quot; style=&quot;border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px;&quot; width=&quot;528&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
&lt;a href=&quot;http://lh4.ggpht.com/_R783RuSyUoM/SS58hF4x8gI/AAAAAAAABBU/D833pTC5lVM/s1600-h/lwplugin3%5B7%5D.jpg&quot;&gt;&lt;img alt=&quot;lwplugin3&quot; border=&quot;0&quot; height=&quot;271&quot; src=&quot;http://lh4.ggpht.com/_R783RuSyUoM/SS58iLzt9qI/AAAAAAAABBY/CUfBoOeGOso/lwplugin3_thumb%5B5%5D.jpg?imgmax=800&quot; style=&quot;border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px;&quot; width=&quot;516&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
There are two types of content source plugins a) Simple (inserts custom html) and b) Smart (inserts custom html with editing options). &lt;br /&gt;
Content created by both simple and smart content sources can originate from an Insert dialog box, a URL, or Live Clipboard data. Each content source plugin can support creating content from one or all of these contexts.&lt;br /&gt;
In this post, we will see how we can develop a Simple Content Source Plugin through Insert Dialog Box. You can use Visual Studio 2008 or 2005 or 2003.&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Launch Visual Studio and start a new Class Library Project in C#. &lt;/li&gt;
&lt;li&gt;Add a reference to the WindowsLive.Writer.Api assembly (located in the directory C:\Program Files\Windows Live\Writer). &lt;/li&gt;
&lt;li&gt;Create a new class derived from ContentSource base class from this API. &lt;/li&gt;
&lt;li&gt;Apply the WriterPluginAttribute to the new class that will define the plugin properties. (Use a new GUID to identify this plugin. If an image is specified in the attribute, add this image as an embedded resource to the project. The publisher URL and description will appear in the Plugins options in Writer). &lt;/li&gt;
&lt;li&gt;Apply the InsertableContentSourceAttribute to the new class that will define the plugin content. This will appear as the menu name under Insert menu. &lt;/li&gt;
&lt;li&gt;Override the CreateContent method and code the required functionality there. &lt;/li&gt;
&lt;li&gt;Add a Post Build event to the project to copy plugin dll to the Writer plugins directory after it is built (XCOPY /D /Y /R &quot;$(TargetPath)&quot; &quot;C:\Program Files\Windows Live\Writer\Plugins\&quot;). &lt;/li&gt;
&lt;li&gt;Build the project and then run Windows Live Writer to test and debug. New plugin will appear under Insert menu. &lt;/li&gt;
&lt;/ul&gt;The complete code snippet for a hello world plugin is given below:&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.Windows.Forms;
&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; WindowsLive.Writer.Api;

&lt;span class=&quot;kwrd&quot;&gt;namespace&lt;/span&gt; LiveWriterPlugin
{
[WriterPluginAttribute
(&lt;span class=&quot;str&quot;&gt;&quot;8CFEFA0C-6366-419f-9590-20A6590728DC&quot;&lt;/span&gt;,
&lt;span class=&quot;str&quot;&gt;&quot;My Sample Plugin&quot;&lt;/span&gt;,
ImagePath = &lt;span class=&quot;str&quot;&gt;&quot;mypluginimage.png&quot;&lt;/span&gt;,
PublisherUrl = &lt;span class=&quot;str&quot;&gt;&quot;http://ctlabs.blogspot.com&quot;&lt;/span&gt;,
Description = &lt;span class=&quot;str&quot;&gt;&quot;A sample plugin that can insert hellow world in your blog posts&quot;&lt;/span&gt;)]

[InsertableContentSourceAttribute(&lt;span class=&quot;str&quot;&gt;&quot;My Sample Plugin Content&quot;&lt;/span&gt;)]
&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; MyPlugin: ContentSource
{
&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;override&lt;/span&gt; DialogResult CreateContent(IWin32Window dialogOwner, &lt;span class=&quot;kwrd&quot;&gt;ref&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; newContent)
{
DialogResult result = MessageBox.Show(&lt;span class=&quot;str&quot;&gt;&quot;Do you want to insert this sample content?&quot;&lt;/span&gt;,&lt;span class=&quot;str&quot;&gt;&quot;My Plugin&quot;&lt;/span&gt;,MessageBoxButtons.OKCancel);

&lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (result == DialogResult.OK)
{
newContent = &lt;span class=&quot;str&quot;&gt;&quot;Hello World from Plugin&quot;&lt;/span&gt;;
}

&lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; result;
}
}
}&lt;/pre&gt;&lt;br /&gt;
That&#39;s it. Look at the above images to see this plugin in action. Happy plugin development!</description><link>http://ctlabs.blogspot.com/2008/11/windows-live-writer-plugin-development.html</link><author>noreply@blogger.com (Sameer C. Thiruthikad)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh3.ggpht.com/_R783RuSyUoM/SS58Z5tZSzI/AAAAAAAABA4/LYvh3uP95Y4/s72-c/lwplugin0_thumb%5B10%5D.jpg?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-17497884.post-5186247660323012196</guid><pubDate>Thu, 06 Nov 2008 13:12:00 +0000</pubDate><atom:updated>2008-11-07T11:34:53.316+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Tech Events</category><title>Innovation Days Again At Kochi</title><description>It was just 5 months back we had an &lt;a href=&quot;http://ctlabs.blogspot.com/2008/05/microsoft-innovation-days-at-kochi.html&quot;&gt;Innovation Days event at Kochi&lt;/a&gt; from Microsoft. Seeing the great response from the IT enthusiasts at Kochi, Microsoft has come back today with yet another session packed event. This time the location was at Taj Residency at Marine Drive.&amp;nbsp; Kochi techies showed their interest by turning up in large numbers, making it a house-full event.&lt;br /&gt;
&lt;br /&gt;
The day started with a keynote address from Vikram Rajkondawar, Architect Advisor at Microsoft (India). He spoke in detail about the Software + Services mantra Microsoft is transitioning to, and clarified myths around Cloud computing and briefly explained Windows Azure and other &lt;a href=&quot;http://ctlabs.blogspot.com/2008/10/latest-from-microsoft.html&quot;&gt;latest technologies&lt;/a&gt;. There was a &lt;a href=&quot;http://ctlabs.blogspot.com/2008/09/microsoft-live-mesh.html&quot;&gt;Live Mesh&lt;/a&gt; demo that showed connected devices (two laptops and a mobile) synchronizing files between them.&lt;br /&gt;
&lt;br /&gt;
The session on SQL Server performance issues by Praveen was in-depth as he discussed internals of SQL Server and how a query is parsed, algebrized and optimized before execution. He did mention that from SQL Server 2005 onwards it doesn’t matter if you are using stored procedures or inline SQL queries as both gives similar results on a performance point of view.&lt;br /&gt;
&lt;br /&gt;
Nahas Mohammed did a short session on Internet Explorer 8 and demonstrated its new features like Accelerators and Web Slices.&lt;br /&gt;
&lt;br /&gt;
Chandrashekar’s session on .NET debugging tools helped in understanding some of those rarely used, but highly useful debugging tools like Fusion Log Viewer (fuslogvw.exe), NGen, SoS.dll, ILDAsm, ILAsm, and Managed Debugging Assistance (MDA).&lt;br /&gt;
&lt;br /&gt;
Praveen concluded the event with a session on Rich Internet Applications (RIA) and spoke about ASP.NET MVC, AJAX, jQuery integration and Silverlight.&lt;br /&gt;
&lt;br /&gt;
Between the technical tracks, there was a short session on &lt;a href=&quot;http://www.innovateon.com/&quot;&gt;Innovate On&lt;/a&gt; partnership program that Microsoft launched last time. A guy from TIE (&lt;a href=&quot;http://kerala.tie.org/&quot;&gt;The IndUs Entrepreneurs&lt;/a&gt;) spoke about their institution and inspired us to think on entrepreneurship.&lt;br /&gt;
&lt;br /&gt;
There were lots of goodies (T-Shirts, books) given out besides a great lunch. I enjoyed the overall event and could meet many friends/ex-colleagues as well as some new people from the Kochi developer community. As I had registered for the Innovate On program last time, I received my first kit containing a T-Shirt, Technology Specialist certificates, and CDs containing technical resources.</description><link>http://ctlabs.blogspot.com/2008/11/innovation-days-again-at-kochi.html</link><author>noreply@blogger.com (Sameer C. Thiruthikad)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-17497884.post-2845387231590558222</guid><pubDate>Thu, 30 Oct 2008 10:06:00 +0000</pubDate><atom:updated>2008-10-30T15:39:47.042+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Windows</category><title>Multi-Touch Windows 7 Application</title><description>See this video of Multi-Touch Windows 7 Application developed by &lt;a href=&quot;http://www.identitymine.com/&quot;&gt;IdentityMine.&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;object height=&quot;344&quot; width=&quot;425&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/9YA8x2sfvTw&amp;hl=en&amp;fs=1&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://www.youtube.com/v/9YA8x2sfvTw&amp;hl=en&amp;fs=1&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;425&quot; height=&quot;344&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;
&lt;br /&gt;
Read more about it &lt;a href=&quot;http://uihero.wordpress.com/2008/10/29/worlds-first-multitouch-windows-7-application&quot;&gt;here&lt;/a&gt;.</description><link>http://ctlabs.blogspot.com/2008/10/multi-touch-windows-7-application.html</link><author>noreply@blogger.com (Sameer C. Thiruthikad)</author><thr:total>0</thr:total></item></channel></rss>