Search code examples
silverlightsilverlight-oobelevated-privileges

Install Silverlight OOB app from within another Silverlight app


I have a big LOB Silverlight App that works in browser and now I need to do smth with elevated priveleges so I need to install smth OOB. But I don't want to install whole app with all its complexity and assumptions - I'd want to have a small separate Silverlight app that I'll be able to install from within main one. Any ideas on how can I incorporate one Silverlight app with ability to install it OOB within another Silverlight app?


Solution

  • This explanation is going to seem a lot like the movie Inception: a Silverlight within a Silverlight.

    First of all, even with a trusted Silverlight 4 out of browser application you have restrictions around the file system that make executing the sllauncher (the program that runs your oob apps can also be used at the command line to uninstall/install them) to do an install impossible, but there are two other possibilities you could explore:

    1. Embed the WebBrowser class in your out-of-browser app and point it to a website with an installable out of browser app. I tried this and it in fact works. Remember that you will only be able to prompt them to install the app from the second website; there is no way to force an install on a user through the web.

    2. There may be a COM API you could use to execute sllauncher while pointing it at a XAP file you download through normal Silverlight APIs. To do the COM part of this would require a trusted signed app though. I cannot think of a COM object to launch sllauncher off hand though so that may be a good question to ask eleswhere. I have not tried this approach.