From 87527d58d18fa719dc7a5ce512369485d907cba4 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sun, 20 Jan 2019 11:09:10 -0600 Subject: Integrate into latest v4. --- src/wixext/HttpCompiler.cs | 114 ++++++++++----------- src/wixext/HttpConstants.cs | 2 +- src/wixext/HttpDecompiler.cs | 4 +- src/wixext/HttpErrors.cs | 31 ++++++ src/wixext/HttpExtensionData.cs | 50 ++------- src/wixext/HttpExtensionFactory.cs | 18 ++++ .../HttpWindowsInstallerBackendBinderExtension.cs | 26 +++++ src/wixext/Tuples/HttpTupleDefinitions.cs | 43 ++++++++ src/wixext/Tuples/WixHttpUrlAceTuple.cs | 71 +++++++++++++ src/wixext/Tuples/WixHttpUrlReservationTuple.cs | 79 ++++++++++++++ src/wixext/WixHttpExtension.csproj | 48 --------- src/wixext/WixToolset.Http.wixext.csproj | 33 ++++++ src/wixext/WixToolset.Http.wixext.targets | 11 ++ src/wixext/messages.xml | 13 --- 14 files changed, 377 insertions(+), 166 deletions(-) create mode 100644 src/wixext/HttpErrors.cs create mode 100644 src/wixext/HttpExtensionFactory.cs create mode 100644 src/wixext/HttpWindowsInstallerBackendBinderExtension.cs create mode 100644 src/wixext/Tuples/HttpTupleDefinitions.cs create mode 100644 src/wixext/Tuples/WixHttpUrlAceTuple.cs create mode 100644 src/wixext/Tuples/WixHttpUrlReservationTuple.cs delete mode 100644 src/wixext/WixHttpExtension.csproj create mode 100644 src/wixext/WixToolset.Http.wixext.csproj create mode 100644 src/wixext/WixToolset.Http.wixext.targets delete mode 100644 src/wixext/messages.xml (limited to 'src/wixext') diff --git a/src/wixext/HttpCompiler.cs b/src/wixext/HttpCompiler.cs index c694ccde..094f5594 100644 --- a/src/wixext/HttpCompiler.cs +++ b/src/wixext/HttpCompiler.cs @@ -1,26 +1,20 @@ // 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.Extensions +namespace WixToolset.Http { using System; using System.Collections.Generic; - using System.Globalization; using System.Xml.Linq; using WixToolset.Data; using WixToolset.Extensibility; + using WixToolset.Http.Tuples; /// /// The compiler for the WiX Toolset Http Extension. /// - public sealed class HttpCompiler : CompilerExtension + public sealed class HttpCompiler : BaseCompilerExtension { - /// - /// Instantiate a new HttpCompiler. - /// - public HttpCompiler() - { - this.Namespace = "http://wixtoolset.org/schemas/v4/wxs/http"; - } + public override XNamespace Namespace => "http://wixtoolset.org/schemas/v4/wxs/http"; /// /// Processes an element for the Compiler. @@ -29,7 +23,7 @@ namespace WixToolset.Extensions /// Parent element of element to process. /// Element to process. /// Extra information about the context in which this element is being parsed. - public override void ParseElement(XElement parentElement, XElement element, IDictionary context) + public override void ParseElement(Intermediate intermediate, IntermediateSection section, XElement parentElement, XElement element, IDictionary context) { switch (parentElement.Name.LocalName) { @@ -41,10 +35,10 @@ namespace WixToolset.Extensions switch (element.Name.LocalName) { case "UrlReservation": - this.ParseUrlReservationElement(element, serviceComponentId, serviceUser); + this.ParseUrlReservationElement(intermediate, section, element, serviceComponentId, serviceUser); break; default: - this.Core.UnexpectedElement(parentElement, element); + this.ParseHelper.UnexpectedElement(parentElement, element); break; } break; @@ -54,15 +48,15 @@ namespace WixToolset.Extensions switch (element.Name.LocalName) { case "UrlReservation": - this.ParseUrlReservationElement(element, componentId, null); + this.ParseUrlReservationElement(intermediate, section, element, componentId, null); break; default: - this.Core.UnexpectedElement(parentElement, element); + this.ParseHelper.UnexpectedElement(parentElement, element); break; } break; default: - this.Core.UnexpectedElement(parentElement, element); + this.ParseHelper.UnexpectedElement(parentElement, element); break; } } @@ -73,9 +67,9 @@ namespace WixToolset.Extensions /// The element to parse. /// Identifier of the component that owns this URL reservation. /// The security principal of the parent element (null if nested under Component). - private void ParseUrlReservationElement(XElement node, string componentId, string securityPrincipal) + private void ParseUrlReservationElement(Intermediate intermediate, IntermediateSection section, XElement node, string componentId, string securityPrincipal) { - SourceLineNumber sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node); Identifier id = null; int handleExisting = HttpConstants.heReplace; string handleExistingValue = null; @@ -90,10 +84,10 @@ namespace WixToolset.Extensions switch (attrib.Name.LocalName) { case "Id": - id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib); + id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib); break; case "HandleExisting": - handleExistingValue = this.Core.GetAttributeValue(sourceLineNumbers, attrib); + handleExistingValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); switch (handleExistingValue) { case "replace": @@ -106,31 +100,31 @@ namespace WixToolset.Extensions handleExisting = HttpConstants.heFail; break; default: - this.Core.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "HandleExisting", handleExistingValue, "replace", "ignore", "fail")); + this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "HandleExisting", handleExistingValue, "replace", "ignore", "fail")); break; } break; case "Sddl": - sddl = this.Core.GetAttributeValue(sourceLineNumbers, attrib); + sddl = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); break; case "Url": - url = this.Core.GetAttributeValue(sourceLineNumbers, attrib); + url = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); break; default: - this.Core.UnexpectedAttribute(node, attrib); + this.ParseHelper.UnexpectedAttribute(node, attrib); break; } } else { - this.Core.ParseExtensionAttribute(node, attrib); + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, node, attrib); } } // Need the element ID for child element processing, so generate now if not authored. if (null == id) { - id = this.Core.CreateIdentifier("url", componentId, securityPrincipal, url); + id = this.ParseHelper.CreateIdentifier("url", componentId, securityPrincipal, url); } // Parse UrlAce children. @@ -143,57 +137,56 @@ namespace WixToolset.Extensions case "UrlAce": if (null != sddl) { - this.Core.OnMessage(WixErrors.IllegalParentAttributeWhenNested(sourceLineNumbers, "UrlReservation", "Sddl", "UrlAce")); + this.Messaging.Write(ErrorMessages.IllegalParentAttributeWhenNested(sourceLineNumbers, "UrlReservation", "Sddl", "UrlAce")); } else { foundACE = true; - this.ParseUrlAceElement(child, id.Id, securityPrincipal); + this.ParseUrlAceElement(intermediate, section, child, id.Id, securityPrincipal); } break; default: - this.Core.UnexpectedElement(node, child); + this.ParseHelper.UnexpectedElement(node, child); break; } } else { - this.Core.ParseExtensionElement(node, child); + this.ParseHelper.ParseExtensionElement(this.Context.Extensions, intermediate, section, node, child); } } // Url is required. if (null == url) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Url")); + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Url")); } // Security is required. if (null == sddl && !foundACE) { - this.Core.OnMessage(HttpErrors.NoSecuritySpecified(sourceLineNumbers)); + this.Messaging.Write(HttpErrors.NoSecuritySpecified(sourceLineNumbers)); } - if (!this.Core.EncounteredError) + if (!this.Messaging.EncounteredError) { - Row row = this.Core.CreateRow(sourceLineNumbers, "WixHttpUrlReservation"); - row[0] = id.Id; - row[1] = handleExisting; - row[2] = sddl; - row[3] = url; - row[4] = componentId; + var row = (WixHttpUrlReservationTuple)this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixHttpUrlReservation", id); + row.HandleExisting = handleExisting; + row.Sddl = sddl; + row.Url = url; + row.Component_ = componentId; - if (this.Core.CurrentPlatform == Platform.ARM) + if (this.Context.Platform == Platform.ARM) { // Ensure ARM version of the CA is referenced. - this.Core.CreateSimpleReference(sourceLineNumbers, "CustomAction", "WixSchedHttpUrlReservationsInstall_ARM"); - this.Core.CreateSimpleReference(sourceLineNumbers, "CustomAction", "WixSchedHttpUrlReservationsUninstall_ARM"); + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixSchedHttpUrlReservationsInstall_ARM"); + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixSchedHttpUrlReservationsUninstall_ARM"); } else { // All other supported platforms use x86. - this.Core.CreateSimpleReference(sourceLineNumbers, "CustomAction", "WixSchedHttpUrlReservationsInstall"); - this.Core.CreateSimpleReference(sourceLineNumbers, "CustomAction", "WixSchedHttpUrlReservationsUninstall"); + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixSchedHttpUrlReservationsInstall"); + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixSchedHttpUrlReservationsUninstall"); } } } @@ -204,9 +197,9 @@ namespace WixToolset.Extensions /// The element to parse. /// The URL reservation ID. /// The default security principal. - private void ParseUrlAceElement(XElement node, string urlReservationId, string defaultSecurityPrincipal) + private void ParseUrlAceElement(Intermediate intermediate, IntermediateSection section, XElement node, string urlReservationId, string defaultSecurityPrincipal) { - SourceLineNumber sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node); Identifier id = null; string securityPrincipal = defaultSecurityPrincipal; int rights = HttpConstants.GENERIC_ALL; @@ -219,13 +212,13 @@ namespace WixToolset.Extensions switch (attrib.Name.LocalName) { case "Id": - id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib); + id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib); break; case "SecurityPrincipal": - securityPrincipal = this.Core.GetAttributeValue(sourceLineNumbers, attrib); + securityPrincipal = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); break; case "Rights": - rightsValue = this.Core.GetAttributeValue(sourceLineNumbers, attrib); + rightsValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); switch (rightsValue) { case "all": @@ -238,42 +231,41 @@ namespace WixToolset.Extensions rights = HttpConstants.GENERIC_EXECUTE; break; default: - this.Core.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "Rights", rightsValue, "all", "delegate", "register")); + this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "Rights", rightsValue, "all", "delegate", "register")); break; } break; default: - this.Core.UnexpectedAttribute(node, attrib); + this.ParseHelper.UnexpectedAttribute(node, attrib); break; } } else { - this.Core.ParseExtensionAttribute(node, attrib); + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, node, attrib); } } // Generate Id now if not authored. if (null == id) { - id = this.Core.CreateIdentifier("ace", urlReservationId, securityPrincipal, rightsValue); + id = this.ParseHelper.CreateIdentifier("ace", urlReservationId, securityPrincipal, rightsValue); } - this.Core.ParseForExtensionElements(node); + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, node); // SecurityPrincipal is required. if (null == securityPrincipal) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "SecurityPrincipal")); + this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "SecurityPrincipal")); } - if (!this.Core.EncounteredError) + if (!this.Messaging.EncounteredError) { - Row row = this.Core.CreateRow(sourceLineNumbers, "WixHttpUrlAce"); - row[0] = id.Id; - row[1] = urlReservationId; - row[2] = securityPrincipal; - row[3] = rights; + var row = (WixHttpUrlAceTuple)this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixHttpUrlAce", id); + row.WixHttpUrlReservation_ = urlReservationId; + row.SecurityPrincipal = securityPrincipal; + row.Rights = rights; } } } diff --git a/src/wixext/HttpConstants.cs b/src/wixext/HttpConstants.cs index 7760d03f..1c96f278 100644 --- a/src/wixext/HttpConstants.cs +++ b/src/wixext/HttpConstants.cs @@ -1,6 +1,6 @@ // 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.Extensions +namespace WixToolset.Http { using System; diff --git a/src/wixext/HttpDecompiler.cs b/src/wixext/HttpDecompiler.cs index 043ee1e1..8991ec2f 100644 --- a/src/wixext/HttpDecompiler.cs +++ b/src/wixext/HttpDecompiler.cs @@ -1,7 +1,8 @@ // 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.Extensions +namespace WixToolset.Http { +#if TODO_CONSIDER_DECOMPILER using System; using System.Collections; using System.Diagnostics; @@ -132,4 +133,5 @@ namespace WixToolset.Extensions } } } +#endif } diff --git a/src/wixext/HttpErrors.cs b/src/wixext/HttpErrors.cs new file mode 100644 index 00000000..e87adf54 --- /dev/null +++ b/src/wixext/HttpErrors.cs @@ -0,0 +1,31 @@ +// 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.Http +{ + using System; + using System.Resources; + using WixToolset.Data; + + public static class HttpErrors + { + public static Message NoSecuritySpecified(SourceLineNumber sourceLineNumbers) + { + return Message(sourceLineNumbers, Ids.NoSecuritySpecified, "The UrlReservation element doesn't identify the security for the reservation. You must either specify the Sddl attribute, or provide child UrlAce elements."); + } + + private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args) + { + return new Message(sourceLineNumber, MessageLevel.Error, (int)id, format, args); + } + + private static Message Message(SourceLineNumber sourceLineNumber, Ids id, ResourceManager resourceManager, string resourceName, params object[] args) + { + return new Message(sourceLineNumber, MessageLevel.Error, (int)id, resourceManager, resourceName, args); + } + + public enum Ids + { + NoSecuritySpecified = 6701, + } + } +} diff --git a/src/wixext/HttpExtensionData.cs b/src/wixext/HttpExtensionData.cs index db79a6c1..2ae4a911 100644 --- a/src/wixext/HttpExtensionData.cs +++ b/src/wixext/HttpExtensionData.cs @@ -1,64 +1,30 @@ // 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.Extensions +namespace WixToolset.Http { - using System; - using System.Reflection; using WixToolset.Data; using WixToolset.Extensibility; /// /// The WiX Toolset Http Extension. /// - public sealed class HttpExtensionData : ExtensionData + public sealed class HttpExtensionData : BaseExtensionData { /// /// Gets the default culture. /// /// The default culture. - public override string DefaultCulture - { - get { return "en-us"; } - } - - /// - /// Gets the optional table definitions for this extension. - /// - /// The optional table definitions for this extension. - public override TableDefinitionCollection TableDefinitions - { - get - { - return HttpExtensionData.GetExtensionTableDefinitions(); - } - } - - /// - /// Gets the library associated with this extension. - /// - /// The table definitions to use while loading the library. - /// The loaded library. - public override Library GetLibrary(TableDefinitionCollection tableDefinitions) - { - return HttpExtensionData.GetExtensionLibrary(tableDefinitions); - } + public override string DefaultCulture => "en-US"; - /// - /// Internal mechanism to access the extension's table definitions. - /// - /// Extension's table definitions. - internal static TableDefinitionCollection GetExtensionTableDefinitions() + public override bool TryGetTupleDefinitionByName(string name, out IntermediateTupleDefinition tupleDefinition) { - return ExtensionData.LoadTableDefinitionHelper(Assembly.GetExecutingAssembly(), "WixToolset.Extensions.Data.tables.xml"); + tupleDefinition = HttpTupleDefinitions.ByName(name); + return tupleDefinition != null; } - /// - /// Internal mechanism to access the extension's library. - /// - /// Extension's library. - internal static Library GetExtensionLibrary(TableDefinitionCollection tableDefinitions) + public override Intermediate GetLibrary(ITupleDefinitionCreator tupleDefinitions) { - return ExtensionData.LoadLibraryHelper(Assembly.GetExecutingAssembly(), "WixToolset.Extensions.Data.http.wixlib", tableDefinitions); + return Intermediate.Load(typeof(HttpExtensionData).Assembly, "WixToolset.Http.http.wixlib", tupleDefinitions); } } } diff --git a/src/wixext/HttpExtensionFactory.cs b/src/wixext/HttpExtensionFactory.cs new file mode 100644 index 00000000..fa23dac6 --- /dev/null +++ b/src/wixext/HttpExtensionFactory.cs @@ -0,0 +1,18 @@ +// 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.Http +{ + using System; + using System.Collections.Generic; + using WixToolset.Extensibility; + + public class HttpExtensionFactory : BaseExtensionFactory + { + protected override IEnumerable ExtensionTypes => new[] + { + typeof(HttpCompiler), + typeof(HttpExtensionData), + typeof(HttpWindowsInstallerBackendBinderExtension), + }; + } +} diff --git a/src/wixext/HttpWindowsInstallerBackendBinderExtension.cs b/src/wixext/HttpWindowsInstallerBackendBinderExtension.cs new file mode 100644 index 00000000..598cb275 --- /dev/null +++ b/src/wixext/HttpWindowsInstallerBackendBinderExtension.cs @@ -0,0 +1,26 @@ +// 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.Http +{ + using System.Linq; + using System.Xml; + using WixToolset.Data.WindowsInstaller; + using WixToolset.Extensibility; + + public class HttpWindowsInstallerBackendBinderExtension : BaseWindowsInstallerBackendBinderExtension + { + private static readonly TableDefinition[] Tables = LoadTables(); + + protected override TableDefinition[] TableDefinitionsForTuples => Tables; + + private static TableDefinition[] LoadTables() + { + using (var resourceStream = typeof(HttpWindowsInstallerBackendBinderExtension).Assembly.GetManifestResourceStream("WixToolset.Http.tables.xml")) + using (var reader = XmlReader.Create(resourceStream)) + { + var tables = TableDefinitionCollection.Load(reader); + return tables.ToArray(); + } + } + } +} diff --git a/src/wixext/Tuples/HttpTupleDefinitions.cs b/src/wixext/Tuples/HttpTupleDefinitions.cs new file mode 100644 index 00000000..11305d2a --- /dev/null +++ b/src/wixext/Tuples/HttpTupleDefinitions.cs @@ -0,0 +1,43 @@ +// 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.Http +{ + using System; + using WixToolset.Data; + + public enum HttpTupleDefinitionType + { + WixHttpUrlAce, + WixHttpUrlReservation, + } + + public static partial class HttpTupleDefinitions + { + public static readonly Version Version = new Version("4.0.0"); + + public static IntermediateTupleDefinition ByName(string name) + { + if (!Enum.TryParse(name, out HttpTupleDefinitionType type)) + { + return null; + } + + return ByType(type); + } + + public static IntermediateTupleDefinition ByType(HttpTupleDefinitionType type) + { + switch (type) + { + case HttpTupleDefinitionType.WixHttpUrlAce: + return HttpTupleDefinitions.WixHttpUrlAce; + + case HttpTupleDefinitionType.WixHttpUrlReservation: + return HttpTupleDefinitions.WixHttpUrlReservation; + + default: + throw new ArgumentOutOfRangeException(nameof(type)); + } + } + } +} diff --git a/src/wixext/Tuples/WixHttpUrlAceTuple.cs b/src/wixext/Tuples/WixHttpUrlAceTuple.cs new file mode 100644 index 00000000..3e0006a0 --- /dev/null +++ b/src/wixext/Tuples/WixHttpUrlAceTuple.cs @@ -0,0 +1,71 @@ +// 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.Http +{ + using WixToolset.Data; + using WixToolset.Http.Tuples; + + public static partial class HttpTupleDefinitions + { + public static readonly IntermediateTupleDefinition WixHttpUrlAce = new IntermediateTupleDefinition( + HttpTupleDefinitionType.WixHttpUrlAce.ToString(), + new[] + { + new IntermediateFieldDefinition(nameof(WixHttpUrlAceTupleFields.WixHttpUrlAce), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixHttpUrlAceTupleFields.WixHttpUrlReservation_), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixHttpUrlAceTupleFields.SecurityPrincipal), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixHttpUrlAceTupleFields.Rights), IntermediateFieldType.Number), + }, + typeof(WixHttpUrlAceTuple)); + } +} + +namespace WixToolset.Http.Tuples +{ + using WixToolset.Data; + + public enum WixHttpUrlAceTupleFields + { + WixHttpUrlAce, + WixHttpUrlReservation_, + SecurityPrincipal, + Rights, + } + + public class WixHttpUrlAceTuple : IntermediateTuple + { + public WixHttpUrlAceTuple() : base(HttpTupleDefinitions.WixHttpUrlAce, null, null) + { + } + + public WixHttpUrlAceTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(HttpTupleDefinitions.WixHttpUrlAce, sourceLineNumber, id) + { + } + + public IntermediateField this[WixHttpUrlAceTupleFields index] => this.Fields[(int)index]; + + public string WixHttpUrlAce + { + get => this.Fields[(int)WixHttpUrlAceTupleFields.WixHttpUrlAce].AsString(); + set => this.Set((int)WixHttpUrlAceTupleFields.WixHttpUrlAce, value); + } + + public string WixHttpUrlReservation_ + { + get => this.Fields[(int)WixHttpUrlAceTupleFields.WixHttpUrlReservation_].AsString(); + set => this.Set((int)WixHttpUrlAceTupleFields.WixHttpUrlReservation_, value); + } + + public string SecurityPrincipal + { + get => this.Fields[(int)WixHttpUrlAceTupleFields.SecurityPrincipal].AsString(); + set => this.Set((int)WixHttpUrlAceTupleFields.SecurityPrincipal, value); + } + + public int Rights + { + get => this.Fields[(int)WixHttpUrlAceTupleFields.Rights].AsNumber(); + set => this.Set((int)WixHttpUrlAceTupleFields.Rights, value); + } + } +} \ No newline at end of file diff --git a/src/wixext/Tuples/WixHttpUrlReservationTuple.cs b/src/wixext/Tuples/WixHttpUrlReservationTuple.cs new file mode 100644 index 00000000..7a251f3d --- /dev/null +++ b/src/wixext/Tuples/WixHttpUrlReservationTuple.cs @@ -0,0 +1,79 @@ +// 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.Http +{ + using WixToolset.Data; + using WixToolset.Http.Tuples; + + public static partial class HttpTupleDefinitions + { + public static readonly IntermediateTupleDefinition WixHttpUrlReservation = new IntermediateTupleDefinition( + HttpTupleDefinitionType.WixHttpUrlReservation.ToString(), + new[] + { + new IntermediateFieldDefinition(nameof(WixHttpUrlReservationTupleFields.WixHttpUrlReservation), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixHttpUrlReservationTupleFields.HandleExisting), IntermediateFieldType.Number), + new IntermediateFieldDefinition(nameof(WixHttpUrlReservationTupleFields.Sddl), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixHttpUrlReservationTupleFields.Url), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixHttpUrlReservationTupleFields.Component_), IntermediateFieldType.String), + }, + typeof(WixHttpUrlReservationTuple)); + } +} + +namespace WixToolset.Http.Tuples +{ + using WixToolset.Data; + + public enum WixHttpUrlReservationTupleFields + { + WixHttpUrlReservation, + HandleExisting, + Sddl, + Url, + Component_, + } + + public class WixHttpUrlReservationTuple : IntermediateTuple + { + public WixHttpUrlReservationTuple() : base(HttpTupleDefinitions.WixHttpUrlReservation, null, null) + { + } + + public WixHttpUrlReservationTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(HttpTupleDefinitions.WixHttpUrlReservation, sourceLineNumber, id) + { + } + + public IntermediateField this[WixHttpUrlReservationTupleFields index] => this.Fields[(int)index]; + + public string WixHttpUrlReservation + { + get => this.Fields[(int)WixHttpUrlReservationTupleFields.WixHttpUrlReservation].AsString(); + set => this.Set((int)WixHttpUrlReservationTupleFields.WixHttpUrlReservation, value); + } + + public int HandleExisting + { + get => this.Fields[(int)WixHttpUrlReservationTupleFields.HandleExisting].AsNumber(); + set => this.Set((int)WixHttpUrlReservationTupleFields.HandleExisting, value); + } + + public string Sddl + { + get => this.Fields[(int)WixHttpUrlReservationTupleFields.Sddl].AsString(); + set => this.Set((int)WixHttpUrlReservationTupleFields.Sddl, value); + } + + public string Url + { + get => this.Fields[(int)WixHttpUrlReservationTupleFields.Url].AsString(); + set => this.Set((int)WixHttpUrlReservationTupleFields.Url, value); + } + + public string Component_ + { + get => this.Fields[(int)WixHttpUrlReservationTupleFields.Component_].AsString(); + set => this.Set((int)WixHttpUrlReservationTupleFields.Component_, value); + } + } +} \ No newline at end of file diff --git a/src/wixext/WixHttpExtension.csproj b/src/wixext/WixHttpExtension.csproj deleted file mode 100644 index 74af503f..00000000 --- a/src/wixext/WixHttpExtension.csproj +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - {AAFC3C7F-D818-4B1D-AF3F-A331EA917F3F} - WixHttpExtension - Library - WixToolset.Extensions - - - - - - - - - $(RootNamespace).Data.Messages.resources - - - $(RootNamespace).Data.tables.xml - - - $(RootNamespace).Xsd.http.xsd - PreserveNewest - - - WixToolset.Data.Serialize - WixToolset.Extensions.Serialize.Http - - - Data\http.wixlib - - - - - - - - - - - false - - - - diff --git a/src/wixext/WixToolset.Http.wixext.csproj b/src/wixext/WixToolset.Http.wixext.csproj new file mode 100644 index 00000000..c681e308 --- /dev/null +++ b/src/wixext/WixToolset.Http.wixext.csproj @@ -0,0 +1,33 @@ + + + + + + netstandard2.0 + WixToolset.Http + WiX Toolset Http Extension + WiX Toolset Http Extension + true + build + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/wixext/WixToolset.Http.wixext.targets b/src/wixext/WixToolset.Http.wixext.targets new file mode 100644 index 00000000..254b0010 --- /dev/null +++ b/src/wixext/WixToolset.Http.wixext.targets @@ -0,0 +1,11 @@ + + + + + + $(MSBuildThisFileDirectory)..\tools\WixToolset.Http.wixext.dll + + + + + diff --git a/src/wixext/messages.xml b/src/wixext/messages.xml deleted file mode 100644 index 6dcdc366..00000000 --- a/src/wixext/messages.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - The UrlReservation element doesn't identify the security for the reservation. You must either specify the Sddl attribute, or provide child UrlAce elements. - - - - -- cgit v1.2.3-55-g6feb