Enabling Out-of-Browser Support in Silverlight 3

Silverlight Logo

One of the new features of Silverlight 3 that I wanted to play with first was the ability to create an Out-of-Browser experience. The Out-of-Browser feature remarkably different than Adobe AIR's approach. From the user's perspective, Out-of-Browser support in Silverlight 3 allows installation directly from the browser. For example, here's an application that I built to support Out-of-Browser:

outofbrowser_1

When you right-click the application, you get the opportunity to launch it out of the browser:

outofbrowser_2

Launching out of the browser supports actually installing desktop and start menu items as well:

outofbrowser_3

Once out of the browser, the title bar is shown appended with the source of the .xap file:

outofbrowser_4

To support this, you simply need to change your AppManifest.xaml file (located in your Properties folder in Silverlight) to include the Deployment.ApplicationIdentity section:

<Deployment 
  xmlns="http://schemas.microsoft.com/client/2007/deployment"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  
  <Deployment.Parts>
  </Deployment.Parts>

  <!-- Uncomment the markup and update 
       the fields below to make your 
       application offline enabled -->
  <Deployment.ApplicationIdentity>
    <ApplicationIdentity
        ShortName="Out of Browser Silverlight Application"
        Title="This app is out of the browser!">
      <ApplicationIdentity.Blurb>
        Sample Out of the Browser App
      </ApplicationIdentity.Blurb>
    </ApplicationIdentity>
  </Deployment.ApplicationIdentity>

</Deployment>

You can also launch the app out of the browser using the App.Current.Detach(). You can also test to see if the application is running offline:

if (!App.Current.RunningOffline)
{
    App.Current.Detach();
}

Adding Out of the browser support is that easy. What do you think?

Comments:

Gravatar

Will this feature be supported in Mac OS ?

Gravatar

Yes, this works on the Mac too.

Gravatar

At first glance... this looks GREAT! I'll have to learn more and get a feel for it, but so far this is very encouraging.

Gravatar

does that feature support to access the Mac OS X Apis too?

Gravatar

Is the app still sandboxed? Or can it write files, etc...

Gravatar

Will Silverlight 3 also support an installer? What if I don't want to install in a browser first?

And how are application updates handled?

Gravatar

Has Font Readability improved in Silverlight 3?

I won't be using it until it does.

Gravatar

Bon Geek,

Silverlight out of browser is still in a sandbox so it can't reach out to the OSX desktop (using the API's at all). The experience is the same as Silverlight 2, its just in a non-browser window.

Gravatar

Uncle Festis,

Still sandboxed...same as in the browser.

Gravatar

Mike Moore,

No installer. The whole idea is that its web delivered.

Gravatar

Steve,

Yes, font rendering is now Cleartype rendered...

Gravatar

I thought Cleartype rendering wouldn't be available until the final SL3 release.

Gravatar

John R,

Yeah, my bad. Its a SL3 feature but it isn't enabled in the current bits. It will do this by RTM I am told.

Gravatar

Thanks for verifying that, Shawn. I agree with Steve--the current text rendering, especially in small fonts, is quite undesirable for serious LOB applications in Silverlight. Sure hope in the SL3 RTM that it will be noticeably crisper.

Gravatar

I would like the possibility to use not just this ability but to generate a "classic" installer for both Mac and PC since some different features (due to the change of partial trust to full trust) can be on each one... this will be supported?
Greetings

Gravatar

Carlos,

No, there isn't a Full-Trust scenario for Silverlight 3 applications. You can do this with WPF or XBAP but not with Silverlight.

Gravatar

I have made a very simple app and I can't run it OOB. Nor can I run apps created by others OOB!

When I launch the short cut ( "C:\Program Files\Microsoft Silverlight\3.0.40307.0\sllauncher.exe" localhost.2), I get an error dialog that says:

One or more ActiveX controls could not be displayed because either:

1) Your current security settings prohibit running ActiveX controls on this page, or

2) You have blocked a publisher of one of the controls.

As a result, the page might not display correctly.



After pressing the Ok button, I get the "Install Microsoft Silverlight" image. Which, of course, when clicked on, will try to download 2 while in fact I have 3 beta installed on Vista Business.

I'm guessing that there is a setting in Internet Options of IE 8 that I need to change. (though my default browser is Firefox 3.x) But I have looked through all the settings and as far as I can see, I'm not restricting anything (although I do have some options as Prompt rather than Enable).

Do you have a guess as to what EXACTLY it is complaining about or how EXACTLY to fix it? Thanks.


 



 
Save Cancel