SAMPLE: Use DefaultDU.exe to Install Java Classes into the Default Package (235592)



The information in this article applies to:

  • Microsoft virtual machine

This article was previously published under Q235592

SUMMARY

Installing default packages containing only Java classes into the Java Package Manager (JPM) requires special steps. You must first create a package named "default" and include this package in your CAB file. Any classes you put there will be placed into the "default" package in the JPM. DefaultDU.exe illustrates how to install the classes inside a default package into the JPM.

MORE INFORMATION

The following files are available for download from the Microsoft Download Center:
For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:

119591 How to Obtain Microsoft Support Files from Online Services

Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file. The DefaultDU sample contains the following files:
  • DefaultDU.java - A regular Java Applet that imports a package called pack1
  • Pack1 - Contains the following two java files: BtnChk.java and EdtChk.java
  • Default - Contains the DefaultDU.class only
  • DefaultDU.html - HTML page that loads the Applet and installs the CAB
  • DefaultDU.cab - The cabinet file
  • DefaultDU.bat - A batch file for creating cabinet files and code-signing
Use the following steps to use this sample:
  1. Run the DefaultDU.bat file. A Test Certificate will appear when loading the applet for the first time. Select Yes. The applet with a button and an Edit Control appears.
  2. From File Explorer browse to %windir%/DownLoaded Program Files (windir = winnt or windows).
  3. You will see the Friendly Name, DefaultDU, under the Program File column. This shows that the DefaultDU.cab was successfully installed into the JPM. (Refer to DefaultDU.bat and DefaultDU.html to see how the Friendly Name is used.)
  4. Right-click DefaultDU and select Properties.
  5. Click the Dependency tab. Pack1 and the "default" package will install into the JPM under a NameSpace, which in this case is YourNameSpace.(Refer to DefaultDU.bat and DefaultDU.html to see how this NameSpace was used.)
  6. Click the Version tab, and you will see the Version number that was specified when creating the DefaultDU.cab
  7. You will also find a DefaultDU.osd file that gets automatically generated when using DUBUILD to create the CAB. This is how it looks when you view it in a editor, such as Notepad. You need to first extract it using cabarc x defaultdu.cab:
    <?XML version="1.0"?>
    <!DOCTYPE SOFTPKG SYSTEM "http://www.microsoft.com/standards/osd/osd.dtd">
    <?XML::namespace href="http://www.microsoft.com/standards/osd/msicd.dtd" as="MSICD"?>
    
    <SOFTPKG NAME="DefaultDU" VERSION="1,1,1,1">
    <!-- created by DUBuild version 5.00.3167 -->
    
    <TITLE>DefaultDU</TITLE>
    
    <MSICD::JAVA>
    
       <NAMESPACE>YourNameSpace</NAMESPACE>
    
       <PACKAGE NAME="default" VERSION="1,1,1,1">
          <IMPLEMENTATION/>
       </PACKAGE>
    
       <PACKAGE NAME="pack1" VERSION="1,1,1,1">
          <IMPLEMENTATION/>
       </PACKAGE>
    
    </MSICD::JAVA>
    
    </SOFTPKG>
    
    						
  8. The packages (Pack1 and Default) that go under the NameSpace get installed as ZIP files under %windir%/Java/packages, where windir equals winnt or windows. However, it is hard to tell which ZIP file corresponds to these packages.
  9. To find this out, run RegEdit and follow the steps below:
    1. Go to HKEY_LOCAL_MACHINE.
    2. Select Software-Microsoft-Code Store Database.
    3. Select Application NameSpaces-YourNameSpace.
    4. Under Java Packages, click the packages. You will find the corresponding ZIP files that you can then browse to in the %windir%/java/packages.

REFERENCES

For more information on DUBUILD, please refer to the SDK32 For Java documentation available at the following 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 HOWTO: 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:kbdownload kbFAQ kbfile kbhowto kbJava kbSecurity KB235592