How To Install a Third Party Package on a User's Computer (245696)



The information in this article applies to:

  • Microsoft Visual J++ 6.0
  • Microsoft SDK for Java 4.0
  • Microsoft SDK for Java 3.0
  • Microsoft SDK for Java 3.0 Preview 1
  • Microsoft SDK for Java 3.1
  • Microsoft SDK for Java 3.2
  • Microsoft virtual machine

This article was previously published under Q245696

SUMMARY

This article illustrates how to install a third party package into the Java Package Manager (JPM) on a user's computer.

MORE INFORMATION

There are two ways to install your code on the local computer:
  • One way is to create a Distribution Unit(DU) using the Dubuild.exe utility in the SDK for Java. This utility creates a CAB file and includes an automatically generated .osd file. Please see the "References" section for more details on DUBUILD.
  • The other method to install code on the local computer is to use an .inf file. This also comes in handy for IE3.0x users.
Each of these methods have the advantage of downloading your code on the first visit to the page, and not requiring another download on subsequent visits unless a newer version becomes available. The methods do however require some permanent space on the user's local drive.

The following steps uses the DUBUILD approach to install the third party classes into the JPM.
  1. If your third party classes are packaged inside a JAR file, the first step would be to uncompress the JAR file to a ZIP file and then extract the zip file contents to a separate folder.
  2. Change to the folder where you have the third party package uncompressed.
  3. Use the following command lines to build your CAB:
    dubuild installcab.cab . /D "Your Friendly Name" /N "Name Space"         /I *.class /V 1,1,1,1
    makecert -sk MyKeyName -n "CN=TestName" MyTestCert.cer
    cert2spc MyTestCert.cer MyTestCert.spc
    signcode -j javasign.dll -jp Low -spc MyTestCert.spc -k MyKeyName installcab.cab
    					
    The following is the HTML file that installs the third party classes into the Java Package Manager(JPM):
    <HTML>
    <APPLET> 
    <PARAM NAME="useslibrary" VALUE="Your Friendly Name">
    <PARAM NAME="namespace" VALUE="Name Space">
    <PARAM NAME="useslibraryversion" VALUE="1,1,1,1">
    <PARAM NAME="useslibrarycodebase" value="installcab.cab">
    </APPLET>
    </HTML>
    					
  4. Once the package is installed on the local computer using JPM, it will be present in the
    %windir%\Downloaded Program Files
    folder. Use this folder to view and remove packages that are installed using Internet Explorer.
NOTE: If for some reasons you don't see the download taking place in the JPM, check the following:
  1. There are no typos in the Friendly Name you specify when using DUBUILD to cab the package.
  2. You are using the same namespace name in the HTML file and in the DUBUILD syntax.
  3. The version information matches in the HTML and in the DUBUILD syntax.
  4. Another issue is when you mark your package as System, then it shouldn't be under a namespace and it should be also signed with Full permissions. If this is the case, either leave the namespace as is but don't specify the /S option when you cab your third party classes using DUBUILD or remove the namespace and leave the /S option. When removing the namespace make sure you remove it from the .htm file also.

REFERENCES

For more information on DUBUILD or CABARC and Code-Signing, please refer to the SDK32 For Java documentation at the following Microsoft Web site: For more information on how to make your java code trusted under Internet Explorer, please refer to the following article in the Microsoft Knowledge Base:

193877 How To Make Your Java Code Trusted in Internet Explorer

For support information about Visual J++ and the SDK for Java, visit the following Microsoft Web site:

Modification Type:MajorLast Reviewed:6/14/2006
Keywords:kbhowto kbSecurity KB245696 kbAudDeveloper