Steps and tools requested for rebuilding the patch cabinet files using the SDK 7.1 or higher. This is not required if the target operating systems are
Vista and above or if
Whole Files patching is used.
1. Creating a binary patch as usual, typically with the
MSIMSP. See
http://msdn.microsoft.com/en-us/library/aa370324(VS.85).aspx.
2. Open the target MSI file in
Orca – see
http://msdn.microsoft.com/en-us/library/aa370557.aspx. Take note of the
Media table contents.
3. Open the MSP file in the same instance of
Orca.
4. Note the additional row(s) in the
Media table such as
#PCW_CAB_Family00. This is the patch cab file with the
MSP file stream.
5. Extract the cab from the stream using
MsiX available from
http://blogs.msdn.com/b/heaths/archive/2006/04/07/571138.aspx
(Example:
MsiX.exe update1.msp /out c:/Test/MsiX.output/)
6. Rename the file adding to it the extension of
.CAB. Copy the files from the renamed
CAB file using
Windows Explorer.
7. Identify the file(s) to be replaced, those that cannot be read successfully by the legacy operating systems. These files will be rebuilt using following steps.
8. Create the delta with PATCH_OPTION_NO_CHECKSUM using
MPatch from the
Platform SDK 7.1 or later
(Example:
mpatch.exe /dll:MsPatchC.dll /nosyms /nochecksum /mspatcha_winxp <RTMFile.dll> <UpdatedFile.dll> <NewDeltaFile>)
9. Substitute the newly created
<NewDeltaFile>for original unreadable file using the same name. Repeat this process for any other files as needed.
10. Run the
WiStreammsp.vbs to kill the existing MSP streamed cab. Cab names are case sensitive. The contents of
WiStreammsp.vbs is provided later in this
More Information section.
WiStreamMSP.vbs "<Patch File Name.MSP>" -d <Cab Name>
(Example:
WiStreamMSP.vbs "MyPatch.msp" –d PCW_CAB_Family00)
11. If needed establish the present order of the files in the cab using
Cabarc.
cabarc.exe l <Original Cab> > FileOrderList.DDF
12. Open
FileOrderList.DDF in your preferred text editor removing everything except for the file names and add the path.
13. Recreate the CAB using files
MakeCab and the file from the previous step for the
directive file (FileOrderList.DDF).
(Example:
makecab.exe /f FileOrderList.DDF)
14. Rename the resulting .CAB file to the original name which in this case is
PCW_CAB_Family00. Confirm the .
CAB extension has been removed. The name is case sensitive.
15. Run the
WiStreammsp.vbs to add the cab with the same name back into the MSP stream.
(Example:
WiStreamMSP.vbs "MyPatch.msp" PCW_CAB_Family00)
The patch will now contain the corrected files in the cab and is added to the data stream.
Troubleshooting tips:
· The
cab name is
case sensitive.
· Drop the .CAB extension prior to adding the cab to the
MSP data stream
· Check both the original cab file and the recreated cab file with
cabarcor similar tool to confirm the file order is maintained.
· Use the
Orca tool to open and inspect the
MSI and
MSP.
To verify the process of delta creation has worked as expected consider the following test which demonstrates creating deltas for RTM to SP1 and RTM and SP1 to SP2:
Make delta for Patch1 (where d1 is delta1 for patch 1)
Mpatch.exe –NOCHECKSUM b1 b2 d1
Make delta for Patch2 (where d2 is delta2 for patch 2)
Mpatch.exe –NOCHECKSUM b1;b2 b3 d2
Tests the deltas with apatch.exe
- apatch.exe d1 b1 new.dll
- apatch.exe d2 b2 new2.dll
where
new.dll should be the patched base dll plus the delta giving you the same file as b2
where
new2.dll should be the patched base dll or base dll+ patch1 giving you the same file as b3
Tools required: