diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2020-05-16 18:31:13 +1000 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2020-05-16 21:33:56 +1000 |
| commit | ad9cdd7dc6faee762e06a8d3446fa68c74dd802d (patch) | |
| tree | 48bf64bff5de8c4eeb339df42d40b956e9fc8ba4 | |
| parent | 4d96895a19c79ced1543d44e181527824c82c8e8 (diff) | |
| download | wix-ad9cdd7dc6faee762e06a8d3446fa68c74dd802d.tar.gz wix-ad9cdd7dc6faee762e06a8d3446fa68c74dd802d.tar.bz2 wix-ad9cdd7dc6faee762e06a8d3446fa68c74dd802d.zip | |
Get Log/@Extension and Registration/@ProviderKey to match v3.
| -rw-r--r-- | src/WixToolset.Core.Burn/Bind/BindBundleCommand.cs | 7 | ||||
| -rw-r--r-- | src/WixToolset.Core/Compiler_Bundle.cs | 4 | ||||
| -rw-r--r-- | src/test/WixToolsetTest.CoreIntegration/BundleFixture.cs | 11 |
3 files changed, 18 insertions, 4 deletions
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 | |||
| 94 | // this behavior. | 94 | // this behavior. |
| 95 | var bundleTuple = this.GetSingleTuple<WixBundleTuple>(); | 95 | var bundleTuple = this.GetSingleTuple<WixBundleTuple>(); |
| 96 | 96 | ||
| 97 | bundleTuple.BundleId = Guid.NewGuid().ToString("B").ToUpperInvariant(); | 97 | bundleTuple.ProviderKey = bundleTuple.BundleId = Guid.NewGuid().ToString("B").ToUpperInvariant(); |
| 98 | 98 | ||
| 99 | bundleTuple.Attributes |= WixBundleAttributes.PerMachine; // default to per-machine but the first-per user package wil flip the bundle per-user. | 99 | bundleTuple.Attributes |= WixBundleAttributes.PerMachine; // default to per-machine but the first-per user package wil flip the bundle per-user. |
| 100 | 100 | ||
| @@ -376,7 +376,10 @@ namespace WixToolset.Core.Burn | |||
| 376 | var command = new ProcessDependencyProvidersCommand(this.Messaging, section, facades); | 376 | var command = new ProcessDependencyProvidersCommand(this.Messaging, section, facades); |
| 377 | command.Execute(); | 377 | command.Execute(); |
| 378 | 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 | } | ||
| 380 | dependencyTuplesByKey = command.DependencyTuplesByKey; | 383 | dependencyTuplesByKey = command.DependencyTuplesByKey; |
| 381 | } | 384 | } |
| 382 | 385 | ||
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 | |||
| 230 | 230 | ||
| 231 | if (String.IsNullOrEmpty(name)) | 231 | if (String.IsNullOrEmpty(name)) |
| 232 | { | 232 | { |
| 233 | logVariablePrefixAndExtension = String.Concat("WixBundleLog:Setup:.log"); | 233 | logVariablePrefixAndExtension = String.Concat("WixBundleLog:Setup:log"); |
| 234 | } | 234 | } |
| 235 | else | 235 | else |
| 236 | { | 236 | { |
| 237 | // Ensure only allowable path characters are in "name" (and change spaces to underscores). | 237 | // Ensure only allowable path characters are in "name" (and change spaces to underscores). |
| 238 | fileSystemSafeBundleName = CompilerCore.MakeValidLongFileName(name.Replace(' ', '_'), "_"); | 238 | fileSystemSafeBundleName = CompilerCore.MakeValidLongFileName(name.Replace(' ', '_'), "_"); |
| 239 | logVariablePrefixAndExtension = String.Concat("WixBundleLog:", fileSystemSafeBundleName, ":.log"); | 239 | logVariablePrefixAndExtension = String.Concat("WixBundleLog:", fileSystemSafeBundleName, ":log"); |
| 240 | } | 240 | } |
| 241 | 241 | ||
| 242 | this.activeName = String.IsNullOrEmpty(name) ? Common.GenerateGuid() : name; | 242 | 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 | |||
| 6 | using System.IO; | 6 | using System.IO; |
| 7 | using System.Linq; | 7 | using System.Linq; |
| 8 | using System.Text; | 8 | using System.Text; |
| 9 | using System.Xml; | ||
| 9 | using Example.Extension; | 10 | using Example.Extension; |
| 10 | using WixBuildTools.TestSupport; | 11 | using WixBuildTools.TestSupport; |
| 11 | using WixToolset.Core.TestPackage; | 12 | using WixToolset.Core.TestPackage; |
| @@ -102,6 +103,16 @@ namespace WixToolsetTest.CoreIntegration | |||
| 102 | var bextManifestData = wixOutput.GetData(BurnConstants.BundleExtensionDataWixOutputStreamName); | 103 | var bextManifestData = wixOutput.GetData(BurnConstants.BundleExtensionDataWixOutputStreamName); |
| 103 | var extractedBextManifestData = File.ReadAllText(Path.Combine(baFolderPath, "BundleExtensionData.xml"), Encoding.UTF8); | 104 | var extractedBextManifestData = File.ReadAllText(Path.Combine(baFolderPath, "BundleExtensionData.xml"), Encoding.UTF8); |
| 104 | Assert.Equal(extractedBextManifestData, bextManifestData); | 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()); | ||
| 105 | } | 116 | } |
| 106 | } | 117 | } |
| 107 | } | 118 | } |
