aboutsummaryrefslogtreecommitdiff
path: root/src/wixext/UtilCompiler.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/wixext/UtilCompiler.cs')
-rw-r--r--src/wixext/UtilCompiler.cs50
1 files changed, 35 insertions, 15 deletions
diff --git a/src/wixext/UtilCompiler.cs b/src/wixext/UtilCompiler.cs
index a5745b6c..79dbbc6d 100644
--- a/src/wixext/UtilCompiler.cs
+++ b/src/wixext/UtilCompiler.cs
@@ -235,8 +235,6 @@ namespace WixToolset.Util
235 break; 235 break;
236 case "ComponentSearch": 236 case "ComponentSearch":
237 case "ComponentSearchRef": 237 case "ComponentSearchRef":
238 case "DetectSHA2Support":
239 case "DetectSHA2SupportRef":
240 case "DirectorySearch": 238 case "DirectorySearch":
241 case "DirectorySearchRef": 239 case "DirectorySearchRef":
242 case "FileSearch": 240 case "FileSearch":
@@ -245,6 +243,8 @@ namespace WixToolset.Util
245 case "ProductSearchRef": 243 case "ProductSearchRef":
246 case "RegistrySearch": 244 case "RegistrySearch":
247 case "RegistrySearchRef": 245 case "RegistrySearchRef":
246 case "WindowsFeatureSearch":
247 case "WindowsFeatureSearchRef":
248 // These will eventually be supported under Module/Product, but are not yet. 248 // These will eventually be supported under Module/Product, but are not yet.
249 if (parentElement.Name.LocalName == "Bundle" || parentElement.Name.LocalName == "Fragment") 249 if (parentElement.Name.LocalName == "Bundle" || parentElement.Name.LocalName == "Fragment")
250 { 250 {
@@ -258,12 +258,6 @@ namespace WixToolset.Util
258 case "ComponentSearchRef": 258 case "ComponentSearchRef":
259 this.ParseComponentSearchRefElement(intermediate, section, element); 259 this.ParseComponentSearchRefElement(intermediate, section, element);
260 break; 260 break;
261 case "DetectSHA2Support":
262 this.ParseDetectSHA2SupportElement(intermediate, section, element);
263 break;
264 case "DetectSHA2SupportRef":
265 this.ParseDetectSHA2SupportRefElement(intermediate, section, element);
266 break;
267 case "DirectorySearch": 261 case "DirectorySearch":
268 this.ParseDirectorySearchElement(intermediate, section, element); 262 this.ParseDirectorySearchElement(intermediate, section, element);
269 break; 263 break;
@@ -288,6 +282,12 @@ namespace WixToolset.Util
288 case "RegistrySearchRef": 282 case "RegistrySearchRef":
289 this.ParseWixSearchRefElement(intermediate, section, element); 283 this.ParseWixSearchRefElement(intermediate, section, element);
290 break; 284 break;
285 case "WindowsFeatureSearch":
286 this.ParseWindowsFeatureSearchElement(intermediate, section, element);
287 break;
288 case "WindowsFeatureSearchRef":
289 this.ParseWindowsFeatureSearchRefElement(intermediate, section, element);
290 break;
291 } 291 }
292 } 292 }
293 else 293 else
@@ -508,16 +508,17 @@ namespace WixToolset.Util
508 } 508 }
509 509
510 /// <summary> 510 /// <summary>
511 /// Parses a DetectSHA2Support element. 511 /// Parses a WindowsFeatureSearch element.
512 /// </summary> 512 /// </summary>
513 /// <param name="element">Element to parse.</param> 513 /// <param name="element">Element to parse.</param>
514 private void ParseDetectSHA2SupportElement(Intermediate intermediate, IntermediateSection section, XElement element) 514 private void ParseWindowsFeatureSearchElement(Intermediate intermediate, IntermediateSection section, XElement element)
515 { 515 {
516 var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); 516 var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
517 Identifier id = null; 517 Identifier id = null;
518 string variable = null; 518 string variable = null;
519 string condition = null; 519 string condition = null;
520 string after = null; 520 string after = null;
521 string feature = null;
521 522
522 foreach (var attrib in element.Attributes()) 523 foreach (var attrib in element.Attributes())
523 { 524 {
@@ -531,6 +532,17 @@ namespace WixToolset.Util
531 case "After": 532 case "After":
532 this.ParseCommonSearchAttributes(sourceLineNumbers, attrib, ref id, ref variable, ref condition, ref after); 533 this.ParseCommonSearchAttributes(sourceLineNumbers, attrib, ref id, ref variable, ref condition, ref after);
533 break; 534 break;
535 case "Feature":
536 feature = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
537 switch (feature)
538 {
539 case "sha2CodeSigning":
540 break;
541 default:
542 this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, element.Name.LocalName, "Feature", feature, "sha2CodeSigning"));
543 break;
544 }
545 break;
534 default: 546 default:
535 this.ParseHelper.UnexpectedAttribute(element, attrib); 547 this.ParseHelper.UnexpectedAttribute(element, attrib);
536 break; 548 break;
@@ -544,7 +556,12 @@ namespace WixToolset.Util
544 556
545 if (id == null) 557 if (id == null)
546 { 558 {
547 id = this.ParseHelper.CreateIdentifier("wds2s", variable, condition, after); 559 id = this.ParseHelper.CreateIdentifier("wwfs", variable, condition, after);
560 }
561
562 if (feature == null)
563 {
564 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Feature"));
548 } 565 }
549 566
550 this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element); 567 this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element);
@@ -559,15 +576,18 @@ namespace WixToolset.Util
559 576
560 if (!this.Messaging.EncounteredError) 577 if (!this.Messaging.EncounteredError)
561 { 578 {
562 section.AddSymbol(new WixDetectSHA2SupportSymbol(sourceLineNumbers, id)); 579 section.AddSymbol(new WixWindowsFeatureSearchSymbol(sourceLineNumbers, id)
580 {
581 Type = feature,
582 });
563 } 583 }
564 } 584 }
565 585
566 /// <summary> 586 /// <summary>
567 /// Parses a DetectSHA2SupportRef element 587 /// Parses a WindowsFeatureSearchRef element
568 /// </summary> 588 /// </summary>
569 /// <param name="element">Element to parse.</param> 589 /// <param name="element">Element to parse.</param>
570 private void ParseDetectSHA2SupportRefElement(Intermediate intermediate, IntermediateSection section, XElement element) 590 private void ParseWindowsFeatureSearchRefElement(Intermediate intermediate, IntermediateSection section, XElement element)
571 { 591 {
572 var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); 592 var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
573 593
@@ -579,7 +599,7 @@ namespace WixToolset.Util
579 { 599 {
580 case "Id": 600 case "Id":
581 var refId = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib); 601 var refId = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
582 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, UtilSymbolDefinitions.WixDetectSHA2Support, refId); 602 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, UtilSymbolDefinitions.WixWindowsFeatureSearch, refId);
583 break; 603 break;
584 default: 604 default:
585 this.ParseHelper.UnexpectedAttribute(element, attrib); 605 this.ParseHelper.UnexpectedAttribute(element, attrib);