aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2020-07-18 14:57:45 -0700
committerRob Mensching <rob@firegiant.com>2020-07-18 15:06:43 -0700
commit901e856ef5c72be5fc7cfb3077e2e60892ddd4cc (patch)
treed87e52a2f085b5bd135d3e4f41c973b0e337f27d /src
parente04caab11fb8f2cac4d575ef1e352221bd421586 (diff)
downloadwix-901e856ef5c72be5fc7cfb3077e2e60892ddd4cc.tar.gz
wix-901e856ef5c72be5fc7cfb3077e2e60892ddd4cc.tar.bz2
wix-901e856ef5c72be5fc7cfb3077e2e60892ddd4cc.zip
Correctly report error when Publish/@Condition='1'
Diffstat (limited to 'src')
-rw-r--r--src/WixToolset.Converters/WixConverter.cs8
-rw-r--r--src/test/WixToolsetTest.Converters/ConditionFixture.cs2
2 files changed, 8 insertions, 2 deletions
diff --git a/src/WixToolset.Converters/WixConverter.cs b/src/WixToolset.Converters/WixConverter.cs
index bfeed03e..3ea0c3dc 100644
--- a/src/WixToolset.Converters/WixConverter.cs
+++ b/src/WixToolset.Converters/WixConverter.cs
@@ -693,7 +693,8 @@ namespace WixToolset.Converters
693 this.ConvertInnerTextToAttribute(element, "Condition"); 693 this.ConvertInnerTextToAttribute(element, "Condition");
694 694
695 var xCondition = element.Attribute("Condition"); 695 var xCondition = element.Attribute("Condition");
696 if (xCondition?.Value == "1") 696 if (xCondition?.Value == "1" &&
697 this.OnError(ConverterTestType.PublishConditionOneUnnecessary, element, "Adding Condition='1' on {0} elements is no longer necessary. Remove the Condition attribute.", xCondition.Name.LocalName))
697 { 698 {
698 xCondition.Remove(); 699 xCondition.Remove();
699 } 700 }
@@ -1207,6 +1208,11 @@ namespace WixToolset.Converters
1207 /// The Feature AllowAdvertise attribute value deprecated. 1208 /// The Feature AllowAdvertise attribute value deprecated.
1208 /// </summary> 1209 /// </summary>
1209 FeatureAllowAdvertiseValueDeprecated, 1210 FeatureAllowAdvertiseValueDeprecated,
1211
1212 /// <summary>
1213 /// The Condition='1' attribute is unnecessary on Publish elements.
1214 /// </summary>
1215 PublishConditionOneUnnecessary
1210 } 1216 }
1211 } 1217 }
1212} 1218}
diff --git a/src/test/WixToolsetTest.Converters/ConditionFixture.cs b/src/test/WixToolsetTest.Converters/ConditionFixture.cs
index 34f99306..d8e5b392 100644
--- a/src/test/WixToolsetTest.Converters/ConditionFixture.cs
+++ b/src/test/WixToolsetTest.Converters/ConditionFixture.cs
@@ -96,7 +96,7 @@ namespace WixToolsetTest.Converters
96 var converter = new WixConverter(messaging, 2, null, null); 96 var converter = new WixConverter(messaging, 2, null, null);
97 97
98 var errors = converter.ConvertDocument(document); 98 var errors = converter.ConvertDocument(document);
99 Assert.Equal(4, errors); 99 Assert.Equal(5, errors);
100 100
101 var actualLines = UnformattedDocumentLines(document); 101 var actualLines = UnformattedDocumentLines(document);
102 CompareLineByLine(expected, actualLines); 102 CompareLineByLine(expected, actualLines);