Silverlight Feeds - All your Silverlight feeds in one place.

Sponsors

Tuesday, November 24, 2009

Silverlight 4 and command line execution

by Michael Wolf via Michael Wolf on 11/24/2009 11:47:05 PM

In my last post on out of browser we showed how easy and powerful it is , all be it a bit of a step back in the development time machine, to execute native windows applications using the new com support in silverlight 4. The next logical question arises, that if you can execute com can you also execute a local process. The answer is yes and no. You can execute a local process, not using System.Diagnostics.Process.Start() like you would in the full CLR, but using the COM inerop and the Windows Script Host . The Windows Script Host is a multi purpose COM object that’s shipped with Windows since Win 98, and generally used for automation tasks, which makes it perfect for use in silverlight com inerop.

For the purposes of the demo I use the Script Host to act as my command line to execute arbitrary processes. In the following screencast I show how to simply execute any command via it from silverlight. Although this is useful for opening native applications, where this could really shine is by downloading applications which were specifically designed for interacting with your silverlight 4 OOB application.



The code to call the Script Host to execute the process is very simple.



Obviously , as that this tool is highly flexible, there are a ton of methods available to you (http://msdn.microsoft.com/en-us/library/2x3w20xf(VS.85).aspx) where we are just showing the absolute easiest implementation. However cool this is, and possibly very powerful as is to say open up a new browser window from your silverlight oob app (http://screencast.com/t/M2E1YmZiNz). I think the most exciting use for this would be in pulling down an additionally complementary executable for your OOB experience. With the addition of file access and web requests with out the client policy sand box in elevated privileges OOB apps this becomes very easy , as seen in the snippet below.



Conclusion after quite a bit of time exploring Silverlight 4 OOB functionality:
All and All with the combination of com inerop + web requests with out a sandbox + local file storage + drag and drop from the desktop == you get closer and "closer" to a first class citizen silverlight desktop app. I say closer because with the less than desirable com developer experience and the windows only platform of com , combined with a lack of a native installer leaves WPF as the development platform of choice for complicated desktop experiences. Where as Silverlight OOB with elevated privileges will now fill the gap that the click once WPF app once filled for most implementations (and then some). In addition the silverlight 4 OOB experience will now better lend its self to the desktop companion and hybrid Web/Desktop experience that really speaks to the 3 screens and a cloud vision.

email it!bookmark it!digg it!

Original Post: Silverlight 4 and command line execution

Subscribe

New Feed

Product Spotlight

Recently Updated Sources

Legal Note

The content of the postings is owned by the respective author. Silverlight Feeds is not responsible for the contents of the postings. This site is automatically generated and cannot be reviewed for abusive content. If you find abusive content on Silverlight Feeds, please contact us. Designated trademarks and brands are the property of their respective owners. All rights reserved.

Advertise with us