Finding the Installation location of a silverlight OOB App
Is there any way to find where an OOB app is installed at runtime? I realise that once an OOB app is installed it开发者_如何学Go is placed in a folder in "OutOfBrowser" within AppData. However, the folder is named with a long number (probably time stamp related) which I wont know as it changes on each installation. As I would like to launch the OOB app from an existing Windows App, I was going to store the location of the OOB app when I first launch it, then read that path from my existing Windows App to launch it. Is there a way of finding the location of the OOB at runtime?
I realize it's an old thread, but I just had a go at finding the location, so hopefully others can find this useful
Your OOB app will be using the si launcher like "C:\Program Files (x86)\Microsoft Silverlight\sllauncher.exe" 123456789.www.my.website.com
, from there you get 123456789.www.my.website.com as the semi-criptic name of your app, the xap fille should be located at this location:
C:\Users\[User ID]\AppData\Local\Microsoft\Silverlight\OutOfBrowser\123456789.www.my.website.com
I dont expect you can find it from inside the Silverlight Application. The location it uses based on an AppId which is generated at runtime. The AppId is just some random number with the domainname.
There is a method called Deployment.GetAppIdForUri, but this has the SecurityCriticalAttribute to prevent access.
It looks like silverlight apps are noted in this Index folder: C:\Documents and Settings\Rod\Local Settings\Application Data\Microsoft\Silverlight\OutOfBrowser\index
If you new the Origin of the app you wanted you could load up the file there and iterate through it to get the paths... a bit hacky but don't know another way.
Here's the thread I posted on SLLauncher and some other findings.
精彩评论