diff options
author | Bob Arnson <bob@firegiant.com> | 2020-09-30 18:56:06 -0400 |
---|---|---|
committer | Bob Arnson <bob@firegiant.com> | 2020-09-30 19:09:37 -0400 |
commit | 7a7f88c3009ad824852322682cc8cfd3173c2e02 (patch) | |
tree | 98c980444bb1a51297e4eae01171565b02d4ce75 | |
parent | 27124207afa517da564cdce557dd21654f1a9078 (diff) | |
download | wix-7a7f88c3009ad824852322682cc8cfd3173c2e02.tar.gz wix-7a7f88c3009ad824852322682cc8cfd3173c2e02.tar.bz2 wix-7a7f88c3009ad824852322682cc8cfd3173c2e02.zip |
Add error message for cases where inner text used to be used.
-rw-r--r-- | src/WixToolset.Core/Compiler.cs | 6 | ||||
-rw-r--r-- | src/WixToolset.Core/CompilerCore.cs | 9 | ||||
-rw-r--r-- | src/WixToolset.Core/Compiler_2.cs | 18 | ||||
-rw-r--r-- | src/WixToolset.Core/Compiler_EmbeddedUI.cs | 2 | ||||
-rw-r--r-- | src/WixToolset.Core/Compiler_UI.cs | 8 | ||||
-rw-r--r-- | src/test/WixToolsetTest.CoreIntegration/TestData/DialogsInInstallUISequence/PackageComponents.wxs | 14 |
6 files changed, 47 insertions, 10 deletions
diff --git a/src/WixToolset.Core/Compiler.cs b/src/WixToolset.Core/Compiler.cs index 286a598b..d9c60ef6 100644 --- a/src/WixToolset.Core/Compiler.cs +++ b/src/WixToolset.Core/Compiler.cs | |||
@@ -3382,6 +3382,8 @@ namespace WixToolset.Core | |||
3382 | win64 = true; | 3382 | win64 = true; |
3383 | } | 3383 | } |
3384 | 3384 | ||
3385 | this.Core.VerifyNoInnerText(sourceLineNumbers, node); | ||
3386 | |||
3385 | // if we have an in-lined Script CustomAction ensure no source or target attributes were provided | 3387 | // if we have an in-lined Script CustomAction ensure no source or target attributes were provided |
3386 | if (inlineScript) | 3388 | if (inlineScript) |
3387 | { | 3389 | { |
@@ -5349,6 +5351,8 @@ namespace WixToolset.Core | |||
5349 | } | 5351 | } |
5350 | } | 5352 | } |
5351 | 5353 | ||
5354 | this.Core.VerifyNoInnerText(sourceLineNumbers, node); | ||
5355 | |||
5352 | if (CompilerConstants.IntegerNotSet == id) | 5356 | if (CompilerConstants.IntegerNotSet == id) |
5353 | { | 5357 | { |
5354 | this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); | 5358 | this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); |
@@ -7598,7 +7602,7 @@ namespace WixToolset.Core | |||
7598 | } | 7602 | } |
7599 | 7603 | ||
7600 | /// <summary> | 7604 | /// <summary> |
7601 | /// Parses a condition element. | 7605 | /// Parses a Level element. |
7602 | /// </summary> | 7606 | /// </summary> |
7603 | /// <param name="node">Element to parse.</param> | 7607 | /// <param name="node">Element to parse.</param> |
7604 | /// <param name="featureId">Id of the parent Feature element.</param> | 7608 | /// <param name="featureId">Id of the parent Feature element.</param> |
diff --git a/src/WixToolset.Core/CompilerCore.cs b/src/WixToolset.Core/CompilerCore.cs index 8e4f3d89..721eae6b 100644 --- a/src/WixToolset.Core/CompilerCore.cs +++ b/src/WixToolset.Core/CompilerCore.cs | |||
@@ -1086,6 +1086,15 @@ namespace WixToolset.Core | |||
1086 | return this.parseHelper.ScheduleActionSymbol(this.ActiveSection, sourceLineNumbers, access, sequence, actionName, condition, beforeAction, afterAction, overridable); | 1086 | return this.parseHelper.ScheduleActionSymbol(this.ActiveSection, sourceLineNumbers, access, sequence, actionName, condition, beforeAction, afterAction, overridable); |
1087 | } | 1087 | } |
1088 | 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 | |||
1089 | private static string CreateValueList(ValueListKind kind, IEnumerable<string> values) | 1098 | private static string CreateValueList(ValueListKind kind, IEnumerable<string> values) |
1090 | { | 1099 | { |
1091 | // Ideally, we could denote the list kind (and the list itself) directly in the | 1100 | // Ideally, we could denote the list kind (and the list itself) directly in the |
diff --git a/src/WixToolset.Core/Compiler_2.cs b/src/WixToolset.Core/Compiler_2.cs index 204a3788..fbad873e 100644 --- a/src/WixToolset.Core/Compiler_2.cs +++ b/src/WixToolset.Core/Compiler_2.cs | |||
@@ -1211,6 +1211,8 @@ namespace WixToolset.Core | |||
1211 | } | 1211 | } |
1212 | } | 1212 | } |
1213 | 1213 | ||
1214 | this.Core.VerifyNoInnerText(sourceLineNumbers, node); | ||
1215 | |||
1214 | if (null == sddl) | 1216 | if (null == sddl) |
1215 | { | 1217 | { |
1216 | this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Sddl")); | 1218 | this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Sddl")); |
@@ -1499,6 +1501,8 @@ namespace WixToolset.Core | |||
1499 | this.Core.Write(ErrorMessages.CannotAuthorSpecialProperties(sourceLineNumbers, id.Id)); | 1501 | this.Core.Write(ErrorMessages.CannotAuthorSpecialProperties(sourceLineNumbers, id.Id)); |
1500 | } | 1502 | } |
1501 | 1503 | ||
1504 | this.Core.VerifyNoInnerText(sourceLineNumbers, node); | ||
1505 | |||
1502 | if ("ErrorDialog" == id.Id) | 1506 | if ("ErrorDialog" == id.Id) |
1503 | { | 1507 | { |
1504 | this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.Dialog, value); | 1508 | this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.Dialog, value); |
@@ -2043,6 +2047,8 @@ namespace WixToolset.Core | |||
2043 | this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Value")); | 2047 | this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Value")); |
2044 | } | 2048 | } |
2045 | 2049 | ||
2050 | this.Core.VerifyNoInnerText(sourceLineNumbers, node); | ||
2051 | |||
2046 | this.Core.ParseForExtensionElements(node); | 2052 | this.Core.ParseForExtensionElements(node); |
2047 | 2053 | ||
2048 | return (null == value) ? multiStringValue : String.Concat(value, "[~]", multiStringValue); | 2054 | return (null == value) ? multiStringValue : String.Concat(value, "[~]", multiStringValue); |
@@ -2608,6 +2614,8 @@ namespace WixToolset.Core | |||
2608 | } | 2614 | } |
2609 | } | 2615 | } |
2610 | 2616 | ||
2617 | this.Core.VerifyNoInnerText(childSourceLineNumbers, node); | ||
2618 | |||
2611 | if (customAction && "Custom" == actionName) | 2619 | if (customAction && "Custom" == actionName) |
2612 | { | 2620 | { |
2613 | this.Core.Write(ErrorMessages.ExpectedAttribute(childSourceLineNumbers, child.Name.LocalName, "Action")); | 2621 | this.Core.Write(ErrorMessages.ExpectedAttribute(childSourceLineNumbers, child.Name.LocalName, "Action")); |
@@ -3071,6 +3079,8 @@ namespace WixToolset.Core | |||
3071 | } | 3079 | } |
3072 | } | 3080 | } |
3073 | 3081 | ||
3082 | this.Core.VerifyNoInnerText(sourceLineNumbers, node); | ||
3083 | |||
3074 | if (privilege == null) | 3084 | if (privilege == null) |
3075 | { | 3085 | { |
3076 | this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name")); | 3086 | this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name")); |
@@ -3432,6 +3442,8 @@ namespace WixToolset.Core | |||
3432 | } | 3442 | } |
3433 | } | 3443 | } |
3434 | 3444 | ||
3445 | this.Core.VerifyNoInnerText(sourceLineNumbers, node); | ||
3446 | |||
3435 | if (argument == null) | 3447 | if (argument == null) |
3436 | { | 3448 | { |
3437 | this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Value")); | 3449 | this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Value")); |
@@ -3769,6 +3781,8 @@ namespace WixToolset.Core | |||
3769 | } | 3781 | } |
3770 | } | 3782 | } |
3771 | 3783 | ||
3784 | this.Core.VerifyNoInnerText(sourceLineNumbers, node); | ||
3785 | |||
3772 | if (null == id) | 3786 | if (null == id) |
3773 | { | 3787 | { |
3774 | this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); | 3788 | this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); |
@@ -3876,6 +3890,8 @@ namespace WixToolset.Core | |||
3876 | } | 3890 | } |
3877 | } | 3891 | } |
3878 | 3892 | ||
3893 | this.Core.VerifyNoInnerText(sourceLineNumbers, node); | ||
3894 | |||
3879 | if (null == id) | 3895 | if (null == id) |
3880 | { | 3896 | { |
3881 | this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); | 3897 | this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); |
@@ -4353,6 +4369,8 @@ namespace WixToolset.Core | |||
4353 | } | 4369 | } |
4354 | } | 4370 | } |
4355 | 4371 | ||
4372 | this.Core.VerifyNoInnerText(sourceLineNumbers, node); | ||
4373 | |||
4356 | if (String.IsNullOrEmpty(key)) | 4374 | if (String.IsNullOrEmpty(key)) |
4357 | { | 4375 | { |
4358 | this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Key")); | 4376 | this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Key")); |
diff --git a/src/WixToolset.Core/Compiler_EmbeddedUI.cs b/src/WixToolset.Core/Compiler_EmbeddedUI.cs index 4353e3cd..d71bb09a 100644 --- a/src/WixToolset.Core/Compiler_EmbeddedUI.cs +++ b/src/WixToolset.Core/Compiler_EmbeddedUI.cs | |||
@@ -80,6 +80,8 @@ namespace WixToolset.Core | |||
80 | } | 80 | } |
81 | } | 81 | } |
82 | 82 | ||
83 | this.Core.VerifyNoInnerText(sourceLineNumbers, node); | ||
84 | |||
83 | if (null == id) | 85 | if (null == id) |
84 | { | 86 | { |
85 | id = this.Core.CreateIdentifier("mec", source, type.ToString()); | 87 | id = this.Core.CreateIdentifier("mec", source, type.ToString()); |
diff --git a/src/WixToolset.Core/Compiler_UI.cs b/src/WixToolset.Core/Compiler_UI.cs index 9353d966..cb1d34ac 100644 --- a/src/WixToolset.Core/Compiler_UI.cs +++ b/src/WixToolset.Core/Compiler_UI.cs | |||
@@ -700,6 +700,8 @@ namespace WixToolset.Core | |||
700 | this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Action")); | 700 | this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Action")); |
701 | } | 701 | } |
702 | 702 | ||
703 | this.Core.VerifyNoInnerText(sourceLineNumbers, node); | ||
704 | |||
703 | this.Core.ParseForExtensionElements(node); | 705 | this.Core.ParseForExtensionElements(node); |
704 | 706 | ||
705 | if (!this.Core.EncounteredError) | 707 | if (!this.Core.EncounteredError) |
@@ -746,6 +748,8 @@ namespace WixToolset.Core | |||
746 | } | 748 | } |
747 | } | 749 | } |
748 | 750 | ||
751 | this.Core.VerifyNoInnerText(sourceLineNumbers, node); | ||
752 | |||
749 | if (null == id) | 753 | if (null == id) |
750 | { | 754 | { |
751 | id = this.Core.CreateIdentifier("txt", text); | 755 | id = this.Core.CreateIdentifier("txt", text); |
@@ -1422,6 +1426,8 @@ namespace WixToolset.Core | |||
1422 | } | 1426 | } |
1423 | } | 1427 | } |
1424 | 1428 | ||
1429 | this.Core.VerifyNoInnerText(sourceLineNumbers, node); | ||
1430 | |||
1425 | if (!String.IsNullOrEmpty(text) && null != sourceFile) | 1431 | if (!String.IsNullOrEmpty(text) && null != sourceFile) |
1426 | { | 1432 | { |
1427 | this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(childSourceLineNumbers, child.Name.LocalName, "SourceFile", "Value")); | 1433 | this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(childSourceLineNumbers, child.Name.LocalName, "SourceFile", "Value")); |
@@ -1689,6 +1695,8 @@ namespace WixToolset.Core | |||
1689 | } | 1695 | } |
1690 | } | 1696 | } |
1691 | 1697 | ||
1698 | this.Core.VerifyNoInnerText(sourceLineNumbers, node); | ||
1699 | |||
1692 | if (null == control) | 1700 | if (null == control) |
1693 | { | 1701 | { |
1694 | this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Control")); | 1702 | this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Control")); |
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/DialogsInInstallUISequence/PackageComponents.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/DialogsInInstallUISequence/PackageComponents.wxs index 10c8b2c3..ec6e62df 100644 --- a/src/test/WixToolsetTest.CoreIntegration/TestData/DialogsInInstallUISequence/PackageComponents.wxs +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/DialogsInInstallUISequence/PackageComponents.wxs | |||
@@ -1,21 +1,17 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> |
2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
3 | <Fragment> | 2 | <Fragment> |
4 | <UI Id="CustomDialog"> | 3 | <UI Id="CustomDialog"> |
5 | <Dialog Id="FirstDialog" Width="100" Height="100"> | 4 | <Dialog Id="FirstDialog" Width="100" Height="100"> |
6 | <Control Id="Title" Type="Text" X="0" Y="0" Width="90" Height="13" TabSkip="no" Text="FirstDialogTitle" /> | 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" | 6 | <Control Id="Header" Type="Text" X="0" Y="13" Width="90" Height="13" TabSkip="no" Text="FirstDialogHeader" HideCondition="Installed" DisableCondition="Installed" /> |
8 | HideCondition="Installed" DisableCondition="Installed" /> | ||
9 | </Dialog> | 7 | </Dialog> |
10 | <Dialog Id="SecondDialog" Width="100" Height="100"> | 8 | <Dialog Id="SecondDialog" Width="100" Height="100"> |
11 | <Control Id="Title" Type="Text" X="0" Y="0" Width="90" Height="13" TabSkip="no" Text="SecondDialogTitle" /> | 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]" | 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" /> |
13 | ToolTip="Optional checkbox" Help="Check this box for fun" | ||
14 | ShowCondition="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT AND NOT Installed" /> | ||
15 | </Dialog> | 11 | </Dialog> |
16 | 12 | ||
17 | <InstallUISequence> | 13 | <InstallUISequence> |
18 | <Show Dialog="SecondDialog" Before="FirstDialog" Overridable="yes">NOT Installed</Show> | 14 | <Show Dialog="SecondDialog" Before="FirstDialog" Overridable="yes" Condition="NOT Installed" /> |
19 | </InstallUISequence> | 15 | </InstallUISequence> |
20 | </UI> | 16 | </UI> |
21 | </Fragment> | 17 | </Fragment> |
@@ -24,7 +20,7 @@ | |||
24 | <DialogRef Id="FirstDialog" /> | 20 | <DialogRef Id="FirstDialog" /> |
25 | <DialogRef Id="SecondDialog" /> | 21 | <DialogRef Id="SecondDialog" /> |
26 | 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" /> |
28 | 24 | ||
29 | <InstallUISequence> | 25 | <InstallUISequence> |
30 | <Show Dialog="FirstDialog" Before="SecondDialog" Condition="Installed AND PATCH" /> | 26 | <Show Dialog="FirstDialog" Before="SecondDialog" Condition="Installed AND PATCH" /> |