The CAB File Extraction Tool may enter an infinite loop when you try to extract a file that is larger than 2 GB (836160)



The information in this article applies to:

  • Cabinet Software Development Kit (CAB SDK)

SYMPTOMS

When you use the CAB File Extraction Tool (Extract.exe) of the Microsoft Cabinet Software Development Kit (CAB SDK) to try to extract a file that is larger than 2 gigabytes (GB) from a CAB file, the CAB File Extraction Tool may enter an infinite loop.

CAUSE

CAB files have an internal limit on the size of included files. This internal limit is approximately 2 GB. However, the CAB SDK does not enforce this internal limit. Therefore, you can use the CAB SDK to create a CAB file that contains a file that is larger than 2 GB.

This behavior occurs when you try to extract a file that is larger than 2 GB from a CAB file because the CAB File Extraction Tool cannot extract a file that is larger than the 2 GB internal limit.

WORKAROUND

To work around this behavior, split the file that is larger than 2 GB into smaller files, and then include these files in a multi-CAB set. To do this by using the CAB SDK, follow these steps:
  1. Create a directive file (.ddf) in the folder that contains the file that is larger than 2 GB. To do this, use a text editor such as Notepad to create a text file that is named MyDirectiveFile.ddf that contains the following text:
    .Set CabinetNameTemplate=Test*.cab ; Test1.cab, Test2.cab, and so on.
    .Set MaxDiskSize=1.44M	       		
    .Set Cabinet=on
    .Set Compress=on
    C:\Test\Test.txt ; The path of the file that is larger than 2 GB
    .Set DestinationDir=C:\Test
  2. Add the folder that contains the CAB File Extraction Tool and the Advanced CAB File Creation Tool (Makecab.exe) to the path environment variable. To do this, run the following command at a command prompt:

    set path=%path%;FolderPath

    Note FolderPath is a placeholder for the path of the folder that contains the Extract.exe file and the Makecab.exe file.
  3. At a command prompt, switch to the folder that contains the Test.txt file.
  4. Use the Advanced CAB File Creation Tool to create a multi-CAB set for the Test1.txt file. To do this, run the following command at a command prompt:

    Makecab /F MyDirectiveFile.ddf

    Folders that are named disk1, disk2, and so on are created in your current folder. Each folder contains a CAB file.
  5. Use the CAB File Extraction Tool to extract the Test.txt file. To do this, run the following command at the command prompt:

    Extract /A disk1\Test1.cab /L Test1 Test.txt

    After some time, you receive the following message in the command prompt window: Extracting Test1\Test.txt
    Extract needs cabinet file 'Test2.cab' from 'Disk 2'.
    Please enter the path where this file may be
    found, and press ENTER:
  6. Type the path of the disk2 folder, and then press ENTER. After some time, you receive a message that is similar to the message that you received in step 5.

    This new message prompts you to provide the path of the next CAB file that is part of the multi-CAB set.
  7. Type the path of the next CAB file in the multi-CAB set, and then press ENTER.

    After some time, you receive a message that is similar to the message that you received in step 6.
  8. Repeat step 7 until you have extracted all the CAB files in the multi-CAB set.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to reproduce the behavior

  1. Create a folder in the root folder of drive C on your computer. Name the folder Test.
  2. In the Test folder, create a text file that is larger than 2 GB. Name the file Test.txt.
  3. Use the Advanced CAB File Creation Tool to create a CAB file for the Test.txt file. To do this, follow these steps:
    1. At a command prompt, switch to the C:\Test folder.
    2. Run the following command to create a CAB file for the Test.txt file:

      Makecab Test.txt TestCAB.cab

  4. Use the CAB File Extraction Tool to try to extract the Test.txt file from the TestCAB.cab CAB file. To do this, follow these steps:
    1. At a command prompt, run the following command:

      Extract TestCAB.cab Test.txt

      You receive the following message in the command prompt window: Extracting Test.txt -> Test.txt
      Extract needs cabinet file '' from ''.
      Please enter the path where this file may be
      found, and press ENTER:
    2. Type the path of the folder that contains the TestCAB.cab CAB file, and then press ENTER. You receive the following message: ERROR: Could not find cabinet file C:\Test
      Extract needs cabinet file '' from ''.
      Please enter the path where this file may be
      found, and press ENTER: If you provide the path again, you receive this message again. This behavior is an infinite loop.

REFERENCES

For additional information, click the following article numbers to view the articles in the Microsoft Knowledge Base:

168941 INFO: Frequently asked questions about CAB files

310618 Microsoft Cabinet Software Development Kit


Modification Type:MajorLast Reviewed:3/17/2004
Keywords:kbSDK kbMiscTools kbfile kbCAB kbprb KB836160 kbAudDeveloper