INFO: Frequently Asked Questions for CAB Files

ID: Q168941


The information in this article applies to:


SUMMARY

This article covers some of the Frequently Asked Questions (FAQ) about CAB files. For more information, please see the MSDN Web Workshop:

http://msdn.microsoft.com/workshop/default.asp


MORE INFORMATION

Question 1

Why do I receive the error Microsoft JScript runtime error [Line: 15] Object doesn't support this property or method when navigating to a page that contains a CAB file with Internet Explorer 3.02?

Answer

The file Extrac32.exe is not part of the Internet Explorer 3.02 distribution. The new release of the Microsoft virtual machine (Microsoft VM), build 1518, now includes the extrac32.exe utility. This file is required for proper CAB operation in Internet Explorer. If you have previously installed a version of IE 3.x earlier than 3.02 or have installed build 1518 of the Microsoft VM by clicking the "Microsoft virtual machine update" link from http://www.msdn.microsoft.com/java/, Extrac32.exe will be on your system.

Question 2

Where do I get the Code Sign Kit?

Answer

You can find the Code Sign Kit on the Visual J++ CD, the ActiveX SDK, or the Java signing tools in the SDK for Java 2.0x. The ActiveX SDK is available at http://www.msdn.microsoft.com The SDK for Java 2.0x is available at http://www.msdn.microsoft.com/java/.

Question 3

Where can I get the CAB Developers Kit or the CAB Resource Kit and what are they used for?

Answer

The CABDEVKIT has been incorporated into the SDK for Java, which is available at http://www.msdn.microsoft.com and it's also available standalone from http://www.msdn.microsoft.com It will give you all of the tools you need to build cabinets. The latest version includes cabarc.exe, a new tool that makes it easier to create cabinets - directly from the command line.

The CAB Resource Kit will provide the information necessary to help the tool development community understand and work with cabinets. It includes the compression and decompression APIs, documentation on their interfaces, and sample applications using these APIs. Soon, we will add more information on the cabinet file format. The updates provided on January 13, 1997 featured multi-thread and multi-context support, and allow use in MFC- based applications.

Question 4

When programmatically creating a CAB file from a Java application, can I reserve space in a CAB for signing?

Answer

The Java CAB API currently does not support the creation of reserved areas. The command line tools, Cabarc.exe and Diamond.exe support this functionality. The latest versions of the Signcode.exe and Dubuild.exe utilities, which are available in the SDK for Java 2.0x, do not require space to be reserved in the CAB file for a digital signature. It will automatically create space in the CAB when it is signed.

Question 5

Can I sign a Java class file for use with Internet Explorer?

A. Although it is possible to digitally sign a Java class file and verify the signature using the ChkTrust utility, Internet Explorer does not recognize the class as signed and present a certificate to the user at runtime, furthermore, the class is not considered trusted by the Microsoft VM. Presently, you need to place the classes within a CAB file, which can then be signed.

Question 6

Will the Microsoft virtual machine support the JAR file format?

Answer

JAR support is the same as ZIP. JAR = ZIP + manifest. It will support uncompressed and compressed JAR levels 0 and 1, but not signed JAR. If you need Java security (beyond sandbox), on Internet Explorer 4.0 you need to use a signed CAB file. This applies to all fine grained Java security (including running in a sandbox on the local computer using the package manager).

Question 7

Can my applet, which is inside a CAB file, use class files from outside the CAB, which are not installed in the local computer's CLASSPATH?

Answer

Class files from a Web server cannot be used by classes in a CAB file with the Microsoft VM, build 1517 and earlier. With build 2057 of the Microsoft VM, from the SDK for Java 2.0x, you can use classes from outside of CAB file.

Question 8

Why doesn't Internet Explorer display the test certificate from my signed CAB file?

Answer

If you are using a test certificate to sign your cab file, you must enable test certificates for the computer otherwise the signature is not considered valid. You can do this by running Setreg.exe from the SDK for Java 2.x (SDK\BIN\PACKSIGN) as follows:
setreg 1 true
or the Wvtston.reg file included with the code signing kit.

Question 9

When I run signcode.exe on my CAB file, I get the following error:
Unable to sign the program <cabfile>. (80004005)
a. You did not reserve space in your CAB file. Recreate the CAB file using the -s 6144 option to cabarc.exe. This space must be reserved in the CAB file to allow room for the digital signature. Note, it is not necessary to use the -s switch with the signing tools included with the SDK for Java 2.0x. The signcode.exe utility will now create the necessary space for the certificate at the time the CAB is signed.

q2. Unable to sign the program <cabfile>. (80030070)

a. You did not reserve enough space in your CAB file. Recreate the CAB file using the -s 6144 option to cabarc.exe. NOTE: It is not necessary to use the -s switch with the signing tools included with the SDK for Java 2.0x. The signcode.exe utility will now create the necessary space for the certificate at the time the CAB is signed.

q3. Unable to sign the program <cabfile>. (80070005)

a. Your cabfile is marked read-only.

q4. Unable to sign the program <cabfile>. (80070057)

a. Your cabfile is corrupt.

Question 10

When do I use the -s option for cabarc.exe?

Answer

The -s 6144 option reserves unnecessary space in most situations. With the 'test' certificate, you can typically get by with 1K of reserved space in the cab. A good estimate of the space required is slightly larger than the size of the .SPC file you are signing with. Also note, it is possible that the certificate will require more than 6144 bytes.

NOTE: It is not necessary to use the -s switch with the signing tools included with the SDK for Java 2.0x. The signcode.exe utility will now create the necessary space for the certificate at the time the CAB is signed.

Question 11

How do I install a Java package on the user's computer?

Answer

With Internet Explorer 4.x (IE), you can also use DUBuild from the SDK for Java version 2.0x to create a distribution unit, and add the parameters USESLIBRARY, USESLIBRARYCODEBASE, and USESLIBRARYVERSION to your applet tag. The entire process is described at http://www.msdn.microsoft.com With Internet Explorer 3.x, you can use a setup information (.inf) file in a signed CAB to install Java libraries and packages on the local computer. The .inf file defines which files to extract from the CAB and where to place them on the user's system.

There is an example .inf file called Master.inf included in the SDK for Java. Place all the Java libraries and packages in a CAB file (the inner CAB file). In a second signed CAB file, place the unsigned "inner" CAB file and the .inf file. Reference the signed CAB file with an <OBJECT> tag in your HTML page. More information on this process is also available in the SDK for Java documentation.

Question 12

For distributing trusted applets on my intranet, is there a more elegant solution than using a test certificate?

Answer

You can set up an in-house certificate server, using the Microsoft Certificate Server (available as part of Windows NT Option Service Pack 4). Clients would have to be configured to trust that certificate authority, but once that is done they would recognize the in-house certificates as valid certificates. Alternatively, you can relax the security in Internet Explorer by installing the classes on the client computers in the local CLASSPATH or distribute the files in a CAB signed by a valid certificate authority. If you choose to sign using a test certificate, you will need to enable the test root certificate on the client computers by running "setreg 1 true" (Setreg.exe is available from the SDK for Java in the Bin\Packsign directory).

Question 13

Can I include GIF, JPG, or AU files used by my applet in a CAB file?

Answer

Yes, the CAB file serves as a single, compressed repository for all .CLASS, audio and image files required by the applet. When creating the CAB file, be sure to use the -r and -p options to cabarc.exe to recurse and preserve directory structure if any of the files in the CAB are in subdirectories. The cabarc.exe command L can be used to confirm the directory structure was preserved.

Image and audio clips stored in the cab can be retrieved by the applet code via the java.lang.Applet.getImage and java.lang.applet.getAudioClip methods. Note that in order for Internet Explorer to find an image file or audio clip from within the cab file, the URLs passed to these methods must be based upon the applet's codebase. For example, if the following code is found within an applet loaded from a cab file, the image file picture1.gif, and the audio clip sound1.au will be loaded from the cab file (assuming that they are in the cab).

   .
   .
   .

   Image img = getImage(getCodeBase(),"picture1.gif");
   AudioClip clip = getAudioClip(getCodeBase(),"sound1.au");
   .
   .
   . 
NOTE: If an image or audio clip file is not within the cab, then Internet Explorer will look for them on the server.

Question 14

Why doesn't Internet Explorer display the certificate from a signed CAB on some computers?

Answer

The three most common reasons for this behavior are the following:
  1. If the cab file was signed using a test certificate, you must enable test certificates for the local computer otherwise the signature is not considered valid. You can do this by running the wvtston.reg file included with the code signing kit.


  2. You have accepted a software publisher as 'always trusted'. To verify this, in Internet Explorer, go to view.Options.Security.Publishers to ensure the publisher does not appear in the listbox. If so, you can use this dialog box to remove it.


  3. If the client computer is running Microsoft Windows NT, the current user must have administrator privileges or have 'Full Control' access to the following keys: (and existing subkeys)
    
       -HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography
       -HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SystemCertificates
       -HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDlls
       -HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WinTrust 
    These privileges can be granted by a user on the computer who has administrator privileges using regedt32.exe. This requirement will be addressed in future versions of Internet Explorer.

    NOTE: If the certificate does not appear or you answer "no" to the certificate, the applet will still load but will not be trusted.



REFERENCES

For more information, please see the MSDN Web Workshop:

http://msdn.microsoft.com/workshop/default.asp


(c) Microsoft Corporation 1997, All Rights Reserved. Contributions by Rafael M. Munoz, Microsoft Corporation.

Additional query words:


Keywords          : kberrmsg kbnokeyword kbCommandLine kbSDKJava200 kbSDKJava201 kbVJ kbVJ100 kbVJ110 kbSDKJava202 kbDSupport UtilPkg 
Version           : WINDOWS:1.0,1.1,2.0,2.01,2.02
Platform          : WINDOWS 
Issue type        : kbinfo 

Last Reviewed: July 27, 1999