Hosting Silverlight as Desktop Applications – II

Enabling Silverlight Installation on Desktop

To enable installation of Silverlight applications on Desktop, we need to add some custom code in Property > AppManifest.xml

</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><Deployment xmlns=http://schemas.microsoft.com/client/2007/deployment</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><Deployment.Parts></Deployment.Parts></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><Deployment.OutOfBrowserSettings></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><OutOfBrowserSettings ShortName="Hello World Application"></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><OutOfBrowserSettings.WindowSettings></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><WindowSettings Title="HW Application" /></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"></OutOfBrowserSettings.WindowSettings></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><OutOfBrowserSettings.Blurb>Comments that are displayed in More Information </OutOfBrowserSettings.Blurb></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"></OutOfBrowserSettings></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"></Deployment.OutOfBrowserSettings></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"></Deployment></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">

 <Deployment xmlns=http://schemas.microsoft.com/client/2007/deployment
  xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml>
  <Deployment.Parts></Deployment.Parts>
  <Deployment.OutOfBrowserSettings>
    <OutOfBrowserSettings ShortName="Hello World Application">
      <OutOfBrowserSettings.WindowSettings>
        <WindowSettings Title="HW Application" />
      </OutOfBrowserSettings.WindowSettings>
      <OutOfBrowserSettings.Blurb>Comments that are displayed in More Information </OutOfBrowserSettings.Blurb>
    </OutOfBrowserSettings>
  </Deployment.OutOfBrowserSettings>
</Deployment>

And when any one accesses it, is able to install by right click and even create shortcuts…

Continue reading » · Rating: · Written on: 09-17-09 · No Comments »

Hosting Silverlight as Desktop Applications – I

How often you have seen Silverlight applications getting hosted as Destkop Applications?  Not many times!

Yes, like Flex getting hosted on AIR platform – Silverlight applications can also be hosted on Desktop Applications. 

Note: Remember that Silverlight is a miniature version of WPF – hence a Silverlight Application hosted on Desktop will anyway be of smaller footprint and will have minimal UI richness compared to a WPF desktop application

How to host an existing Silverlight Application on Desktop?

Windows ships in with an executable mshta.exe in C:\Windows\System32

  • Create a Shortcut on Desktop for mshta.exe. Now right click the shortcut and click on Properties
  • Change the Target to:
    mshta.exe “C:\inetpub\wwwroot\SilverlightApplication\SilverlightApplicationTestPage.html
  • Now click on OK

The path in RED is the path of the HTML page that hosts the Silverlight Application.

Click on the shortcut to view your Silverlight Application as a Desktop Application. :D

Continue reading » · Rating: · Written on: 09-03-09 · 1 Comment »