aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Data/SimpleTupleDefinitionCreator.cs
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2018-12-31 20:45:58 -0800
committerRob Mensching <rob@robmensching.com>2018-12-31 20:49:50 -0800
commit6e7a3274a1710a734e5369d0a1703b9c9ac9345b (patch)
tree943e0b3febbaee9188d2c55e8acb58586a4c7b40 /src/WixToolset.Data/SimpleTupleDefinitionCreator.cs
parent54b23f4c7f63c92c0cc18ccb5a4cacea1991922d (diff)
downloadwix-6e7a3274a1710a734e5369d0a1703b9c9ac9345b.tar.gz
wix-6e7a3274a1710a734e5369d0a1703b9c9ac9345b.tar.bz2
wix-6e7a3274a1710a734e5369d0a1703b9c9ac9345b.zip
Fix loading custom table definitions and support tupledef revisions
Loading multiple intermediates with the same custom table definition would crash when trying to redefine the definition. Now definitions contain a revision and the highest tuple definition is used when loading multiple intermediates.
Diffstat (limited to 'src/WixToolset.Data/SimpleTupleDefinitionCreator.cs')
-rw-r--r--src/WixToolset.Data/SimpleTupleDefinitionCreator.cs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/WixToolset.Data/SimpleTupleDefinitionCreator.cs b/src/WixToolset.Data/SimpleTupleDefinitionCreator.cs
index 6a86639a..257f028c 100644
--- a/src/WixToolset.Data/SimpleTupleDefinitionCreator.cs
+++ b/src/WixToolset.Data/SimpleTupleDefinitionCreator.cs
@@ -1,4 +1,4 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. 1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2 2
3namespace WixToolset.Data 3namespace WixToolset.Data
4{ 4{
@@ -10,7 +10,10 @@ namespace WixToolset.Data
10 10
11 public void AddCustomTupleDefinition(IntermediateTupleDefinition definition) 11 public void AddCustomTupleDefinition(IntermediateTupleDefinition definition)
12 { 12 {
13 this.CustomDefinitionByName.Add(definition.Name, definition); 13 if (!this.CustomDefinitionByName.TryGetValue(definition.Name, out var existing) || definition.Revision > existing.Revision)
14 {
15 this.CustomDefinitionByName[definition.Name] = definition;
16 }
14 } 17 }
15 18
16 public bool TryGetTupleDefinitionByName(string name, out IntermediateTupleDefinition tupleDefinition) 19 public bool TryGetTupleDefinitionByName(string name, out IntermediateTupleDefinition tupleDefinition)