Use ExePayloadRef for PrimaryPayloadId and SecondaryPayloadId
Fixes 8673
Andrij Abyzov committed
Jun 20, 2024 at 11:46 UTC
95701ccca7e32aba135e497bc5887431607a4292
3 files changed
+57
-5
src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/BalExtensionFixture.cs
+42
-2
@@ -3,10 +3,9 @@
3
namespace WixToolsetTest.BootstrapperApplications
4
{
5
using System;
6
+ using System.Collections.Generic;
7
using System.IO;
8
using System.Linq;
8
- using System.Xml;
9
- using WixToolset.BootstrapperApplications;
9
using WixInternal.Core.TestPackage;
10
using WixInternal.TestSupport;
11
using Xunit;
@@ -51,6 +50,47 @@ namespace WixToolsetTest.BootstrapperApplications
50
}
51
}
52
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]
95
public void CanBuildUsingOverridable()
96
{
src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/TestData/WixStdBa/BootstrapperApplicationId.wxs
new
+12
@@ -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>
src/wix/WixToolset.Core.Burn/Bundles/CreateBurnManifestCommand.cs
+3
-3
@@ -168,11 +168,11 @@ namespace WixToolset.Core.Burn.Bundles
168
// write the UX element
169
writer.WriteStartElement("UX");
170
171
- writer.WriteAttributeString("PrimaryPayloadId", this.PrimaryBundleApplicationSymbol.Id.Id);
171
+ writer.WriteAttributeString("PrimaryPayloadId", this.PrimaryBundleApplicationSymbol.ExePayloadRef);
172
173
- if (!String.IsNullOrEmpty(this.SecondaryBundleApplicationSymbol?.Id.Id))
173
+ if (!String.IsNullOrEmpty(this.SecondaryBundleApplicationSymbol?.ExePayloadRef))
174
{
175
- writer.WriteAttributeString("SecondaryPayloadId", this.SecondaryBundleApplicationSymbol.Id.Id);
175
+ writer.WriteAttributeString("SecondaryPayloadId", this.SecondaryBundleApplicationSymbol.ExePayloadRef);
176
}
177
178
// write the UX allPayloads...