Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

Delta Patch might fail on Legacy Operating systems with this error - It has probably been updated by other means, and can no longer be modified by this patch.


Symptoms

Installing a second or subsequent patch can result in the error

Error 1328. Error applying patch to file <typically something like 'C:\Config.Msi\PT10.tmp'>. It has probably been updated by other means, and can no longer be modified by this patch. For more information contact your patch vendor. System Error: -1072807676


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.

↑ Back to the top


Cause

An optimization to the delta files was introduced in MSI 5.0 patch creation which cannot be read by the earlier operating systems such as XP or Server 2003. This problem exists only when IncludeWholeFilesOnly is set to zero which include only the changes in files. It is this difference or delta files that cannot be read by the earlier operating systems such as XP or Server 2003.

↑ Back to the top


Resolution

There is presently no fix for this problem.  The workarounds include:
  • 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.

↑ Back to the top


More Information

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:

 

↑ Back to the top


Keywords: kb

↑ Back to the top

Article Info
Article ID : 2545078
Revision : 2
Created on : 4/29/2020
Published on : 4/29/2020
Exists online : False
Views : 104