Controlling how MsiPatchSequence is Generated

Heath Stewart

When running on Windows Installer 3.0 and newer, the MsiPatchSequence table dictates how patches apply to a target product install. When using PatchWiz.dll, you can allow this table to be automatically generated, fill it with data yourself, or even prevent it from being generated if you want Windows Installer 2.0 behavior. This means that applicable patches will only be applied in the order specified, among other things.

PatchWiz.dll is used to automatically generate transforms between 1 or more sets of target and upgrade .msi files, store them in an .msp file, and compress all the changed files in a .cab file that is streamed into the .msp file. To do this it uses a .pcp file that is — like .msi, .msm, and .msp files — a structured storage file that contains a set of tables. One of these optional tables is the PatchSequence table.

If the PatchSequence is provided in the .pcp file you must fill it with data according to the schema defined in the table documentation, as well as in the template.pcp in the SamplesSysMgmtMsiPatching directory in the Platform SDK (if the Windows Installer SDK feature is installed). This table is similar in nature to the schema.msi file in the SamplesSysMgmtMsidatabase directory. If you do not fill it with data, an empty MsiPatchSequence table is created by PatchWiz.dll 3.0 or newer in the .msp file. When you attempt to apply that patch, you will see the following error.

MSI (c) (58:14) [16:43:17:498]: Note: 1: 2262 2: MsiPatchSequence 3: -2147287038
MSI (c) (58:14) [16:43:17:498]: PATCH SEQUENCE ERROR: X:Patch.msp patch is missing sequencing info!

Windows Installer error 2262 reads, “Stream does not exist: [2]. System error: [3].” Assign the number fields and the error reads, “Stream does not exist: MsiPatchSequence. System error: -2147287038.” -2147287038 converted to hexadecimal is 0x80030002, which is STG_E_FILENOTFOUND.

You can also allow PatchWiz.dll 3.0 or newer to create the MsiPatchSequence table automatically and fill the table with a single product family. Simply leave the table out of your .pcp file. For more information about how the patch family and sequence number are generated, read Generating Patch Sequence Information in the Windows Installer SDK.

If you don’t want to take advantage of patch sequencing, the MsiPatchSequence table must not be defined in your resultant .msp file. To dictate that PatchWiz.dll 3.0 or newer should not create the table and since an empty PatchSequence table in your .pcp file will ultimately result in error when attempting to apply the patch, you need to define the SEQUENCE_DATA_GENERATION_DISABLED property in the Properties table in your .pcp file with a value of 1.

0 comments

Discussion is closed.

Feedback usabilla icon