Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Patch applicability does not check all installed product for non-specific patches #4366
The original optimization in patch applicability in mspengine.cpp was to only check all installed products if even 1 patch does not target a specific ProductCode. If all patches target a specific ProductCode, we only check that list.
However, Burn determines which to do based on whether or not any TargetProductCode elements are in the manifest regardless of whether any of the patches are non-specific.
Rather than having Burn check whether any MsiPatch/TargetProduct/TargetProductCode elements are non-specific via XPath, we should do that in the binder. The actual error is in ChainPackageInfo.cs where we check that element. If found, the assumption is that the patch targets a specific ProductCode. however, you also need to check if the Validate attribute is "true" (or maybe there's multiple versions of the XML blob where either is possible, in which case check the latter first then the former). The same assumption is there for the UpgradeCode as well. All the child elements of MsiPatch/TargetProduct have that schema, FWIW.