diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2021-03-31 13:32:57 -0500 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2021-03-31 13:36:55 -0500 |
| commit | c8d8b48c87254f2b3932f169bd5e2783fb8fb627 (patch) | |
| tree | 3935f1fab34bfcacd98079fb647981fe7563b40e | |
| parent | 87ffd980dc518a7ab40901eeae27b75259ea32b0 (diff) | |
| download | wix-c8d8b48c87254f2b3932f169bd5e2783fb8fb627.tar.gz wix-c8d8b48c87254f2b3932f169bd5e2783fb8fb627.tar.bz2 wix-c8d8b48c87254f2b3932f169bd5e2783fb8fb627.zip | |
Fix regression where PayloadRefs for harvested payloads weren't created
| -rw-r--r-- | src/WixToolset.Core.Burn/Bind/BindBundleCommand.cs | 1 | ||||
| -rw-r--r-- | src/test/WixToolsetTest.CoreIntegration/ContainerFixture.cs | 73 |
2 files changed, 74 insertions, 0 deletions
diff --git a/src/WixToolset.Core.Burn/Bind/BindBundleCommand.cs b/src/WixToolset.Core.Burn/Bind/BindBundleCommand.cs index 4e07d598..ea8d33d0 100644 --- a/src/WixToolset.Core.Burn/Bind/BindBundleCommand.cs +++ b/src/WixToolset.Core.Burn/Bind/BindBundleCommand.cs | |||
| @@ -251,6 +251,7 @@ namespace WixToolset.Core.Burn | |||
| 251 | // Reindex the payloads now that all the payloads (minus the manifest payloads that will be created later) | 251 | // Reindex the payloads now that all the payloads (minus the manifest payloads that will be created later) |
| 252 | // are present. | 252 | // are present. |
| 253 | payloadSymbols = section.Symbols.OfType<WixBundlePayloadSymbol>().ToDictionary(t => t.Id.Id); | 253 | payloadSymbols = section.Symbols.OfType<WixBundlePayloadSymbol>().ToDictionary(t => t.Id.Id); |
| 254 | wixGroupSymbols = this.GetRequiredSymbols<WixGroupSymbol>(); | ||
| 254 | packagesPayloads = RecalculatePackagesPayloads(payloadSymbols, wixGroupSymbols); | 255 | packagesPayloads = RecalculatePackagesPayloads(payloadSymbols, wixGroupSymbols); |
| 255 | 256 | ||
| 256 | // Process the payloads that were added by processing the packages. | 257 | // Process the payloads that were added by processing the packages. |
diff --git a/src/test/WixToolsetTest.CoreIntegration/ContainerFixture.cs b/src/test/WixToolsetTest.CoreIntegration/ContainerFixture.cs index 0799cc24..e3dda59d 100644 --- a/src/test/WixToolsetTest.CoreIntegration/ContainerFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/ContainerFixture.cs | |||
| @@ -6,6 +6,7 @@ namespace WixToolsetTest.CoreIntegration | |||
| 6 | using System.Collections.Generic; | 6 | using System.Collections.Generic; |
| 7 | using System.IO; | 7 | using System.IO; |
| 8 | using System.Linq; | 8 | using System.Linq; |
| 9 | using System.Xml; | ||
| 9 | using WixBuildTools.TestSupport; | 10 | using WixBuildTools.TestSupport; |
| 10 | using WixToolset.Core.TestPackage; | 11 | using WixToolset.Core.TestPackage; |
| 11 | using WixToolset.Data; | 12 | using WixToolset.Data; |
| @@ -82,6 +83,78 @@ namespace WixToolsetTest.CoreIntegration | |||
| 82 | } | 83 | } |
| 83 | } | 84 | } |
| 84 | 85 | ||
| 86 | [Fact] | ||
| 87 | public void HarvestedPayloadsArePutInCorrectPackage() | ||
| 88 | { | ||
| 89 | var folder = TestData.Get(@"TestData"); | ||
| 90 | |||
| 91 | using (var fs = new DisposableFileSystem()) | ||
| 92 | { | ||
| 93 | var baseFolder = fs.GetFolder(); | ||
| 94 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
| 95 | var binFolder = Path.Combine(baseFolder, "bin"); | ||
| 96 | var bundlePath = Path.Combine(binFolder, "test.exe"); | ||
| 97 | var baFolderPath = Path.Combine(baseFolder, "ba"); | ||
| 98 | var extractFolderPath = Path.Combine(baseFolder, "extract"); | ||
| 99 | |||
| 100 | var result = WixRunner.Execute(new[] | ||
| 101 | { | ||
| 102 | "build", | ||
| 103 | Path.Combine(folder, "MsiTransaction", "FirstX86.wxs"), | ||
| 104 | Path.Combine(folder, "ProductWithComponentGroupRef", "MinimalComponentGroup.wxs"), | ||
| 105 | Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"), | ||
| 106 | "-bindpath", Path.Combine(folder, "SingleFile", "data"), | ||
| 107 | "-intermediateFolder", intermediateFolder, | ||
| 108 | "-o", Path.Combine(binFolder, "FirstX86.msi"), | ||
| 109 | }); | ||
| 110 | |||
| 111 | result.AssertSuccess(); | ||
| 112 | |||
| 113 | result = WixRunner.Execute(new[] | ||
| 114 | { | ||
| 115 | "build", | ||
| 116 | Path.Combine(folder, "MsiTransaction", "FirstX64.wxs"), | ||
| 117 | Path.Combine(folder, "ProductWithComponentGroupRef", "MinimalComponentGroup.wxs"), | ||
| 118 | Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"), | ||
| 119 | "-bindpath", Path.Combine(folder, "SingleFile", "data"), | ||
| 120 | "-intermediateFolder", intermediateFolder, | ||
| 121 | "-o", Path.Combine(binFolder, "FirstX64.msi"), | ||
| 122 | }); | ||
| 123 | |||
| 124 | result.AssertSuccess(); | ||
| 125 | |||
| 126 | result = WixRunner.Execute(new[] | ||
| 127 | { | ||
| 128 | "build", | ||
| 129 | Path.Combine(folder, "Container", "HarvestIntoDetachedContainer.wxs"), | ||
| 130 | Path.Combine(folder, "BundleWithPackageGroupRef", "Bundle.wxs"), | ||
| 131 | "-bindpath", Path.Combine(folder, "SimpleBundle", "data"), | ||
| 132 | "-bindpath", binFolder, | ||
| 133 | "-intermediateFolder", intermediateFolder, | ||
| 134 | "-o", bundlePath | ||
| 135 | }); | ||
| 136 | |||
| 137 | result.AssertSuccess(); | ||
| 138 | |||
| 139 | Assert.True(File.Exists(bundlePath)); | ||
| 140 | |||
| 141 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath); | ||
| 142 | extractResult.AssertSuccess(); | ||
| 143 | |||
| 144 | var payloads = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Chain/burn:MsiPackage/burn:PayloadRef") | ||
| 145 | .Cast<XmlElement>() | ||
| 146 | .Select(e => e.GetTestXml()) | ||
| 147 | .ToArray(); | ||
| 148 | WixAssert.CompareLineByLine(new string[] | ||
| 149 | { | ||
| 150 | "<PayloadRef Id='FirstX86.msi' />", | ||
| 151 | "<PayloadRef Id='fk1m38Cf9RZ2Bx_ipinRY6BftelU' />", | ||
| 152 | "<PayloadRef Id='FirstX64.msi' />", | ||
| 153 | "<PayloadRef Id='fC0n41rZK8oW3JK8LzHu6AT3CjdQ' />", | ||
| 154 | }, payloads); | ||
| 155 | } | ||
| 156 | } | ||
| 157 | |||
| 85 | [Fact(Skip = "https://github.com/wixtoolset/issues/issues/6144")] | 158 | [Fact(Skip = "https://github.com/wixtoolset/issues/issues/6144")] |
| 86 | public void MultipleAttachedContainersAreNotCurrentlySupported() | 159 | public void MultipleAttachedContainersAreNotCurrentlySupported() |
| 87 | { | 160 | { |
