Top
Interstage Studio J Business Kit User's Guide
FUJITSU Software

2.10 Determining whether JBK Plugin is installed

Provided below is an explanation on how to use Web pages to determine whether JBK Plugin is installed on a client machine.

Using VBScript or JavaScript, you can determine the version number of the JBK Plugin instance on the client machine.

As a result, if the latest version of JBK Plugin is not installed on the client machine, the user of the client machine can be redirected to a Web page prompting download of the installer, when the user opens the relevant Web page in a Web browser.

The following sample script determines whether JBK Plugin is installed on the client machine:

Table 2.5 Sample script for determining whether JBK Plugin is installed
<HTML>
<HEAD>
<TITLE>JBK Plugin Installation Checking Page</TITLE>

<!-- Script for Internet Explorer -->
<SCRIPT LANGUAGE="VBScript">
<!--
    ' Latest JBK Plugin version number
    Const PLG_REQUIRED_VERSION = 9.01
    ' URL of the installer Web page
    Const PLG_INSTALL_URL = "http://foo.fujitsu.com/index.html"

    Dim CurrentVersion
    CurrentVersion = 0.0

    ' Get the version number of the JBK Plugin instance that is installed.
    ' If JBK Plugin is not installed, GetPluginVersion() returns an error,
    ' but because "On Error Resume Next" is specified, processing
    ' continues, with CurrentVersion remaining 0.0.
    On Error Resume Next
    CurrentVersion = GetPluginVersion()

    ' If the latest JBK Plugin version is not installed:
    If CurrentVersion < PLG_REQUIRED_VERSION Then
        ' The user is asked about being redirected to the Web page that explains
        ' the installation procedure.
        Dim Msg1, Msg2
        Msg1 = "You need to install the latest JBK Plugin version."
        Msg2 = "Do you want to go to the Web page explaining the installation
                procedure?"

        Dim ok
        ok = MsgBox (Msg1 + Chr(13) + Msg2, vbOKCancel)

        ' Go to the Web page explaining the installation procedure.
        If ok = vbOK Then
            document.location = PLG_INSTALL_URL
        End If
    End If

    '
    ' This function acquires the version number of the installed JBK Plugin version.
    '
    Function GetPluginVersion
        Const PLG_NAME = "F5CXWPIE.JBKPluginCtrl.1"
        Dim Plugin
        Set Plugin = CreateObject(PLG_NAME)
        GetPluginVersion = Plugin.version
    End Function
-->
</SCRIPT>
</HEAD>

<BODY>
JBK Plugin installation checking
</BODY>
</HTML>

Note

If a tag indicating use of JBK Plugin (<OBJECT> or <EMBED>) is written between <BODY> and </BODY> and JBK Plugin is installed on the client machine, JBK Plugin becomes active regardless of the result of the version check by the script. Write this script in a Web page that does not use any applet.