Deploying formsPlayer

A commercial license for formsPlayer entitles an organisation to distribute formsPlayer to their users, in any way they like--from their own servers, via CD-ROM, and so on. But whichever way is chosen, the technique is the same; an HTML file references a CAB file, which in turn contains formsPlayer. This allows organisations control over everything from the look-and-feel of the installation, to when exactly it should take place.

In the mark-up that follows we'll assume that the CAB file is to be distributed from an intranet server, and that the HTML file is at a different location to the CAB file (hence the need for absolute paths). But the same techniques will work if the HTML and CAB file are in the same directory on the same server, or if they are both in a ZIP file on a CD-ROM.

We'll assume that the CAB file containing the specific version of formsPlayer that needs to be installed, has been copied to this location:

http://intranet/files/formsPlayer1.4.3.1028.cab

Installing formsPlayer

Installation is as simple as creating an HTML page that contains the following:

<head>
  <object width="0" height="0" id="formsPlayer"
   classid="CLSID:4D0ABA11-C5F0-4478-991A-375C4B648F58"
   codebase="http://intranet/files/formsPlayer1.4.3.1028.cab"
  >
    <b>formsPlayer has not been installed.</b>
  </object>
  <?import namespace="xf" implementation="#formsPlayer"?>
  <title>Some XForm</title>
</head>

Using @codebase in this way will cause formsPlayer to be installed if it is not already present on the machine. However, if it has been installed already, it will not be automatically upgraded if the version in the CAB file being referenced is newer; in fact, the CAB file is not referenced at all if formsPlayer was successfully initialised.

Upgrading formsPlayer

To force Internet Explorer to test the version of a current installation of formsPlayer, #Version is added to the CAB file's URL:

<object width="0" height="0" id="formsPlayer"
 classid="CLSID:4D0ABA11-C5F0-4478-991A-375C4B648F58"
 codebase="http://intranet/files/formsPlayer1.4.3.1028.cab#Version=1,4,3,1028"
>
  <b>formsPlayer has not been installed.</b>
</object>

With this combination, a user that doesn't have formsPlayer installed already will have version 1.4.3.1028 installed for them, whilst a user that has a version less than 1.4.3.1028 will be automatically upgraded. Nothing will happen for those that already have 1.4.3.1028 installed, and likewise, nothing will happen if a user obtained a newer version of formsPlayer via another route.

Enforcing a minimum version

The version number needn't be as specific as indicating an exact release of formsPlayer. For example, if we have a form that makes use of some XForms 1.1 features that were introduced in formsPlayer 1.5, we may want to insist on the user having some version of 1.5, but we might not mind which one. This scenario could be handled as follows:

<object width="0" height="0" id="formsPlayer"
 classid="CLSID:4D0ABA11-C5F0-4478-991A-375C4B648F58"
 codebase="http://intranet/files/formsPlayer1.5.1.1001.cab#Version=1,5"
>
  <b>formsPlayer has not been installed.</b>
</object>

As new versions of formsPlayer are placed on the server, the name of the CAB file can be updated, but the value of the Version parameter needn't change:

<object width="0" height="0" id="formsPlayer"
 classid="CLSID:4D0ABA11-C5F0-4478-991A-375C4B648F58"
 codebase="http://intranet/files/formsPlayer1.5.1.1002.cab#Version=1,5">
  <b>formsPlayer has not been installed.</b>
</object>

<object width="0" height="0" id="formsPlayer"
 classid="CLSID:4D0ABA11-C5F0-4478-991A-375C4B648F58"
 codebase="http://intranet/files/formsPlayer1.5.1.1003.cab#Version=1,5">
  <b>formsPlayer has not been installed.</b>
</object>

<object width="0" height="0" id="formsPlayer"
 classid="CLSID:4D0ABA11-C5F0-4478-991A-375C4B648F58"
 codebase="http://intranet/files/formsPlayer1.5.2.1001.cab#Version=1,5">
  <b>formsPlayer has not been installed.</b>
</object>

This has the effect of not upgrading everyone each time a new version of 1.5 is available, but it does ensure that anyone still using 1.4 or 1.3 will be upgraded.