From 95701ccca7e32aba135e497bc5887431607a4292 Mon Sep 17 00:00:00 2001 From: Andrij Abyzov Date: Thu, 20 Jun 2024 11:46:16 +0200 Subject: Use ExePayloadRef for PrimaryPayloadId and SecondaryPayloadId Fixes 8673 --- .../BalExtensionFixture.cs | 44 +++++++++++++++++++++- .../WixStdBa/BootstrapperApplicationId.wxs | 12 ++++++ .../Bundles/CreateBurnManifestCommand.cs | 6 +-- 3 files changed, 57 insertions(+), 5 deletions(-) create mode 100644 src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/TestData/WixStdBa/BootstrapperApplicationId.wxs (limited to 'src') 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 @@ namespace WixToolsetTest.BootstrapperApplications { using System; + using System.Collections.Generic; using System.IO; using System.Linq; - using System.Xml; - using WixToolset.BootstrapperApplications; using WixInternal.Core.TestPackage; using WixInternal.TestSupport; using Xunit; @@ -51,6 +50,47 @@ namespace WixToolsetTest.BootstrapperApplications } } + [Fact] + public void CanBuildUsingBootstrapperApplicationId() + { + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(); + var bundleFile = Path.Combine(baseFolder, "bin", "test.exe"); + var bundleSourceFolder = TestData.Get("TestData", "WixStdBa"); + var intermediateFolder = Path.Combine(baseFolder, "obj"); + var baFolderPath = Path.Combine(baseFolder, "ba"); + var extractFolderPath = Path.Combine(baseFolder, "extract"); + + var compileResult = WixRunner.Execute(new[] + { + "build", + Path.Combine(bundleSourceFolder, "BootstrapperApplicationId.wxs"), + "-ext", TestData.Get(@"WixToolset.BootstrapperApplications.wixext.dll"), + "-intermediateFolder", intermediateFolder, + "-bindpath", Path.Combine(bundleSourceFolder, "data"), + "-o", bundleFile, + }); + compileResult.AssertSuccess(); + + Assert.True(File.Exists(bundleFile)); + + var extractResult = BundleExtractor.ExtractBAContainer(null, bundleFile, baFolderPath, extractFolderPath); + extractResult.AssertSuccess(); + + var ignoreAttributesByElementName = new Dictionary> + { + { "Payload", new List { "SourcePath" } }, + }; + + var wixStdBaPayloadInfo = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:UX/burn:Payload[@FilePath='wixstdba.exe']", ignoreAttributesByElementName); + WixAssert.CompareLineByLine(new string[] + { + $@"" + }, wixStdBaPayloadInfo); + } + } + [Fact] public void CanBuildUsingOverridable() { 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 @@ + + + + + + + + + + + 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 // write the UX element writer.WriteStartElement("UX"); - writer.WriteAttributeString("PrimaryPayloadId", this.PrimaryBundleApplicationSymbol.Id.Id); + writer.WriteAttributeString("PrimaryPayloadId", this.PrimaryBundleApplicationSymbol.ExePayloadRef); - if (!String.IsNullOrEmpty(this.SecondaryBundleApplicationSymbol?.Id.Id)) + if (!String.IsNullOrEmpty(this.SecondaryBundleApplicationSymbol?.ExePayloadRef)) { - writer.WriteAttributeString("SecondaryPayloadId", this.SecondaryBundleApplicationSymbol.Id.Id); + writer.WriteAttributeString("SecondaryPayloadId", this.SecondaryBundleApplicationSymbol.ExePayloadRef); } // write the UX allPayloads... -- cgit v1.2.3-55-g6feb