Fix error checking on CustomAction/@Error.
Bob Arnson committed
Nov 1, 2019 at 19:24 UTC
34e002b3a9043ff3062c676c74fb124b5feef784
3 files changed
+4
-2
src/WixToolset.Core/Compiler.cs
+2
-2
@@ -3501,9 +3501,9 @@ namespace WixToolset.Core
3501
this.Core.Write(ErrorMessages.IllegalAttributeWithoutOtherAttributes(sourceLineNumbers, node.Name.LocalName, "ExeCommand", "BinaryKey", "Directory", "FileKey", "Property"));
3502
}
3503
}
3504
- else if (CustomActionTargetType.TextData == targetType && CustomActionSourceType.Directory != sourceType && CustomActionSourceType.Property != sourceType)
3504
+ else if (CustomActionTargetType.TextData == targetType && CustomActionSourceType.Directory != sourceType && CustomActionSourceType.Property != sourceType && CustomActionSourceType.File != sourceType)
3505
{
3506
- this.Core.Write(ErrorMessages.IllegalAttributeWithoutOtherAttributes(sourceLineNumbers, node.Name.LocalName, "Value", "Directory", "Property"));
3506
+ this.Core.Write(ErrorMessages.IllegalAttributeWithoutOtherAttributes(sourceLineNumbers, node.Name.LocalName, "Value", "Directory", "Property", "Error"));
3507
}
3508
else if (!String.IsNullOrEmpty(innerText)) // inner text cannot be specified with non-script CAs
3509
{
src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs
+1
@@ -281,6 +281,7 @@ namespace WixToolsetTest.CoreIntegration
281
{
282
"Binary:Binary1\t[Binary data]",
283
"CustomAction:CustomAction1\t1\tBinary1\tInvalidEntryPoint\t",
284
+ "CustomAction:DiscardOptimismAllBeingsWhoProceed\t19\t\tAbandon hope all ye who enter here.\t",
285
}, results);
286
}
287
}
src/test/WixToolsetTest.CoreIntegration/TestData/CustomAction/UnscheduledCustomAction.wxs
+1
@@ -7,5 +7,6 @@
7
8
<Binary Id="Binary1" SourceFile="test.txt"></Binary>
9
<CustomAction Id="CustomAction1" BinaryKey="Binary1" DllEntry="InvalidEntryPoint"></CustomAction>
10
+ <CustomAction Id="DiscardOptimismAllBeingsWhoProceed" Error="Abandon hope all ye who enter here." />
11
</Fragment>
12
</Wix>