From ad9cdd7dc6faee762e06a8d3446fa68c74dd802d Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sat, 16 May 2020 18:31:13 +1000 Subject: Get Log/@Extension and Registration/@ProviderKey to match v3. --- src/WixToolset.Core.Burn/Bind/BindBundleCommand.cs | 7 +++++-- src/WixToolset.Core/Compiler_Bundle.cs | 4 ++-- src/test/WixToolsetTest.CoreIntegration/BundleFixture.cs | 11 +++++++++++ 3 files changed, 18 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/WixToolset.Core.Burn/Bind/BindBundleCommand.cs b/src/WixToolset.Core.Burn/Bind/BindBundleCommand.cs index 35c45fad..540c6288 100644 --- a/src/WixToolset.Core.Burn/Bind/BindBundleCommand.cs +++ b/src/WixToolset.Core.Burn/Bind/BindBundleCommand.cs @@ -94,7 +94,7 @@ namespace WixToolset.Core.Burn // this behavior. var bundleTuple = this.GetSingleTuple(); - bundleTuple.BundleId = Guid.NewGuid().ToString("B").ToUpperInvariant(); + bundleTuple.ProviderKey = bundleTuple.BundleId = Guid.NewGuid().ToString("B").ToUpperInvariant(); bundleTuple.Attributes |= WixBundleAttributes.PerMachine; // default to per-machine but the first-per user package wil flip the bundle per-user. @@ -376,7 +376,10 @@ namespace WixToolset.Core.Burn var command = new ProcessDependencyProvidersCommand(this.Messaging, section, facades); command.Execute(); - bundleTuple.ProviderKey = command.BundleProviderKey; // set the overridable bundle provider key. + if (!String.IsNullOrEmpty(command.BundleProviderKey)) + { + bundleTuple.ProviderKey = command.BundleProviderKey; // set the overridable bundle provider key. + } dependencyTuplesByKey = command.DependencyTuplesByKey; } diff --git a/src/WixToolset.Core/Compiler_Bundle.cs b/src/WixToolset.Core/Compiler_Bundle.cs index ee6866b9..c95cb2b4 100644 --- a/src/WixToolset.Core/Compiler_Bundle.cs +++ b/src/WixToolset.Core/Compiler_Bundle.cs @@ -230,13 +230,13 @@ namespace WixToolset.Core if (String.IsNullOrEmpty(name)) { - logVariablePrefixAndExtension = String.Concat("WixBundleLog:Setup:.log"); + logVariablePrefixAndExtension = String.Concat("WixBundleLog:Setup:log"); } else { // Ensure only allowable path characters are in "name" (and change spaces to underscores). fileSystemSafeBundleName = CompilerCore.MakeValidLongFileName(name.Replace(' ', '_'), "_"); - logVariablePrefixAndExtension = String.Concat("WixBundleLog:", fileSystemSafeBundleName, ":.log"); + logVariablePrefixAndExtension = String.Concat("WixBundleLog:", fileSystemSafeBundleName, ":log"); } this.activeName = String.IsNullOrEmpty(name) ? Common.GenerateGuid() : name; diff --git a/src/test/WixToolsetTest.CoreIntegration/BundleFixture.cs b/src/test/WixToolsetTest.CoreIntegration/BundleFixture.cs index acddd2d5..a1896d0d 100644 --- a/src/test/WixToolsetTest.CoreIntegration/BundleFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/BundleFixture.cs @@ -6,6 +6,7 @@ namespace WixToolsetTest.CoreIntegration using System.IO; using System.Linq; using System.Text; + using System.Xml; using Example.Extension; using WixBuildTools.TestSupport; using WixToolset.Core.TestPackage; @@ -102,6 +103,16 @@ namespace WixToolsetTest.CoreIntegration var bextManifestData = wixOutput.GetData(BurnConstants.BundleExtensionDataWixOutputStreamName); var extractedBextManifestData = File.ReadAllText(Path.Combine(baFolderPath, "BundleExtensionData.xml"), Encoding.UTF8); Assert.Equal(extractedBextManifestData, bextManifestData); + + var logElements = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Log"); + var logElement = (XmlNode)Assert.Single(logElements); + Assert.Equal("", logElement.GetTestXml()); + + var registrationElements = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Registration"); + var registrationElement = (XmlNode)Assert.Single(registrationElements); + Assert.Equal($"" + + "" + + "", registrationElement.GetTestXml()); } } } -- cgit v1.2.3-55-g6feb