aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Core/Compiler.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/WixToolset.Core/Compiler.cs')
-rw-r--r--src/WixToolset.Core/Compiler.cs48
1 files changed, 44 insertions, 4 deletions
diff --git a/src/WixToolset.Core/Compiler.cs b/src/WixToolset.Core/Compiler.cs
index 0c3d4c9c..cee64911 100644
--- a/src/WixToolset.Core/Compiler.cs
+++ b/src/WixToolset.Core/Compiler.cs
@@ -7878,7 +7878,7 @@ namespace WixToolset.Core
7878 if (patch) 7878 if (patch)
7879 { 7879 {
7880 // /Patch/PatchProperty goes directly into MsiPatchMetadata table 7880 // /Patch/PatchProperty goes directly into MsiPatchMetadata table
7881 this.Core.AddTuple(new MsiPatchMetadataTuple(sourceLineNumbers) 7881 this.Core.AddTuple(new MsiPatchMetadataTuple(sourceLineNumbers, new Identifier(AccessModifier.Public, company, name))
7882 { 7882 {
7883 Company = company, 7883 Company = company,
7884 Property = name, 7884 Property = name,
@@ -8130,12 +8130,15 @@ namespace WixToolset.Core
8130 /// </summary> 8130 /// </summary>
8131 /// <param name="node">The element to parse.</param> 8131 /// <param name="node">The element to parse.</param>
8132 /// <param name="diskId">Media index from parent element.</param> 8132 /// <param name="diskId">Media index from parent element.</param>
8133 private void ParsePatchBaselineElement(XElement node, int diskId) 8133 private void ParsePatchBaselineElement(XElement node, int? diskId)
8134 { 8134 {
8135 var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); 8135 var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node);
8136 Identifier id = null; 8136 Identifier id = null;
8137 var parsedValidate = false; 8137 var parsedValidate = false;
8138 var validationFlags = TransformFlags.PatchTransformDefault; 8138 var validationFlags = TransformFlags.PatchTransformDefault;
8139 string baselineFile = null;
8140 string updateFile = null;
8141 string transformFile = null;
8139 8142
8140 foreach (var attrib in node.Attributes()) 8143 foreach (var attrib in node.Attributes())
8141 { 8144 {
@@ -8146,6 +8149,18 @@ namespace WixToolset.Core
8146 case "Id": 8149 case "Id":
8147 id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib); 8150 id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib);
8148 break; 8151 break;
8152 case "DiskId":
8153 diskId = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 1, Int16.MaxValue);
8154 break;
8155 case "BaselineFile":
8156 baselineFile = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
8157 break;
8158 case "UpdateFile":
8159 updateFile = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
8160 break;
8161 case "TransformFile":
8162 transformFile = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
8163 break;
8149 default: 8164 default:
8150 this.Core.UnexpectedAttribute(node, attrib); 8165 this.Core.UnexpectedAttribute(node, attrib);
8151 break; 8166 break;
@@ -8167,6 +8182,28 @@ namespace WixToolset.Core
8167 this.Core.Write(ErrorMessages.IdentifierTooLongError(sourceLineNumbers, node.Name.LocalName, "Id", id.Id, 27)); 8182 this.Core.Write(ErrorMessages.IdentifierTooLongError(sourceLineNumbers, node.Name.LocalName, "Id", id.Id, 27));
8168 } 8183 }
8169 8184
8185 if (!String.IsNullOrEmpty(baselineFile) || !String.IsNullOrEmpty(updateFile))
8186 {
8187 if (String.IsNullOrEmpty(baselineFile))
8188 {
8189 this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "BaselineFile", "UpdateFile"));
8190 }
8191
8192 if (String.IsNullOrEmpty(updateFile))
8193 {
8194 this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "UpdateFile", "BaselineFile"));
8195 }
8196
8197 if (!String.IsNullOrEmpty(transformFile))
8198 {
8199 this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "TransformFile", !String.IsNullOrEmpty(baselineFile) ? "BaselineFile" : "UpdateFile"));
8200 }
8201 }
8202 else if (String.IsNullOrEmpty(transformFile))
8203 {
8204 this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "BaselineFile", "TransformFile", true));
8205 }
8206
8170 foreach (var child in node.Elements()) 8207 foreach (var child in node.Elements())
8171 { 8208 {
8172 if (CompilerCore.WixNamespace == child.Name.Namespace) 8209 if (CompilerCore.WixNamespace == child.Name.Namespace)
@@ -8200,8 +8237,11 @@ namespace WixToolset.Core
8200 { 8237 {
8201 var tuple = new WixPatchBaselineTuple(sourceLineNumbers, id) 8238 var tuple = new WixPatchBaselineTuple(sourceLineNumbers, id)
8202 { 8239 {
8203 DiskId = diskId, 8240 DiskId = diskId ?? 1,
8204 ValidationFlags = validationFlags 8241 ValidationFlags = validationFlags,
8242 BaselineFile = new IntermediateFieldPathValue { Path = baselineFile },
8243 UpdateFile = new IntermediateFieldPathValue { Path = updateFile },
8244 TransformFile = new IntermediateFieldPathValue { Path = transformFile }
8205 }; 8245 };
8206 8246
8207 this.Core.AddTuple(tuple); 8247 this.Core.AddTuple(tuple);