@joebigelow / wix / commits / 4fc41544

Don't require Version, ProductName, or Description for remote payloads.

#4865

Sean Hall committed Feb 28, 2021 at 21:06 UTC 4fc415440e64394ef9adafbf802620d73b6dade0
1 file changed +25 -17
src/WixToolset.Core/Compile/CompilerPayload.cs
+25 -17
@@ -97,6 +97,26 @@ namespace WixToolset.Core
97 {
98 this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(this.SourceLineNumbers, this.Element.Name.LocalName, "Hash", "SourceFile"));
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 + }
120 }
121 else
122 {
@@ -110,6 +130,11 @@ namespace WixToolset.Core
130 this.Core.Write(ErrorMessages.ExpectedAttribute(this.SourceLineNumbers, this.Element.Name.LocalName, "Name", "Hash"));
131 }
132
133 + if (!this.Size.HasValue)
134 + {
135 + this.Core.Write(ErrorMessages.ExpectedAttribute(this.SourceLineNumbers, this.Element.Name.LocalName, "Size", "Hash"));
136 + }
137 +
138 if (YesNoDefaultType.Yes == this.Compressed)
139 {
140 this.Core.Write(WarningMessages.RemotePayloadsMustNotAlsoBeCompressed(this.SourceLineNumbers, this.Element.Name.LocalName));
@@ -117,23 +142,6 @@ namespace WixToolset.Core
142
143 this.Compressed = YesNoDefaultType.No;
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 - }
145 }
146 }
147