aboutsummaryrefslogtreecommitdiff
path: root/src/wixext/BalCompiler.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/wixext/BalCompiler.cs')
-rw-r--r--src/wixext/BalCompiler.cs65
1 files changed, 65 insertions, 0 deletions
diff --git a/src/wixext/BalCompiler.cs b/src/wixext/BalCompiler.cs
index c291d41f..da32234c 100644
--- a/src/wixext/BalCompiler.cs
+++ b/src/wixext/BalCompiler.cs
@@ -46,6 +46,9 @@ namespace WixToolset.Bal
46 case "Condition": 46 case "Condition":
47 this.ParseConditionElement(intermediate, section, element); 47 this.ParseConditionElement(intermediate, section, element);
48 break; 48 break;
49 case "ManagedBootstrapperApplicationPrereqInformation":
50 this.ParseMbaPrereqInfoElement(intermediate, section, element);
51 break;
49 default: 52 default:
50 this.ParseHelper.UnexpectedElement(parentElement, element); 53 this.ParseHelper.UnexpectedElement(parentElement, element);
51 break; 54 break;
@@ -293,6 +296,68 @@ namespace WixToolset.Bal
293 } 296 }
294 297
295 /// <summary> 298 /// <summary>
299 /// Parses a Condition element for Bundles.
300 /// </summary>
301 /// <param name="node">The element to parse.</param>
302 private void ParseMbaPrereqInfoElement(Intermediate intermediate, IntermediateSection section, XElement node)
303 {
304 var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node);
305 string packageId = null;
306 string licenseFile = null;
307 string licenseUrl = null;
308
309 foreach (var attrib in node.Attributes())
310 {
311 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
312 {
313 switch (attrib.Name.LocalName)
314 {
315 case "LicenseFile":
316 licenseFile = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
317 break;
318 case "LicenseUrl":
319 licenseUrl = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
320 break;
321 case "PackageId":
322 packageId = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
323 break;
324 default:
325 this.ParseHelper.UnexpectedAttribute(node, attrib);
326 break;
327 }
328 }
329 else
330 {
331 this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, node, attrib);
332 }
333 }
334
335 this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, node);
336
337 if (null == packageId)
338 {
339 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "PackageId"));
340 }
341
342 if (null == licenseFile && null == licenseUrl ||
343 null != licenseFile && null != licenseUrl)
344 {
345 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "LicenseFile", "LicenseUrl", true));
346 }
347
348 if (!this.Messaging.EncounteredError)
349 {
350 section.AddTuple(new WixMbaPrereqInformationTuple(sourceLineNumbers)
351 {
352 PackageId = packageId,
353 LicenseFile = licenseFile,
354 LicenseUrl = licenseUrl,
355 });
356 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, TupleDefinitions.WixBundlePackage, packageId);
357 }
358 }
359
360 /// <summary>
296 /// Parses a WixStandardBootstrapperApplication element for Bundles. 361 /// Parses a WixStandardBootstrapperApplication element for Bundles.
297 /// </summary> 362 /// </summary>
298 /// <param name="node">The element to parse.</param> 363 /// <param name="node">The element to parse.</param>