Get Log/@Extension and Registration/@ProviderKey to match v3.
Sean Hall committed
May 16, 2020 at 18:31 UTC
ad9cdd7dc6faee762e06a8d3446fa68c74dd802d
3 files changed
+18
-4
src/WixToolset.Core.Burn/Bind/BindBundleCommand.cs
+5
-2
@@ -94,7 +94,7 @@ namespace WixToolset.Core.Burn
94
// this behavior.
95
var bundleTuple = this.GetSingleTuple<WixBundleTuple>();
96
97
- bundleTuple.BundleId = Guid.NewGuid().ToString("B").ToUpperInvariant();
97
+ bundleTuple.ProviderKey = bundleTuple.BundleId = Guid.NewGuid().ToString("B").ToUpperInvariant();
98
99
bundleTuple.Attributes |= WixBundleAttributes.PerMachine; // default to per-machine but the first-per user package wil flip the bundle per-user.
100
@@ -376,7 +376,10 @@ namespace WixToolset.Core.Burn
376
var command = new ProcessDependencyProvidersCommand(this.Messaging, section, facades);
377
command.Execute();
378
379
- bundleTuple.ProviderKey = command.BundleProviderKey; // set the overridable bundle provider key.
379
+ if (!String.IsNullOrEmpty(command.BundleProviderKey))
380
+ {
381
+ bundleTuple.ProviderKey = command.BundleProviderKey; // set the overridable bundle provider key.
382
+ }
383
dependencyTuplesByKey = command.DependencyTuplesByKey;
384
}
385
src/WixToolset.Core/Compiler_Bundle.cs
+2
-2
@@ -230,13 +230,13 @@ namespace WixToolset.Core
230
231
if (String.IsNullOrEmpty(name))
232
{
233
- logVariablePrefixAndExtension = String.Concat("WixBundleLog:Setup:.log");
233
+ logVariablePrefixAndExtension = String.Concat("WixBundleLog:Setup:log");
234
}
235
else
236
{
237
// Ensure only allowable path characters are in "name" (and change spaces to underscores).
238
fileSystemSafeBundleName = CompilerCore.MakeValidLongFileName(name.Replace(' ', '_'), "_");
239
- logVariablePrefixAndExtension = String.Concat("WixBundleLog:", fileSystemSafeBundleName, ":.log");
239
+ logVariablePrefixAndExtension = String.Concat("WixBundleLog:", fileSystemSafeBundleName, ":log");
240
}
241
242
this.activeName = String.IsNullOrEmpty(name) ? Common.GenerateGuid() : name;
src/test/WixToolsetTest.CoreIntegration/BundleFixture.cs
+11
@@ -6,6 +6,7 @@ namespace WixToolsetTest.CoreIntegration
6
using System.IO;
7
using System.Linq;
8
using System.Text;
9
+ using System.Xml;
10
using Example.Extension;
11
using WixBuildTools.TestSupport;
12
using WixToolset.Core.TestPackage;
@@ -102,6 +103,16 @@ namespace WixToolsetTest.CoreIntegration
103
var bextManifestData = wixOutput.GetData(BurnConstants.BundleExtensionDataWixOutputStreamName);
104
var extractedBextManifestData = File.ReadAllText(Path.Combine(baFolderPath, "BundleExtensionData.xml"), Encoding.UTF8);
105
Assert.Equal(extractedBextManifestData, bextManifestData);
106
+
107
+ var logElements = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Log");
108
+ var logElement = (XmlNode)Assert.Single(logElements);
109
+ Assert.Equal("<Log PathVariable='WixBundleLog' Prefix='~TestBundle' Extension='log' />", logElement.GetTestXml());
110
+
111
+ var registrationElements = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Registration");
112
+ var registrationElement = (XmlNode)Assert.Single(registrationElements);
113
+ Assert.Equal($"<Registration Id='{bundleTuple.BundleId}' ExecutableName='test.exe' PerMachine='yes' Tag='' Version='1.0.0.0' ProviderKey='{bundleTuple.BundleId}'>" +
114
+ "<Arp Register='yes' DisplayName='~TestBundle' DisplayVersion='1.0.0.0' Publisher='Example Corporation' />" +
115
+ "</Registration>", registrationElement.GetTestXml());
116
}
117
}
118
}