Add error message for cases where inner text used to be used.
Add error message for cases where inner text used to be used.
Bob Arnson committed
Sep 30, 2020 at 18:56 UTC
7a7f88c3009ad824852322682cc8cfd3173c2e02
6 files changed
+47
-10
src/WixToolset.Core/Compiler.cs
+5
-1
@@ -3382,6 +3382,8 @@ namespace WixToolset.Core
3382
win64 = true;
3383
}
3384
3385
+ this.Core.VerifyNoInnerText(sourceLineNumbers, node);
3386
+
3387
// if we have an in-lined Script CustomAction ensure no source or target attributes were provided
3388
if (inlineScript)
3389
{
@@ -5349,6 +5351,8 @@ namespace WixToolset.Core
5351
}
5352
}
5353
5354
+ this.Core.VerifyNoInnerText(sourceLineNumbers, node);
5355
+
5356
if (CompilerConstants.IntegerNotSet == id)
5357
{
5358
this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id"));
@@ -7598,7 +7602,7 @@ namespace WixToolset.Core
7602
}
7603
7604
/// <summary>
7601
- /// Parses a condition element.
7605
+ /// Parses a Level element.
7606
/// </summary>
7607
/// <param name="node">Element to parse.</param>
7608
/// <param name="featureId">Id of the parent Feature element.</param>
src/WixToolset.Core/CompilerCore.cs
+9
@@ -1086,6 +1086,15 @@ namespace WixToolset.Core
1086
return this.parseHelper.ScheduleActionSymbol(this.ActiveSection, sourceLineNumbers, access, sequence, actionName, condition, beforeAction, afterAction, overridable);
1087
}
1088
1089
+ internal void VerifyNoInnerText(SourceLineNumber sourceLineNumbers, XElement element)
1090
+ {
1091
+ var innerText = Common.GetInnerText(element);
1092
+ if (!String.IsNullOrWhiteSpace(innerText))
1093
+ {
1094
+ this.messaging.Write(ErrorMessages.IllegalInnerText(sourceLineNumbers, element.Name.LocalName, innerText));
1095
+ }
1096
+ }
1097
+
1098
private static string CreateValueList(ValueListKind kind, IEnumerable<string> values)
1099
{
1100
// Ideally, we could denote the list kind (and the list itself) directly in the
src/WixToolset.Core/Compiler_2.cs
+18
@@ -1211,6 +1211,8 @@ namespace WixToolset.Core
1211
}
1212
}
1213
1214
+ this.Core.VerifyNoInnerText(sourceLineNumbers, node);
1215
+
1216
if (null == sddl)
1217
{
1218
this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Sddl"));
@@ -1499,6 +1501,8 @@ namespace WixToolset.Core
1501
this.Core.Write(ErrorMessages.CannotAuthorSpecialProperties(sourceLineNumbers, id.Id));
1502
}
1503
1504
+ this.Core.VerifyNoInnerText(sourceLineNumbers, node);
1505
+
1506
if ("ErrorDialog" == id.Id)
1507
{
1508
this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.Dialog, value);
@@ -2043,6 +2047,8 @@ namespace WixToolset.Core
2047
this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Value"));
2048
}
2049
2050
+ this.Core.VerifyNoInnerText(sourceLineNumbers, node);
2051
+
2052
this.Core.ParseForExtensionElements(node);
2053
2054
return (null == value) ? multiStringValue : String.Concat(value, "[~]", multiStringValue);
@@ -2608,6 +2614,8 @@ namespace WixToolset.Core
2614
}
2615
}
2616
2617
+ this.Core.VerifyNoInnerText(childSourceLineNumbers, node);
2618
+
2619
if (customAction && "Custom" == actionName)
2620
{
2621
this.Core.Write(ErrorMessages.ExpectedAttribute(childSourceLineNumbers, child.Name.LocalName, "Action"));
@@ -3071,6 +3079,8 @@ namespace WixToolset.Core
3079
}
3080
}
3081
3082
+ this.Core.VerifyNoInnerText(sourceLineNumbers, node);
3083
+
3084
if (privilege == null)
3085
{
3086
this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name"));
@@ -3432,6 +3442,8 @@ namespace WixToolset.Core
3442
}
3443
}
3444
3445
+ this.Core.VerifyNoInnerText(sourceLineNumbers, node);
3446
+
3447
if (argument == null)
3448
{
3449
this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Value"));
@@ -3769,6 +3781,8 @@ namespace WixToolset.Core
3781
}
3782
}
3783
3784
+ this.Core.VerifyNoInnerText(sourceLineNumbers, node);
3785
+
3786
if (null == id)
3787
{
3788
this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id"));
@@ -3876,6 +3890,8 @@ namespace WixToolset.Core
3890
}
3891
}
3892
3893
+ this.Core.VerifyNoInnerText(sourceLineNumbers, node);
3894
+
3895
if (null == id)
3896
{
3897
this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id"));
@@ -4353,6 +4369,8 @@ namespace WixToolset.Core
4369
}
4370
}
4371
4372
+ this.Core.VerifyNoInnerText(sourceLineNumbers, node);
4373
+
4374
if (String.IsNullOrEmpty(key))
4375
{
4376
this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Key"));
src/WixToolset.Core/Compiler_EmbeddedUI.cs
+2
@@ -80,6 +80,8 @@ namespace WixToolset.Core
80
}
81
}
82
83
+ this.Core.VerifyNoInnerText(sourceLineNumbers, node);
84
+
85
if (null == id)
86
{
87
id = this.Core.CreateIdentifier("mec", source, type.ToString());
src/WixToolset.Core/Compiler_UI.cs
+8
@@ -700,6 +700,8 @@ namespace WixToolset.Core
700
this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Action"));
701
}
702
703
+ this.Core.VerifyNoInnerText(sourceLineNumbers, node);
704
+
705
this.Core.ParseForExtensionElements(node);
706
707
if (!this.Core.EncounteredError)
@@ -746,6 +748,8 @@ namespace WixToolset.Core
748
}
749
}
750
751
+ this.Core.VerifyNoInnerText(sourceLineNumbers, node);
752
+
753
if (null == id)
754
{
755
id = this.Core.CreateIdentifier("txt", text);
@@ -1422,6 +1426,8 @@ namespace WixToolset.Core
1426
}
1427
}
1428
1429
+ this.Core.VerifyNoInnerText(sourceLineNumbers, node);
1430
+
1431
if (!String.IsNullOrEmpty(text) && null != sourceFile)
1432
{
1433
this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(childSourceLineNumbers, child.Name.LocalName, "SourceFile", "Value"));
@@ -1689,6 +1695,8 @@ namespace WixToolset.Core
1695
}
1696
}
1697
1698
+ this.Core.VerifyNoInnerText(sourceLineNumbers, node);
1699
+
1700
if (null == control)
1701
{
1702
this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Control"));
src/test/WixToolsetTest.CoreIntegration/TestData/DialogsInInstallUISequence/PackageComponents.wxs
+5
-9
@@ -1,21 +1,17 @@
1
-<?xml version="1.0" encoding="utf-8"?>
2
-<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
1
+<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
2
<Fragment>
3
<UI Id="CustomDialog">
4
<Dialog Id="FirstDialog" Width="100" Height="100">
5
<Control Id="Title" Type="Text" X="0" Y="0" Width="90" Height="13" TabSkip="no" Text="FirstDialogTitle" />
7
- <Control Id="Header" Type="Text" X="0" Y="13" Width="90" Height="13" TabSkip="no" Text="FirstDialogHeader"
8
- HideCondition="Installed" DisableCondition="Installed" />
6
+ <Control Id="Header" Type="Text" X="0" Y="13" Width="90" Height="13" TabSkip="no" Text="FirstDialogHeader" HideCondition="Installed" DisableCondition="Installed" />
7
</Dialog>
8
<Dialog Id="SecondDialog" Width="100" Height="100">
9
<Control Id="Title" Type="Text" X="0" Y="0" Width="90" Height="13" TabSkip="no" Text="SecondDialogTitle" />
12
- <Control Id="OptionalCheckBox" Type="CheckBox" X="0" Y="13" Width="100" Height="40" Hidden="yes" Property="WIXUI_EXITDIALOGOPTIONALCHECKBOX" CheckBoxValue="1" Text="[WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT]"
13
- ToolTip="Optional checkbox" Help="Check this box for fun"
14
- ShowCondition="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT AND NOT Installed" />
10
+ <Control Id="OptionalCheckBox" Type="CheckBox" X="0" Y="13" Width="100" Height="40" Hidden="yes" Property="WIXUI_EXITDIALOGOPTIONALCHECKBOX" CheckBoxValue="1" Text="[WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT]" ToolTip="Optional checkbox" Help="Check this box for fun" ShowCondition="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT AND NOT Installed" />
11
</Dialog>
12
13
<InstallUISequence>
18
- <Show Dialog="SecondDialog" Before="FirstDialog" Overridable="yes">NOT Installed</Show>
14
+ <Show Dialog="SecondDialog" Before="FirstDialog" Overridable="yes" Condition="NOT Installed" />
15
</InstallUISequence>
16
</UI>
17
</Fragment>
@@ -24,7 +20,7 @@
20
<DialogRef Id="FirstDialog" />
21
<DialogRef Id="SecondDialog" />
22
27
- <Publish Dialog="FirstDialog" Control="Next" Event="NewDialog" Value="SecondDialog">Installed AND PATCH</Publish>
23
+ <Publish Dialog="FirstDialog" Control="Next" Event="NewDialog" Value="SecondDialog" Condition="Installed AND PATCH" />
24
25
<InstallUISequence>
26
<Show Dialog="FirstDialog" Before="SecondDialog" Condition="Installed AND PATCH" />