This problem exists only for multi targeted patches; that is authored to be applied to more than one TargetImages such as the base or RTM and the first patch - SP1 and when Delta (no whole file) patching is used.
The problem might appear to be random since it is based on a complex mathematical calculation which is not required for all delta files.
- Target Vista and later operating systems. Legacy operating systems would require a separate patch created with earlier patch creation resources. Patches created with the earlier resources will also exhibit similar problems on the Vista and later operating systems and is beyond the scope of this article.
- Use whole file patches. The disadvantage would be the patches could be considerably larger.
- Follow the information in the More Information section to manually strip-out, rebuild the cabinet files with the corrected delta files, and insert the cabinet files back into the patch file.
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.
· 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
- Orca, downloadedwith Platform SDK. See http://msdn.microsoft.com/en-us/windows/bb980924
- MSIX.exe download from MSDN blog http://hstewart.members.winisp.net/downloads/msix.zip
- Mpatch from the Platform SDK 7.1 or later. See http://msdn.microsoft.com/en-us/windows/bb980924
- WiStreammsp.vbs instructions from blog http://blogs.msdn.com/b/heaths/archive/2005/09/02/460311.aspx
Raksta ID: 2545078. Pēdējo reizi pārskatīts: 2011. gada 8. aug.. Pārskatījums: 1