From 12db1999ea040ea0b1a51b1dfb5c5f92fc8087c4 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Wed, 10 Feb 2021 16:12:33 -0600 Subject: SlipstreamMsp belongs under the MsiPackage, not the MspPackage. --- .../Bundles/CreateBurnManifestCommand.cs | 2 +- .../WixToolsetTest.CoreIntegration/PatchFixture.cs | 27 ++++++++++++++++++++++ .../TestData/PatchSingle/BundleA/Bundle.wxs | 10 ++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 src/test/WixToolsetTest.CoreIntegration/TestData/PatchSingle/BundleA/Bundle.wxs diff --git a/src/WixToolset.Core.Burn/Bundles/CreateBurnManifestCommand.cs b/src/WixToolset.Core.Burn/Bundles/CreateBurnManifestCommand.cs index d12f00d1..994e02f8 100644 --- a/src/WixToolset.Core.Burn/Bundles/CreateBurnManifestCommand.cs +++ b/src/WixToolset.Core.Burn/Bundles/CreateBurnManifestCommand.cs @@ -332,7 +332,7 @@ namespace WixToolset.Core.Burn.Bundles var msiPropertiesByPackage = this.Section.Symbols.OfType().ToLookup(r => r.PackageRef); var payloadsByPackage = this.Payloads.Values.ToLookup(p => p.PackageRef); var relatedPackagesByPackage = this.Section.Symbols.OfType().ToLookup(r => r.PackageRef); - var slipstreamMspsByPackage = this.Section.Symbols.OfType().ToLookup(r => r.MspPackageRef); + var slipstreamMspsByPackage = this.Section.Symbols.OfType().ToLookup(r => r.TargetPackageRef); var exitCodesByPackage = this.Section.Symbols.OfType().ToLookup(r => r.ChainPackageId); var commandLinesByPackage = this.Section.Symbols.OfType().ToLookup(r => r.WixBundlePackageRef); diff --git a/src/test/WixToolsetTest.CoreIntegration/PatchFixture.cs b/src/test/WixToolsetTest.CoreIntegration/PatchFixture.cs index f1d0ea58..dda4ca28 100644 --- a/src/test/WixToolsetTest.CoreIntegration/PatchFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/PatchFixture.cs @@ -83,6 +83,33 @@ namespace WixToolsetTest.CoreIntegration } } + [Fact] + public void CanBuildBundleWithSlipstreamPatch() + { + var folder = TestData.Get(@"TestData\PatchSingle"); + + using (var fs = new DisposableFileSystem()) + { + var tempFolder = fs.GetFolder(); + + var baselinePdb = BuildMsi("Baseline.msi", folder, tempFolder, "1.0.0", "1.0.0", "1.0.0"); + var update1Pdb = BuildMsi("Update.msi", folder, tempFolder, "1.0.1", "1.0.1", "1.0.1"); + var patchPdb = BuildMsp("Patch1.msp", folder, tempFolder, "1.0.1"); + var bundleAPdb = BuildBundle("BundleA.exe", Path.Combine(folder, "BundleA"), tempFolder); + + using (var wixOutput = WixOutput.Read(bundleAPdb)) + { + var manifestData = wixOutput.GetData(BurnConstants.BurnManifestWixOutputStreamName); + var doc = new XmlDocument(); + doc.LoadXml(manifestData); + var nsmgr = BundleExtractor.GetBurnNamespaceManager(doc, "w"); + var slipstreamMspNodes = doc.SelectNodes("/w:BurnManifest/w:Chain/w:MsiPackage/w:SlipstreamMsp", nsmgr); + Assert.Equal(1, slipstreamMspNodes.Count); + Assert.Equal("", slipstreamMspNodes[0].GetTestXml()); + } + } + } + private static void VerifyPatchTargetCodes(string pdbPath, string[] expected) { using (var wixOutput = WixOutput.Read(pdbPath)) diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/PatchSingle/BundleA/Bundle.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/PatchSingle/BundleA/Bundle.wxs new file mode 100644 index 00000000..bc460636 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/PatchSingle/BundleA/Bundle.wxs @@ -0,0 +1,10 @@ + + + + + + + + + + -- cgit v1.2.3-55-g6feb