Add-on for Internet Explorer - installers for web sites

This NuGet package is primarily intended for use as a dependency of our other packages that provide ASP.NET Server Controls. The package is separate so that we don't tie the release of updates to the Server Control packages to the ScriptX binaries. The package will be updated with each release of ScriptX.

The package also provides an alternative and convenient method to obtaining the latest Resource Kit.

The package installs the following:

  • Client PC installer packages smsx.cab and ScriptX.msi
  • .NET Class library MeadCo.ScriptX.ScriptXConfigHandler to provide a custom config section in web.config
  • Updates to web.config for the custom section

Installer packages

The installer packages are copied to the folder ~/Content/MeadCo.ScriptX/installers.

Basic use

There is no problem with using this location and following the notes on Installing ScriptX on client PCs using code such as this (assuming MVC/Razor syntax):

<!-- MeadCo ScriptX -->
<object id=factory style="display:none"
  classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814"
  codebase="@Url.Content('~/Content/MeadCo.ScriptX/installers/smsx.cab')#Version=8,3,0,4
">
</object>

However, this code will need updating with the correct version number with each update to the package.

Licensed use

<!-- MeadCo Security Manager -->
<object style="display:none"
 classid="clsid:5445be81-b796-11d2-b931-002018654e2e"
 codebase="@Url.Content('~/Content/MeadCo.ScriptX/installers/smsx.cab')#Version=8,3,0,4
">
 <param name="GUID" value="{YOUR_LICENSE_GUID}" />
 <param name="Path" value="http://[your path here]/sxlic.mlf" />
 <param name="Revision" value="[YOUR_LICENSE_REVISION]" />
 <param name="PerUser" value="true" />
</object>

<!-- MeadCo ScriptX -->
<object id="factory" style="display:none"
 classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814">
</object>

However, as for basic use, this code will need updating with the correct version number with each update to the package. The code (viewpage) will also need to be updated with each revision to the license. It would be better practice to only have to update the web.config file when the license revision changes. The config handler provides support for this.

Using the Config Handler

The updates by the Nuget package to web.config are:

1. Declare the custom section handler:

<sectionGroup name="meadco">
   <section name="scriptx" 
      type="MeadCo.ScriptX.ScriptXConfigHandler,MeadCo.ScriptXConfigHandler" />
</sectionGroup>

The class MeadCo.ScriptX.ScriptXConfigHandler provides access to the custom config section

2. A config section completed with version and location information:

<meadco>
    <scriptx>
      <clientinstaller filename="~/content/meadco.scriptx/installers/smsx.cab" 
         version="8,3,0,4
"/>
    </scriptx>
 </meadco>

3. A config section completed with code version and location information and license information:

<meadco>
    <scriptx>
      <clientinstaller filename="~/content/meadco.scriptx/installers/smsx.cab" 
         version="8,3,0,4
" />
      <license guid="{YOUR_LICENSE_GUID}" 
                  revision="[YOUR_LICENSE_REVISION]" 
                  filename="~/content/sxlic.mlf" />
    </scriptx>
 </meadco>

Using MeadCo.ScriptX.Configuration

The MeadCo.ScriptX namespace provides a number of classes to simplify access to the 'meadco' confguration section in web.config.

The MeadCo.ScriptX.Configuration class provides two properties to access the code installation and license installation configuration.

1. InstallerConfig MeadCo.ScriptX.Configuration.ClientInstaller

The ClientInstaller object provides the information required to build a codebase string for an object tag:

PropertyDescription
string FileName The name and location of the file to use for installation -- the value of the attribute 'filename'
string Version Returns the required installed version -- the value of the attribute 'version' (if version is in dotted form it will be converted to comma separated form.

The ClientInstaller object can be used to improve the sample code above (MVC, Razor):

<!-- MeadCo ScriptX -->
<object id=factory style="display:none"
  classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814"
  codebase="@Url.Content(Configuration.ClientInstaller.FileName)
            #Version=@Configuration.ClientInstaller.Version" >
</object>

2. LicenseConfig MeadCo.ScriptX.Configuration.License

The License object provides the information required to build the parameters for a Security Manager object to specify the license file.

PropertyDescription
Guid GUID The identifier of the license
int Revision The revision number of the license
string FileName The location and name of the license file (.mlf)
bool PerUser True (default) if the license is to be installed per-user, not for the machine (note that installing for the machine requires administrator access)

The License object can be used to improve the sample code above (MVC, Razor):

<!-- MeadCo Security Manager -->
<object style="display:none"
 classid="clsid:5445be81-b796-11d2-b931-002018654e2e"
 codebase="@Url.Content('~/Content/MeadCo.ScriptX/installers/smsx.cab')
           #Version=@Configuration.ClientInstaller.Version" >
 <param name="GUID" value="@Configuration.License.GUID.ToString()" />
 <param name="Path" value="@Url.Content(Configuration.License.Path)" />
 <param name="Revision" value="@Configuration.License.Revision.ToString()" />
 <param name="PerUser" value="@Configuration.License.PerUser.ToString()" />
</object>

<!-- MeadCo ScriptX -->
<object id="factory" style="display:none"
 classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814">
</object>