From f866ab77f8fd0790f4d6628f54dcdf0bd66fccb6 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Fri, 10 Jul 2020 21:25:44 +1000 Subject: Change the DetectSHA2Support element to WindowsFeatureSearch. This will make it easier to add support for other Windows features in the future. --- src/wixext/Symbols/UtilSymbolDefinitions.cs | 10 ++--- src/wixext/Symbols/WixDetectSHA2SupportSymbol.cs | 33 --------------- .../Symbols/WixWindowsFeatureSearchSymbol.cs | 47 ++++++++++++++++++++++ 3 files changed, 52 insertions(+), 38 deletions(-) delete mode 100644 src/wixext/Symbols/WixDetectSHA2SupportSymbol.cs create mode 100644 src/wixext/Symbols/WixWindowsFeatureSearchSymbol.cs (limited to 'src/wixext/Symbols') 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 User, UserGroup, WixCloseApplication, - WixDetectSHA2Support, WixFormatFiles, WixInternetShortcut, WixRemoveFolderEx, WixRestartResource, WixTouchFile, + WixWindowsFeatureSearch, XmlConfig, XmlFile, } @@ -84,9 +84,6 @@ namespace WixToolset.Util case UtilSymbolDefinitionType.WixCloseApplication: return UtilSymbolDefinitions.WixCloseApplication; - case UtilSymbolDefinitionType.WixDetectSHA2Support: - return UtilSymbolDefinitions.WixDetectSHA2Support; - case UtilSymbolDefinitionType.WixFormatFiles: return UtilSymbolDefinitions.WixFormatFiles; @@ -102,6 +99,9 @@ namespace WixToolset.Util case UtilSymbolDefinitionType.WixTouchFile: return UtilSymbolDefinitions.WixTouchFile; + case UtilSymbolDefinitionType.WixWindowsFeatureSearch: + return UtilSymbolDefinitions.WixWindowsFeatureSearch; + case UtilSymbolDefinitionType.XmlConfig: return UtilSymbolDefinitions.XmlConfig; @@ -115,7 +115,7 @@ namespace WixToolset.Util static UtilSymbolDefinitions() { - WixDetectSHA2Support.AddTag(BurnConstants.BundleExtensionSearchSymbolDefinitionTag); + WixWindowsFeatureSearch.AddTag(BurnConstants.BundleExtensionSearchSymbolDefinitionTag); } } } 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 @@ -// 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. - -namespace WixToolset.Util -{ - using WixToolset.Data; - using WixToolset.Util.Symbols; - - public static partial class UtilSymbolDefinitions - { - public static readonly IntermediateSymbolDefinition WixDetectSHA2Support = new IntermediateSymbolDefinition( - UtilSymbolDefinitionType.WixDetectSHA2Support.ToString(), - new IntermediateFieldDefinition[0], - typeof(WixDetectSHA2SupportSymbol)); - } -} - -namespace WixToolset.Util.Symbols -{ - using WixToolset.Data; - - public class WixDetectSHA2SupportSymbol : IntermediateSymbol - { - public WixDetectSHA2SupportSymbol() : base(UtilSymbolDefinitions.WixDetectSHA2Support, null, null) - { - } - - public WixDetectSHA2SupportSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(UtilSymbolDefinitions.WixDetectSHA2Support, sourceLineNumber, id) - { - } - - public IntermediateField this[GroupSymbolFields index] => this.Fields[(int)index]; - } -} 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 @@ +// 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. + +namespace WixToolset.Util +{ + using WixToolset.Data; + using WixToolset.Util.Symbols; + + public static partial class UtilSymbolDefinitions + { + public static readonly IntermediateSymbolDefinition WixWindowsFeatureSearch = new IntermediateSymbolDefinition( + UtilSymbolDefinitionType.WixWindowsFeatureSearch.ToString(), + new[] + { + new IntermediateFieldDefinition(nameof(WixWindowsFeatureSearchSymbolFields.Type), IntermediateFieldType.String), + }, + typeof(WixWindowsFeatureSearchSymbol)); + } +} + +namespace WixToolset.Util.Symbols +{ + using WixToolset.Data; + + public enum WixWindowsFeatureSearchSymbolFields + { + Type, + } + + public class WixWindowsFeatureSearchSymbol : IntermediateSymbol + { + public WixWindowsFeatureSearchSymbol() : base(UtilSymbolDefinitions.WixWindowsFeatureSearch, null, null) + { + } + + public WixWindowsFeatureSearchSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(UtilSymbolDefinitions.WixWindowsFeatureSearch, sourceLineNumber, id) + { + } + + public IntermediateField this[WixWindowsFeatureSearchSymbolFields index] => this.Fields[(int)index]; + + public string Type + { + get => this.Fields[(int)WixWindowsFeatureSearchSymbolFields.Type].AsString(); + set => this.Set((int)WixWindowsFeatureSearchSymbolFields.Type, value); + } + } +} -- cgit v1.2.3-55-g6feb