Can you force Silverlight to only run Out-of-browser?
Asked Answered
P

2

5

Can you force Silverlight to only run Out-of-browser?

EDIT: The reason I'm asking is because a lot of Silverlight's functionality only works OOB. If my application depends on this I need to either require the Silverlight app to run in that mode or pick something else.

Pella answered 5/4, 2011 at 18:21 Comment(3)
seriously though, why not wpf and a clickonce install?Pierro
@Nathan: Can a clickonce install also install the required .NET framework?Attenuator
@AnthonyWJones, yes, requirements are downloaded and installed automatically, iirc. also, i'm making the assumption the op is only dealing with windows machines, if dealing with macs, i concede the silverlight point.Pierro
A
9

How about using this in your Application_Startup even in App.Xaml.cs:-

private void Application_Startup(object sender, StartupEventArgs e)
{

     if (IsRunningOutOfBrowser)
     {
          this.RootVisual = new MainPage();
     }
     else
     {
          this.RootVisual = new PleaseRunOOB():
     }
}

Now create a very simple UserControl called PleaseRunOOB to present to the user the neeed to install and/or run the OOB version of the app.

Attenuator answered 5/4, 2011 at 19:3 Comment(5)
i like this in theory. i'm just struggling with why you would even post it to the web if you didn't want it to be viewed in a browser.Pierro
@Nathan: As a means of delivery.Attenuator
@Nathan: There is a ton of need in this world for what Silverlight can provide for LOB applications. The largest item is that it eliminates the need for having to fight with the sysadmins to get special settings deployed for each application the devs create to solve business problems. Also, for a new product I'm working on, it gives us the cross-platform support we've been looking for since inception.Societal
@Richard, i'm not saying i don't understand the place for silverlight, and lob applications is really about the right spot for it. i was mainly questioning the reasoning behind forbidding the use of a web technology on the web. seems silly.Pierro
I have LOB applications that require this too. In the past I used ClickOnce to deploy, now I am starting to use Silverlight OOBs.Genagenappe
P
4

from http://blogs.microsoft.co.il/blogs/alex_golesh/archive/2010/03/15/silverlight-4-quick-tip-out-of-browser-improvements.aspx

Additional feature exist with new OOB model is ability to install application not from the web page (like it was from version 3), but from command line (having XAP file available). Silverlight 4 OOB launcher has new command line parameters to install, uninstall and execute application in “emulation mode” – without installing it.

For example. to install application on the desktop use the following command:

"%ProgramFiles(x86)%\Microsoft Silverlight\sllauncher.exe" /overwrite /install:"X:\PACKAGE_LOCATION\SL4Features.Web\ClientBin\APPLICATION.xap"
/origin:http://ORIGINAL_LOCATION/ORIGINAL_HOSTING_PAGE /shortcut:desktop

To uninstall it use the following command:

"%ProgramFiles(x86)%\Microsoft Silverlight\sllauncher.exe" /overwrite /uninstall:"X:\PACKAGE_LOCATION\APPLICATION.xap"
/origin:http://ORIGINAL_LOCATION/ORIGINAL_HOSTING_PAGE /shortcut:desktop

To run application without installing it (in emulation mode), use the following command:

"%ProgramFiles(x86)%\Microsoft Silverlight\sllauncher.exe" /overwrite /emulate:"X:\PACKAGE_LOCATION\APPLICATION.xap" /origin:http://ORIGINAL_LOCATION/
Pierro answered 5/4, 2011 at 18:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.