大网数据广告活动
安装更新与部署

Ordering File Sequence Numbers in a Cabinet, File Table and Media Table

· 52CE 我爱测

The File table contains a complete list of all the source files for the installation.

The File table contains a complete list of all the source files for the installation. Files can be stored on the source media as individual files or compressed within cabinet files. The sequence numbers in the Sequence column of the File table, together with the LastSequence field of the Media table, specify both the order of installation for files and the source media on which each file is located. Each record in the Media table identifies the source disk containing all the files with sequence numbers less than or equal to the value shown in the LastSequence column and greater than the LastSequence value of the previous disk.

For example, suppose a file has a sequence number of 92 entered in the Sequence column of the File table. To determine on which source disk this file resides, the installer checks the record of the Media table for the entry with the smallest LastSequence value that is larger than 92. The DiskId column is the primary key for the Media table and this field uniquely identifies the disk in the table.

The maximum limit on the number of files that can be listed in the File table of a Windows Installer package is 32767 files. To create a Windows Installer package containing more files, see Authoring a Large Package.

Package authors can reduce the size of their installation packages by compressing the source files and including them in cabinet files. The source file image can be compressed, uncompressed, or a mixture of both types. For more information about compressed and uncompressed sources see Compressed and Uncompressed Sources. Compressed source files must be stored inside of a cabinet file. The compressed files inside a cabinet have their own internal sequence numbers. The values of these internal sequence numbers do not need to match the value of the sequence numbers within the File table. However, the sequence of the files specified in the File table must be identical to the actual sequence of the files within the cabinets. The sequence numbers of uncompressed files need not be unique. For example, if all the files are uncompressed and reside on one disk, all the files can have the same sequence number in the File table.

The Media table describes the set of disks that make up the source media for the installation. The first entry in the Media table must always have a 1 in the DiskId field. Files should be organized on the source media such that all the files on disk 1 have File table sequence numbers that are smaller than the sequence numbers of files on disk 2, and all of the sequence numbers on disk 2 should be smaller than on disk 3, and so on. This requirement also applies to a disk that contains both compressed and uncompressed sources. For example, if the media sources for the installation are located on two source disks, and if disk 1 contains both uncompressed files and a cabinet file, then both of the uncompressed files and the files in the cabinet must have sequence numbers smaller than the smallest file sequence number of any file stored on disk 2. If all files on disk 1 are compressed in a cabinet file, the Media table could be authored as shown in the following table.

Media Table (partial)

DiskId LastSequence DiskPrompt Cabinet VolumeLabel
1 5 1 mycab.cab Disk 1
2 10 2 Disk 2

If some files on disk 1 are compressed in a cabinet and some are uncompressed, the Media table could be authored as follows.

Media Table (partial)

DiskId LastSequence DiskPrompt Cabinet VolumeLabel
1 5 1 Disk 1
2 10 1 mycab.cab Disk 1
3 15 2 Disk 2

Note that the authoring in the following Media table is incorrect because it specifies some file sequence numbers on disk 2 that are smaller than some files inside the cabinet on disk 1.

Media Table

DiskId LastSequence DiskPrompt Cabinet VolumeLabel
1 5 1 Disk 1
2 10 2 Disk 2
3 15 1 mycab.cab Disk 1

Large files can be split between two or more cabinet files. There can be no more than 15 files in any one cabinet file that spans to the next cabinet file. For example, if you have three cabinet files, the first cabinet can have 15 files that span to the second cabinet file, and the second cabinet can have 15 files that span to the third cabinet file. When you add a record to the File table for a file multiple cabinets, use the first part of the file to specify the file sequence number you enter in the Sequence column.

The File and Media tables could be authored as follows if there are three files, two cabinets, and two disks. In this example, c1.cab resides on disk1 and c2.cab resides on disk2. The file f2 spans both cabinets. The c1.cab cabinet contains the entire f1 file and the first part of file f2. The c2.cab cabinet contains the second part of f2 and the entire f3 file.

Media Table (partial)

DiskId LastSequence DiskPrompt Cabinet VolumeLabel
1 5 1 c1.cab Disk 1
2 10 2 c2.cab Disk 2

File Table (partial)

File Sequence
f1 1
f2 2
f3 6

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 05/31/2018
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。