aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/WixToolset.Core/Compile/CompilerPayload.cs42
1 files changed, 25 insertions, 17 deletions
diff --git a/src/WixToolset.Core/Compile/CompilerPayload.cs b/src/WixToolset.Core/Compile/CompilerPayload.cs
index 7a5fd1b2..4c7e843d 100644
--- a/src/WixToolset.Core/Compile/CompilerPayload.cs
+++ b/src/WixToolset.Core/Compile/CompilerPayload.cs
@@ -97,6 +97,26 @@ namespace WixToolset.Core
97 { 97 {
98 this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(this.SourceLineNumbers, this.Element.Name.LocalName, "Hash", "SourceFile")); 98 this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(this.SourceLineNumbers, this.Element.Name.LocalName, "Hash", "SourceFile"));
99 } 99 }
100
101 if (!String.IsNullOrEmpty(this.Description))
102 {
103 this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(this.SourceLineNumbers, this.Element.Name.LocalName, "Description", "SourceFile"));
104 }
105
106 if (!String.IsNullOrEmpty(this.ProductName))
107 {
108 this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(this.SourceLineNumbers, this.Element.Name.LocalName, "ProductName", "SourceFile"));
109 }
110
111 if (this.Size.HasValue)
112 {
113 this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(this.SourceLineNumbers, this.Element.Name.LocalName, "Size", "SourceFile"));
114 }
115
116 if (!String.IsNullOrEmpty(this.Version))
117 {
118 this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(this.SourceLineNumbers, this.Element.Name.LocalName, "Version", "SourceFile"));
119 }
100 } 120 }
101 else 121 else
102 { 122 {
@@ -110,6 +130,11 @@ namespace WixToolset.Core
110 this.Core.Write(ErrorMessages.ExpectedAttribute(this.SourceLineNumbers, this.Element.Name.LocalName, "Name", "Hash")); 130 this.Core.Write(ErrorMessages.ExpectedAttribute(this.SourceLineNumbers, this.Element.Name.LocalName, "Name", "Hash"));
111 } 131 }
112 132
133 if (!this.Size.HasValue)
134 {
135 this.Core.Write(ErrorMessages.ExpectedAttribute(this.SourceLineNumbers, this.Element.Name.LocalName, "Size", "Hash"));
136 }
137
113 if (YesNoDefaultType.Yes == this.Compressed) 138 if (YesNoDefaultType.Yes == this.Compressed)
114 { 139 {
115 this.Core.Write(WarningMessages.RemotePayloadsMustNotAlsoBeCompressed(this.SourceLineNumbers, this.Element.Name.LocalName)); 140 this.Core.Write(WarningMessages.RemotePayloadsMustNotAlsoBeCompressed(this.SourceLineNumbers, this.Element.Name.LocalName));
@@ -117,23 +142,6 @@ namespace WixToolset.Core
117 142
118 this.Compressed = YesNoDefaultType.No; 143 this.Compressed = YesNoDefaultType.No;
119 } 144 }
120
121 VerifyValidValue("Description", !String.IsNullOrEmpty(this.Description));
122 VerifyValidValue("ProductName", !String.IsNullOrEmpty(this.ProductName));
123 VerifyValidValue("Size", this.Size.HasValue);
124 VerifyValidValue("Version", !String.IsNullOrEmpty(this.Version));
125
126 void VerifyValidValue(string attributeName, bool isSpecified)
127 {
128 if (isLocal && isSpecified)
129 {
130 this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(this.SourceLineNumbers, this.Element.Name.LocalName, attributeName, "SourceFile"));
131 }
132 else if (!isLocal && !isSpecified)
133 {
134 this.Core.Write(ErrorMessages.ExpectedAttribute(this.SourceLineNumbers, this.Element.Name.LocalName, attributeName, "Hash"));
135 }
136 }
137 } 145 }
138 } 146 }
139 147