The Silverlight Install and Logging Framework (SILF) is a drop-in replacement for the standard Silverlight.js designed to also manage the in-place install/upgrade experience. You simply add your own style to the install prompts and let the framework do the rest (including optionally logging the steps).
The instructions and files you need are below. It's not a fully supported codeplex project yet but if you have any questions you can contact me here in the meantime.
Download SILF.js code
You can download the SILF.js code from here. Note that it is a work in progress and provided under the MSPL licencing terms. This page (View | Source is your friend) contains a sample implementation that you can reference.
For live deployments we recommend that you compress the SILF code using your favorite tool. We will provide a minified version in the future as well as possibly providing a CDN deployed version so you don't have to host your own.
Reporting
At the moment we don't have a reporting service sample available, but all you need to do is record the query string parameters to either a log queue or directly into a database. When we release this via Codeplex we will include a sample reporting service.
Parameters for using SILF
As well as including SILF.js in your page you will need to add a Silverlight object tag as below and add the call to initiaslise the framework to your BODY onload - <body onload="SILF.onLauncherPageLoad();">
| Name | Format | Mandatory | Description |
|---|---|---|---|
| SILF.appName | Text | No | If you are using logging you may want to define this to track your specific XAP |
| SILF.appVersion | Decimal(2,1) | No | As for SILF.appName |
| SILF.logEntryflow | Bool (true/false) | No, default=false | Log the entry flow (installed / current / supported) |
| SILF.logInstall | Bool (true/false) | No, default=false | log the install experience |
| SILF.loggingURIentry | Text | No | URI for logging entry flow. If blank no logging occurs
eg: http://mediaevangelism.com/silf/logger.aspx?act=entry added parameters: u=random GUID, s= Silverlight State (0=not installed, 1= old version, 2=current), o=Silverlight Environment (0=unsupported, 1=supported), i=logging index, t=timestamp, an=appName, av=appVersion, r=referrer |
| SILF.loggingURIinstall | Text | No | URI for logging entry flow. If blank no logging occurs
eg: http://mediaevangelism.com/silf/logger.aspx?act=install added parameters: u=random GUID (same as entry), a=action, i=index, t=timestamp, an=appName, av=appVersion |
| SILF.minSlVersion | Text | YES | Required Silverlight version. Should match the <object>
eg: "3.0.50106.0" |
| SILF.SilverlightControlHost | Text | YES | ID of the div which contains the Silverlight control |
| SILF.PromptInstall | Text | no | Prompt to display when the user does not have Silverlight installed |
| SILF.PromptFinishInstall | Text | no | Prompt to display when the user is installing Silverlight (browser should automatically refresh) |
| SILF.PromptUpgrade | Text | no | Prompt to display if user needs to upgrade Silverlight |
| SILF.PromptFinishUpgrade | Text | no | Prompt to display during Upgrade. At end user should restart browser |
| SILF.PromptRestart | Text | no | Prompt to display if user has upgraded and refreshes, rather than re-starts |
| SILF.PromptNotSupported | Text | no | Prompt displayed if the browser or OS does not support Silverlight (can be over-ridden by SILF.RedirectNotSupported) |
| SILF.RedirectNotSupported | Text | no | URL to redirect to if browser or OS does not support Silverlight (in this case SILF.PromptNotSupported is not shown) |
| SILF.WarningNotTested | Text | no | Popup alert that this browser is not officially supported but might work (Chrome). |
| SILF.PromptNotTested | Text | no | If defined is specified will replace the text on the "install" and "upgrade" slates defined above |
The <Object> tag:
<div id="silverlightControlHost" style="height:100;">
-- this is the id that you specify in SILF.SilverlightControlHost
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="940" height="406">
<param name="Source" value='SmoothStreamingSamplePlayer.xap' />
-- your xap. see cross domain note below
<param name="InitParams" value='fakemode=,background=#FF000000,autoload=False,autoplay=False,muted=False,stretchmode=0,playlist=
-- parameters for your xap
<param name="windowless" value="false" />
<param name="background" value="black" />
<param name="minRuntimeVersion" value="3.0.50106.0" />
-- should match the SILF.minSLVersion from the variables above
<param name="autoUpgrade" value="false" />
-- Must be set to "false" to avoid the default mechanism taking over
<param name="onerror" value="onSilverlightError" />
-- points to the standard error handler. If you need to do additional error handling point to your code and then call this function
<param name="onload" value="onSilverlightLoad" />
-- points to the standard OnLoad handler. If you need to do additional handling of this event point to your code and then call this function
</object>
</div>
Cross domain support
if you XAP is hosted in a different domain you must add ExternalCallersFromCrossDomain="ScriptableOnly" to your mainifest - see here for more info.
Status Messages (for the logging framework)