CAB trivia


During an internal discussion about .CAB files, someone mentioned that a Windows Mobile CAB can contain upto 998 files. I was curious to know what’s special about the number 998. After some follow up, I found the answer:

If you’ve ever looked at a CAB using utilities like WinZip or WinRAR, you’ll notice that the compressed files inside are stored using 8.3 filenames. The extension is numerically incremented starting from “000”. Therefore, the max number of source files (not including _setup.xml) is 1000, with the highest extension being “999”. However, the “999” extension is reserved for a single setup.dll – if it exists.

So that explains why the 998 file restriction exists. Hopefully no one will run into this, but it’s still nice to know.


Comments (11)

  1. akac says:

    I’ve run into this. I made a CAB for our icon packs that can have 3000 icons. I want them easily installable to a certain directory. I ended up having to make 4 CABs.

  2. MSDNArchive says:

    Yikes…3000 files. Thanks Alex for the reminder that there’s always someone doing something we consider an edge case 🙂

  3. jcopenha says:

    So.. 000 – 999 = 1000 files, – 1 for the specail 999 extension and that leaves us with a total of 999 files not 998..  The 998 is the top file extension, but 999 is the actual number of files =)  Felt like being pedantic.

  4. bstelzel says:

    The limit is actually 998 files. The .000 extension is also reserved. This .000 file is a binary blob that contains similiar information to what is contained in the _setup.xml file. This is needed for compatibility with older versions of the Pocket PC.

    These older versions do not understand the _setup.xml file and will instead use the binary file information to do the installation. This allows the same cab file to be used for both Windows Mobile 5.0 and earlier devices (but please see Scott’s post http://blogs.msdn.com/windowsmobile/archive/2006/04/25/ppc2003_signed_cabs.aspx) describing problems you will hit if the cab is signed.

  5. Sean McLeod says:

    Hmm, I ran into this issue a couple of years ago with a Pocket PC moving map application we developed. We have various layers, e.g. rivers, roads etc. and then each layer is tiled, say into 300x300km tiles.

    We say two symptons, depending on the number of files. The cabwiz would fail to create a cab file and/or would crash. Or it would create the cab file but the installation of the cab file on the Pocket PC would fail.

    It was really frustrating trying to figure out the limits without knowing the real cause and also limiting the size of our tiles we could produce.

    Cheers

  6. Realistic says:

    This is a pretty big oversight for an OS with such potential for future mainstream use.  Edge case?  How about fixing it now instead of the "998 ought to be enough for anybody" attitude?  If not, the users will suffer when unhindered third-party installers become the norm.

  7. JLTate says:

    Well, it seems to me that 998 files SHOULD be enough for anybody.

    I mean, if you really need more than that, you probably oughta compress them into a larger archive. And, well, if you’ve got more than 998 big files (>16kb) the number of files you’re trying to put on the device should be the least of your concern.

    Though, I can imagine mapping software may need lots of big files, but I doubt you’d ever need 998 1MB files on a device intended to fit in your pocket! (can you imagine a 1GB cab file? does the OS even support access to a file that large?)

    But, what would I know. I’ve got less than 2 months of PPC dev under my belt. 🙂

  8. bennie says:

    Thanks heaps. This helped me in a way not related to number of files in cab. See link for information.

  9. satya says:

    can we create cab file without creating *.000 file?

    if YES then

    ##Have u any other method to create cab file without *.000 file?

    if u hv plz send me link,or any mail regarding to this problem……..

  10. Bilbo says:

    Actually, it’s more complicated than that.  Take a look at this thread for more info:

    http://support.ocpsoftware.com/viewtopic.php?t=27

    So you *can* have more than 998 files in a CAB, but you may have to include a setup DLL (according to http://support.ocpsoftware.com/viewtopic.php?p=64#64) to keep WCELOAD from failing.

  11. mat says:

    for goodness, sake you’d think M$ would learn after their 640K debacle.

    Artificial limits in software design are nearly always a bad thing, and when you consider it is in something as central as the primary installation file format, then I really wonder how people at M$ earn their salaries, building in such obvious flaws that require equally hacky workarounds to undo at a later time.

Skip to main content