diff options
| -rw-r--r-- | src/WixToolset.Core/Compiler.cs | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/src/WixToolset.Core/Compiler.cs b/src/WixToolset.Core/Compiler.cs index 358f8844..1a9746fc 100644 --- a/src/WixToolset.Core/Compiler.cs +++ b/src/WixToolset.Core/Compiler.cs | |||
| @@ -6277,6 +6277,9 @@ namespace WixToolset.Core | |||
| 6277 | case "MediaTemplate": | 6277 | case "MediaTemplate": |
| 6278 | this.ParseMediaTemplateElement(child, null); | 6278 | this.ParseMediaTemplateElement(child, null); |
| 6279 | break; | 6279 | break; |
| 6280 | case "Launch": | ||
| 6281 | this.ParseLaunchElement(child); | ||
| 6282 | break; | ||
| 6280 | case "PackageGroup": | 6283 | case "PackageGroup": |
| 6281 | this.ParsePackageGroupElement(child); | 6284 | this.ParsePackageGroupElement(child); |
| 6282 | break; | 6285 | break; |
| @@ -6353,6 +6356,61 @@ namespace WixToolset.Core | |||
| 6353 | } | 6356 | } |
| 6354 | } | 6357 | } |
| 6355 | 6358 | ||
| 6359 | /// <summary> | ||
| 6360 | /// Parses a launch condition element. | ||
| 6361 | /// </summary> | ||
| 6362 | /// <param name="node">Element to parse.</param> | ||
| 6363 | private void ParseLaunchElement(XElement node) | ||
| 6364 | { | ||
| 6365 | var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); | ||
| 6366 | string condition = null; | ||
| 6367 | string message = null; | ||
| 6368 | |||
| 6369 | foreach (var attrib in node.Attributes()) | ||
| 6370 | { | ||
| 6371 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || CompilerCore.WixNamespace == attrib.Name.Namespace) | ||
| 6372 | { | ||
| 6373 | switch (attrib.Name.LocalName) | ||
| 6374 | { | ||
| 6375 | case "Cndition": | ||
| 6376 | condition = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
| 6377 | break; | ||
| 6378 | case "Message": | ||
| 6379 | message = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
| 6380 | break; | ||
| 6381 | default: | ||
| 6382 | this.Core.UnexpectedAttribute(node, attrib); | ||
| 6383 | break; | ||
| 6384 | } | ||
| 6385 | } | ||
| 6386 | else | ||
| 6387 | { | ||
| 6388 | this.Core.ParseExtensionAttribute(node, attrib); | ||
| 6389 | } | ||
| 6390 | } | ||
| 6391 | |||
| 6392 | if (String.IsNullOrEmpty(condition)) | ||
| 6393 | { | ||
| 6394 | this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Condition")); | ||
| 6395 | } | ||
| 6396 | |||
| 6397 | if (String.IsNullOrEmpty(message)) | ||
| 6398 | { | ||
| 6399 | this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Message")); | ||
| 6400 | } | ||
| 6401 | |||
| 6402 | |||
| 6403 | this.Core.ParseForExtensionElements(node); | ||
| 6404 | |||
| 6405 | if (!this.Core.EncounteredError) | ||
| 6406 | { | ||
| 6407 | this.Core.AddTuple(new LaunchConditionTuple(sourceLineNumbers) | ||
| 6408 | { | ||
| 6409 | Condition = condition, | ||
| 6410 | Description = message | ||
| 6411 | }); | ||
| 6412 | } | ||
| 6413 | } | ||
| 6356 | 6414 | ||
| 6357 | /// <summary> | 6415 | /// <summary> |
| 6358 | /// Parses a condition element. | 6416 | /// Parses a condition element. |
