diff --git a/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/BalExtensionFixture.cs b/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/BalExtensionFixture.cs index a9460008c..914b9d48f 100644 --- a/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/BalExtensionFixture.cs +++ b/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/BalExtensionFixture.cs @@ -3,12 +3,14 @@ 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 WixToolset.Core; + using WixToolset.Extensibility.Data; + using WixToolset.Extensibility.Services; using Xunit; public class BalExtensionFixture @@ -51,6 +53,52 @@ public void CanBuildUsingDisplayInternalUICondition() } } +[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 serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider(); + var parseHelper = serviceProvider.GetService(); + var compileContext = serviceProvider.GetService(); + var wixStdBaId = parseHelper.CreateIdentifierValueFromPlatform( "WixStandardBootstrapperApplication", compileContext.Platform, BurnPlatforms.X86 | BurnPlatforms.X64 | BurnPlatforms.ARM64); + + 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 000000000..e1945f538 --- /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 c2e20d822..5955392ef 100644 --- a/src/wix/WixToolset.Core.Burn/Bundles/CreateBurnManifestCommand.cs +++ b/src/wix/WixToolset.Core.Burn/Bundles/CreateBurnManifestCommand.cs @@ -168,11 +168,11 @@ public void Execute() // 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...