aboutsummaryrefslogtreecommitdiff
path: root/src/wixext
diff options
context:
space:
mode:
Diffstat (limited to 'src/wixext')
-rw-r--r--src/wixext/Symbols/UtilSymbolDefinitions.cs10
-rw-r--r--src/wixext/Symbols/WixDetectSHA2SupportSymbol.cs33
-rw-r--r--src/wixext/Symbols/WixWindowsFeatureSearchSymbol.cs47
-rw-r--r--src/wixext/UtilCompiler.cs50
-rw-r--r--src/wixext/util.xsd62
5 files changed, 125 insertions, 77 deletions
diff --git a/src/wixext/Symbols/UtilSymbolDefinitions.cs b/src/wixext/Symbols/UtilSymbolDefinitions.cs
index ae9c4c81..5f062676 100644
--- a/src/wixext/Symbols/UtilSymbolDefinitions.cs
+++ b/src/wixext/Symbols/UtilSymbolDefinitions.cs
@@ -20,12 +20,12 @@ namespace WixToolset.Util
20 User, 20 User,
21 UserGroup, 21 UserGroup,
22 WixCloseApplication, 22 WixCloseApplication,
23 WixDetectSHA2Support,
24 WixFormatFiles, 23 WixFormatFiles,
25 WixInternetShortcut, 24 WixInternetShortcut,
26 WixRemoveFolderEx, 25 WixRemoveFolderEx,
27 WixRestartResource, 26 WixRestartResource,
28 WixTouchFile, 27 WixTouchFile,
28 WixWindowsFeatureSearch,
29 XmlConfig, 29 XmlConfig,
30 XmlFile, 30 XmlFile,
31 } 31 }
@@ -84,9 +84,6 @@ namespace WixToolset.Util
84 case UtilSymbolDefinitionType.WixCloseApplication: 84 case UtilSymbolDefinitionType.WixCloseApplication:
85 return UtilSymbolDefinitions.WixCloseApplication; 85 return UtilSymbolDefinitions.WixCloseApplication;
86 86
87 case UtilSymbolDefinitionType.WixDetectSHA2Support:
88 return UtilSymbolDefinitions.WixDetectSHA2Support;
89
90 case UtilSymbolDefinitionType.WixFormatFiles: 87 case UtilSymbolDefinitionType.WixFormatFiles:
91 return UtilSymbolDefinitions.WixFormatFiles; 88 return UtilSymbolDefinitions.WixFormatFiles;
92 89
@@ -102,6 +99,9 @@ namespace WixToolset.Util
102 case UtilSymbolDefinitionType.WixTouchFile: 99 case UtilSymbolDefinitionType.WixTouchFile:
103 return UtilSymbolDefinitions.WixTouchFile; 100 return UtilSymbolDefinitions.WixTouchFile;
104 101
102 case UtilSymbolDefinitionType.WixWindowsFeatureSearch:
103 return UtilSymbolDefinitions.WixWindowsFeatureSearch;
104
105 case UtilSymbolDefinitionType.XmlConfig: 105 case UtilSymbolDefinitionType.XmlConfig:
106 return UtilSymbolDefinitions.XmlConfig; 106 return UtilSymbolDefinitions.XmlConfig;
107 107
@@ -115,7 +115,7 @@ namespace WixToolset.Util
115 115
116 static UtilSymbolDefinitions() 116 static UtilSymbolDefinitions()
117 { 117 {
118 WixDetectSHA2Support.AddTag(BurnConstants.BundleExtensionSearchSymbolDefinitionTag); 118 WixWindowsFeatureSearch.AddTag(BurnConstants.BundleExtensionSearchSymbolDefinitionTag);
119 } 119 }
120 } 120 }
121} 121}
diff --git a/src/wixext/Symbols/WixDetectSHA2SupportSymbol.cs b/src/wixext/Symbols/WixDetectSHA2SupportSymbol.cs
deleted file mode 100644
index b518ba3b..00000000
--- a/src/wixext/Symbols/WixDetectSHA2SupportSymbol.cs
+++ /dev/null
@@ -1,33 +0,0 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3namespace WixToolset.Util
4{
5 using WixToolset.Data;
6 using WixToolset.Util.Symbols;
7
8 public static partial class UtilSymbolDefinitions
9 {
10 public static readonly IntermediateSymbolDefinition WixDetectSHA2Support = new IntermediateSymbolDefinition(
11 UtilSymbolDefinitionType.WixDetectSHA2Support.ToString(),
12 new IntermediateFieldDefinition[0],
13 typeof(WixDetectSHA2SupportSymbol));
14 }
15}
16
17namespace WixToolset.Util.Symbols
18{
19 using WixToolset.Data;
20
21 public class WixDetectSHA2SupportSymbol : IntermediateSymbol
22 {
23 public WixDetectSHA2SupportSymbol() : base(UtilSymbolDefinitions.WixDetectSHA2Support, null, null)
24 {
25 }
26
27 public WixDetectSHA2SupportSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(UtilSymbolDefinitions.WixDetectSHA2Support, sourceLineNumber, id)
28 {
29 }
30
31 public IntermediateField this[GroupSymbolFields index] => this.Fields[(int)index];
32 }
33}
diff --git a/src/wixext/Symbols/WixWindowsFeatureSearchSymbol.cs b/src/wixext/Symbols/WixWindowsFeatureSearchSymbol.cs
new file mode 100644
index 00000000..9a43692c
--- /dev/null
+++ b/src/wixext/Symbols/WixWindowsFeatureSearchSymbol.cs
@@ -0,0 +1,47 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3namespace WixToolset.Util
4{
5 using WixToolset.Data;
6 using WixToolset.Util.Symbols;
7
8 public static partial class UtilSymbolDefinitions
9 {
10 public static readonly IntermediateSymbolDefinition WixWindowsFeatureSearch = new IntermediateSymbolDefinition(
11 UtilSymbolDefinitionType.WixWindowsFeatureSearch.ToString(),
12 new[]
13 {
14 new IntermediateFieldDefinition(nameof(WixWindowsFeatureSearchSymbolFields.Type), IntermediateFieldType.String),
15 },
16 typeof(WixWindowsFeatureSearchSymbol));
17 }
18}
19
20namespace WixToolset.Util.Symbols
21{
22 using WixToolset.Data;
23
24 public enum WixWindowsFeatureSearchSymbolFields
25 {
26 Type,
27 }
28
29 public class WixWindowsFeatureSearchSymbol : IntermediateSymbol
30 {
31 public WixWindowsFeatureSearchSymbol() : base(UtilSymbolDefinitions.WixWindowsFeatureSearch, null, null)
32 {
33 }
34
35 public WixWindowsFeatureSearchSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(UtilSymbolDefinitions.WixWindowsFeatureSearch, sourceLineNumber, id)
36 {
37 }
38
39 public IntermediateField this[WixWindowsFeatureSearchSymbolFields index] => this.Fields[(int)index];
40
41 public string Type
42 {
43 get => this.Fields[(int)WixWindowsFeatureSearchSymbolFields.Type].AsString();
44 set => this.Set((int)WixWindowsFeatureSearchSymbolFields.Type, value);
45 }
46 }
47}
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);
diff --git a/src/wixext/util.xsd b/src/wixext/util.xsd
index bb7a1e39..b6f0365b 100644
--- a/src/wixext/util.xsd
+++ b/src/wixext/util.xsd
@@ -174,30 +174,6 @@
174 <xs:attribute name="Id" type="xs:string" use="required" /> 174 <xs:attribute name="Id" type="xs:string" use="required" />
175 </xs:complexType> 175 </xs:complexType>
176 </xs:element> 176 </xs:element>
177 <xs:element name="DetectSHA2Support">
178 <xs:annotation>
179 <xs:documentation>Detects support for SHA2.</xs:documentation>
180 <xs:appinfo>
181 <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Bundle" />
182 <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Fragment" />
183 </xs:appinfo>
184 </xs:annotation>
185 <xs:complexType>
186 <xs:attributeGroup ref="SearchCommonAttributes" />
187 </xs:complexType>
188 </xs:element>
189 <xs:element name="DetectSHA2SupportRef">
190 <xs:annotation>
191 <xs:documentation>References a DetectSHA2Support.</xs:documentation>
192 <xs:appinfo>
193 <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Bundle" />
194 <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Fragment" />
195 </xs:appinfo>
196 </xs:annotation>
197 <xs:complexType>
198 <xs:attribute name="Id" type="xs:string" use="required" />
199 </xs:complexType>
200 </xs:element>
201 <xs:element name="DirectorySearch"> 177 <xs:element name="DirectorySearch">
202 <xs:annotation> 178 <xs:annotation>
203 <xs:documentation>Describes a directory search.</xs:documentation> 179 <xs:documentation>Describes a directory search.</xs:documentation>
@@ -1389,6 +1365,44 @@
1389 </xs:attribute> 1365 </xs:attribute>
1390 </xs:complexType> 1366 </xs:complexType>
1391 </xs:element> 1367 </xs:element>
1368 <xs:element name="WindowsFeatureSearch">
1369 <xs:annotation>
1370 <xs:documentation>Detects the existence of a Windows feature.</xs:documentation>
1371 <xs:appinfo>
1372 <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Bundle" />
1373 <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Fragment" />
1374 </xs:appinfo>
1375 </xs:annotation>
1376 <xs:complexType>
1377 <xs:attributeGroup ref="SearchCommonAttributes" />
1378 <xs:attribute name="Feature" use="required">
1379 <xs:annotation>
1380 <xs:documentation>The feature to detect.</xs:documentation>
1381 </xs:annotation>
1382 <xs:simpleType>
1383 <xs:restriction base="xs:NMTOKEN">
1384 <xs:enumeration value="sha2CodeSigning">
1385 <xs:annotation>
1386 <xs:documentation>The oldest OS with this feature is Win7 SP1 with KB3033929.</xs:documentation>
1387 </xs:annotation>
1388 </xs:enumeration>
1389 </xs:restriction>
1390 </xs:simpleType>
1391 </xs:attribute>
1392 </xs:complexType>
1393 </xs:element>
1394 <xs:element name="WindowsFeatureSearchRef">
1395 <xs:annotation>
1396 <xs:documentation>References a WindowsFeatureSearch.</xs:documentation>
1397 <xs:appinfo>
1398 <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Bundle" />
1399 <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Fragment" />
1400 </xs:appinfo>
1401 </xs:annotation>
1402 <xs:complexType>
1403 <xs:attribute name="Id" type="xs:string" use="required" />
1404 </xs:complexType>
1405 </xs:element>
1392 <xs:element name="XmlFile"> 1406 <xs:element name="XmlFile">
1393 <xs:annotation> 1407 <xs:annotation>
1394 <xs:documentation> 1408 <xs:documentation>