diff options
author | Bob Arnson <bob@firegiant.com> | 2020-01-06 20:38:12 -0500 |
---|---|---|
committer | Bob Arnson <bob@firegiant.com> | 2020-01-06 20:43:15 -0500 |
commit | 1f57a3f457f60b4a1bfdc76b47f5e14044ec5f2c (patch) | |
tree | 8bb45ccb613c2d3b40981a77b07c1640a54a800d /src | |
parent | 69651a71ff2fdc1e9897b878782d79dcc1f9b896 (diff) | |
download | wix-1f57a3f457f60b4a1bfdc76b47f5e14044ec5f2c.tar.gz wix-1f57a3f457f60b4a1bfdc76b47f5e14044ec5f2c.tar.bz2 wix-1f57a3f457f60b4a1bfdc76b47f5e14044ec5f2c.zip |
Add special handling for numeric Error ids.
Diffstat (limited to 'src')
-rw-r--r-- | src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs | 12 | ||||
-rw-r--r-- | src/WixToolset.Core/Compiler.cs | 1 | ||||
-rw-r--r-- | src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs | 6 |
3 files changed, 15 insertions, 4 deletions
diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs index 75eee3b6..16517e91 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs | |||
@@ -100,6 +100,10 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
100 | this.AddEnvironmentTuple((EnvironmentTuple)tuple, output); | 100 | this.AddEnvironmentTuple((EnvironmentTuple)tuple, output); |
101 | break; | 101 | break; |
102 | 102 | ||
103 | case TupleDefinitionType.Error: | ||
104 | this.AddErrorTuple((ErrorTuple)tuple, output); | ||
105 | break; | ||
106 | |||
103 | case TupleDefinitionType.Feature: | 107 | case TupleDefinitionType.Feature: |
104 | this.AddFeatureTuple((FeatureTuple)tuple, output); | 108 | this.AddFeatureTuple((FeatureTuple)tuple, output); |
105 | break; | 109 | break; |
@@ -488,6 +492,14 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
488 | row[3] = tuple.ComponentRef; | 492 | row[3] = tuple.ComponentRef; |
489 | } | 493 | } |
490 | 494 | ||
495 | private void AddErrorTuple(ErrorTuple tuple, WindowsInstallerData output) | ||
496 | { | ||
497 | var table = output.EnsureTable(this.TableDefinitions["Error"]); | ||
498 | var row = table.CreateRow(tuple.SourceLineNumbers); | ||
499 | row[0] = Convert.ToInt32(tuple.Id.Id); | ||
500 | row[1] = tuple.Message; | ||
501 | } | ||
502 | |||
491 | private void AddFeatureTuple(FeatureTuple tuple, WindowsInstallerData output) | 503 | private void AddFeatureTuple(FeatureTuple tuple, WindowsInstallerData output) |
492 | { | 504 | { |
493 | var attributes = tuple.DisallowAbsent ? WindowsInstallerConstants.MsidbFeatureAttributesUIDisallowAbsent : 0; | 505 | var attributes = tuple.DisallowAbsent ? WindowsInstallerConstants.MsidbFeatureAttributesUIDisallowAbsent : 0; |
diff --git a/src/WixToolset.Core/Compiler.cs b/src/WixToolset.Core/Compiler.cs index 6b9fe59e..63d28e39 100644 --- a/src/WixToolset.Core/Compiler.cs +++ b/src/WixToolset.Core/Compiler.cs | |||
@@ -5299,7 +5299,6 @@ namespace WixToolset.Core | |||
5299 | { | 5299 | { |
5300 | var tuple = new ErrorTuple(sourceLineNumbers, new Identifier(AccessModifier.Public, id)) | 5300 | var tuple = new ErrorTuple(sourceLineNumbers, new Identifier(AccessModifier.Public, id)) |
5301 | { | 5301 | { |
5302 | Error = id, | ||
5303 | Message = Common.GetInnerText(node) | 5302 | Message = Common.GetInnerText(node) |
5304 | }; | 5303 | }; |
5305 | 5304 | ||
diff --git a/src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs b/src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs index a12ad469..75bbccd2 100644 --- a/src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs | |||
@@ -277,9 +277,9 @@ namespace WixToolsetTest.CoreIntegration | |||
277 | var intermediate = Intermediate.Load(Path.Combine(baseFolder, @"bin\test.wixpdb")); | 277 | var intermediate = Intermediate.Load(Path.Combine(baseFolder, @"bin\test.wixpdb")); |
278 | var section = intermediate.Sections.Single(); | 278 | var section = intermediate.Sections.Single(); |
279 | 279 | ||
280 | var errors = section.Tuples.OfType<ErrorTuple>().ToDictionary(t => t.Error); | 280 | var errors = section.Tuples.OfType<ErrorTuple>().ToDictionary(t => t.Id.Id); |
281 | Assert.Equal("Category 55 Emergency Doomsday Crisis", errors[1234].Message.Trim()); | 281 | Assert.Equal("Category 55 Emergency Doomsday Crisis", errors["1234"].Message.Trim()); |
282 | Assert.Equal(" ", errors[5678].Message); | 282 | Assert.Equal(" ", errors["5678"].Message); |
283 | 283 | ||
284 | var customAction1 = section.Tuples.OfType<CustomActionTuple>().Where(t => t.Id.Id == "CanWeReferenceAnError_YesWeCan").Single(); | 284 | var customAction1 = section.Tuples.OfType<CustomActionTuple>().Where(t => t.Id.Id == "CanWeReferenceAnError_YesWeCan").Single(); |
285 | Assert.Equal("1234", customAction1.Target); | 285 | Assert.Equal("1234", customAction1.Target); |