diff options
author | Andrij Abyzov <aabyzov@slb.com> | 2024-06-20 11:46:16 +0200 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2024-12-26 12:56:05 -0800 |
commit | 95701ccca7e32aba135e497bc5887431607a4292 (patch) | |
tree | a6c4723ed91475dc0023dabfee0e9c879813cec3 | |
parent | 1f11d0b34d1aea5d27a4e32adcc275f39287d8b6 (diff) | |
download | wix-95701ccca7e32aba135e497bc5887431607a4292.tar.gz wix-95701ccca7e32aba135e497bc5887431607a4292.tar.bz2 wix-95701ccca7e32aba135e497bc5887431607a4292.zip |
Use ExePayloadRef for PrimaryPayloadId and SecondaryPayloadId
Fixes 8673
3 files changed, 57 insertions, 5 deletions
diff --git a/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/BalExtensionFixture.cs b/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/BalExtensionFixture.cs index a9460008..2e21ef90 100644 --- a/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/BalExtensionFixture.cs +++ b/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/BalExtensionFixture.cs | |||
@@ -3,10 +3,9 @@ | |||
3 | namespace WixToolsetTest.BootstrapperApplications | 3 | namespace WixToolsetTest.BootstrapperApplications |
4 | { | 4 | { |
5 | using System; | 5 | using System; |
6 | using System.Collections.Generic; | ||
6 | using System.IO; | 7 | using System.IO; |
7 | using System.Linq; | 8 | using System.Linq; |
8 | using System.Xml; | ||
9 | using WixToolset.BootstrapperApplications; | ||
10 | using WixInternal.Core.TestPackage; | 9 | using WixInternal.Core.TestPackage; |
11 | using WixInternal.TestSupport; | 10 | using WixInternal.TestSupport; |
12 | using Xunit; | 11 | using Xunit; |
@@ -52,6 +51,47 @@ namespace WixToolsetTest.BootstrapperApplications | |||
52 | } | 51 | } |
53 | 52 | ||
54 | [Fact] | 53 | [Fact] |
54 | public void CanBuildUsingBootstrapperApplicationId() | ||
55 | { | ||
56 | using (var fs = new DisposableFileSystem()) | ||
57 | { | ||
58 | var baseFolder = fs.GetFolder(); | ||
59 | var bundleFile = Path.Combine(baseFolder, "bin", "test.exe"); | ||
60 | var bundleSourceFolder = TestData.Get("TestData", "WixStdBa"); | ||
61 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
62 | var baFolderPath = Path.Combine(baseFolder, "ba"); | ||
63 | var extractFolderPath = Path.Combine(baseFolder, "extract"); | ||
64 | |||
65 | var compileResult = WixRunner.Execute(new[] | ||
66 | { | ||
67 | "build", | ||
68 | Path.Combine(bundleSourceFolder, "BootstrapperApplicationId.wxs"), | ||
69 | "-ext", TestData.Get(@"WixToolset.BootstrapperApplications.wixext.dll"), | ||
70 | "-intermediateFolder", intermediateFolder, | ||
71 | "-bindpath", Path.Combine(bundleSourceFolder, "data"), | ||
72 | "-o", bundleFile, | ||
73 | }); | ||
74 | compileResult.AssertSuccess(); | ||
75 | |||
76 | Assert.True(File.Exists(bundleFile)); | ||
77 | |||
78 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundleFile, baFolderPath, extractFolderPath); | ||
79 | extractResult.AssertSuccess(); | ||
80 | |||
81 | var ignoreAttributesByElementName = new Dictionary<string, List<string>> | ||
82 | { | ||
83 | { "Payload", new List<string> { "SourcePath" } }, | ||
84 | }; | ||
85 | |||
86 | var wixStdBaPayloadInfo = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:UX/burn:Payload[@FilePath='wixstdba.exe']", ignoreAttributesByElementName); | ||
87 | WixAssert.CompareLineByLine(new string[] | ||
88 | { | ||
89 | $@"<Payload Id='WixStandardBootstrapperApplication_X86' FilePath='wixstdba.exe' SourcePath='*' />" | ||
90 | }, wixStdBaPayloadInfo); | ||
91 | } | ||
92 | } | ||
93 | |||
94 | [Fact] | ||
55 | public void CanBuildUsingOverridable() | 95 | public void CanBuildUsingOverridable() |
56 | { | 96 | { |
57 | using (var fs = new DisposableFileSystem()) | 97 | using (var fs = new DisposableFileSystem()) |
diff --git a/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/TestData/WixStdBa/BootstrapperApplicationId.wxs b/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/TestData/WixStdBa/BootstrapperApplicationId.wxs new file mode 100644 index 00000000..e1945f53 --- /dev/null +++ b/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/TestData/WixStdBa/BootstrapperApplicationId.wxs | |||
@@ -0,0 +1,12 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" | ||
3 | xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal"> | ||
4 | <Bundle Name="WixStdBa" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="75D5D534-E177-4689-AAE9-CAC1C39002C2"> | ||
5 | <BootstrapperApplication Id="Custom"> | ||
6 | <bal:WixStandardBootstrapperApplication LicenseUrl="http://wixtoolset.org/about/license/" Theme="hyperlinkLicense" /> | ||
7 | </BootstrapperApplication> | ||
8 | <Chain> | ||
9 | <MsiPackage SourceFile="test.msi" /> | ||
10 | </Chain> | ||
11 | </Bundle> | ||
12 | </Wix> | ||
diff --git a/src/wix/WixToolset.Core.Burn/Bundles/CreateBurnManifestCommand.cs b/src/wix/WixToolset.Core.Burn/Bundles/CreateBurnManifestCommand.cs index c2e20d82..5955392e 100644 --- a/src/wix/WixToolset.Core.Burn/Bundles/CreateBurnManifestCommand.cs +++ b/src/wix/WixToolset.Core.Burn/Bundles/CreateBurnManifestCommand.cs | |||
@@ -168,11 +168,11 @@ namespace WixToolset.Core.Burn.Bundles | |||
168 | // write the UX element | 168 | // write the UX element |
169 | writer.WriteStartElement("UX"); | 169 | writer.WriteStartElement("UX"); |
170 | 170 | ||
171 | writer.WriteAttributeString("PrimaryPayloadId", this.PrimaryBundleApplicationSymbol.Id.Id); | 171 | writer.WriteAttributeString("PrimaryPayloadId", this.PrimaryBundleApplicationSymbol.ExePayloadRef); |
172 | 172 | ||
173 | if (!String.IsNullOrEmpty(this.SecondaryBundleApplicationSymbol?.Id.Id)) | 173 | if (!String.IsNullOrEmpty(this.SecondaryBundleApplicationSymbol?.ExePayloadRef)) |
174 | { | 174 | { |
175 | writer.WriteAttributeString("SecondaryPayloadId", this.SecondaryBundleApplicationSymbol.Id.Id); | 175 | writer.WriteAttributeString("SecondaryPayloadId", this.SecondaryBundleApplicationSymbol.ExePayloadRef); |
176 | } | 176 | } |
177 | 177 | ||
178 | // write the UX allPayloads... | 178 | // write the UX allPayloads... |