diff options
| author | Rob Mensching <rob@firegiant.com> | 2021-05-03 16:05:08 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2021-05-03 16:05:08 -0700 |
| commit | 7bdd5e9159b298e0411afa689a06c44e36e293cd (patch) | |
| tree | 57d24ea7fdd8025baf6a822a99b588c9df74a60d /src/ext/NetFx/wixext | |
| parent | ca02e81316d700a3647414f355eab4d2115d6163 (diff) | |
| download | wix-7bdd5e9159b298e0411afa689a06c44e36e293cd.tar.gz wix-7bdd5e9159b298e0411afa689a06c44e36e293cd.tar.bz2 wix-7bdd5e9159b298e0411afa689a06c44e36e293cd.zip | |
Move NetFx.wixext into ext
Diffstat (limited to 'src/ext/NetFx/wixext')
| -rw-r--r-- | src/ext/NetFx/wixext/NetFxCompiler.cs | 163 | ||||
| -rw-r--r-- | src/ext/NetFx/wixext/NetFxDecompiler.cs | 139 | ||||
| -rw-r--r-- | src/ext/NetFx/wixext/NetFxExtensionData.cs | 25 | ||||
| -rw-r--r-- | src/ext/NetFx/wixext/NetfxExtensionFactory.cs | 18 | ||||
| -rw-r--r-- | src/ext/NetFx/wixext/NetfxTableDefinitions.cs | 30 | ||||
| -rw-r--r-- | src/ext/NetFx/wixext/NetfxWindowsInstallerBackendExtension.cs | 13 | ||||
| -rw-r--r-- | src/ext/NetFx/wixext/Symbols/NetFxNativeImageSymbol.cs | 58 | ||||
| -rw-r--r-- | src/ext/NetFx/wixext/Symbols/NetfxSymbolDefinitions.cs | 26 | ||||
| -rw-r--r-- | src/ext/NetFx/wixext/WixToolset.Netfx.wixext.csproj | 31 | ||||
| -rw-r--r-- | src/ext/NetFx/wixext/WixToolset.Netfx.wixext.nuspec | 25 | ||||
| -rw-r--r-- | src/ext/NetFx/wixext/WixToolset.Netfx.wixext.targets | 11 | ||||
| -rw-r--r-- | src/ext/NetFx/wixext/WixToolset.Netfx.wixext.v3.ncrunchproject | 7 |
12 files changed, 546 insertions, 0 deletions
diff --git a/src/ext/NetFx/wixext/NetFxCompiler.cs b/src/ext/NetFx/wixext/NetFxCompiler.cs new file mode 100644 index 00000000..90aa8bcb --- /dev/null +++ b/src/ext/NetFx/wixext/NetFxCompiler.cs | |||
| @@ -0,0 +1,163 @@ | |||
| 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 | |||
| 3 | namespace WixToolset.Netfx | ||
| 4 | { | ||
| 5 | using System; | ||
| 6 | using System.Collections.Generic; | ||
| 7 | using System.Xml.Linq; | ||
| 8 | using WixToolset.Data; | ||
| 9 | using WixToolset.Extensibility; | ||
| 10 | using WixToolset.Extensibility.Data; | ||
| 11 | using WixToolset.Netfx.Symbols; | ||
| 12 | |||
| 13 | /// <summary> | ||
| 14 | /// The compiler for the WiX Toolset .NET Framework Extension. | ||
| 15 | /// </summary> | ||
| 16 | public sealed class NetfxCompiler : BaseCompilerExtension | ||
| 17 | { | ||
| 18 | public override XNamespace Namespace => "http://wixtoolset.org/schemas/v4/wxs/netfx"; | ||
| 19 | |||
| 20 | /// <summary> | ||
| 21 | /// Processes an element for the Compiler. | ||
| 22 | /// </summary> | ||
| 23 | /// <param name="parentElement">Parent element of element to process.</param> | ||
| 24 | /// <param name="element">Element to process.</param> | ||
| 25 | /// <param name="contextValues">Extra information about the context in which this element is being parsed.</param> | ||
| 26 | public override void ParseElement(Intermediate intermediate, IntermediateSection section, XElement parentElement, XElement element, IDictionary<string, string> context) | ||
| 27 | { | ||
| 28 | switch (parentElement.Name.LocalName) | ||
| 29 | { | ||
| 30 | case "File": | ||
| 31 | string fileId = context["FileId"]; | ||
| 32 | |||
| 33 | switch (element.Name.LocalName) | ||
| 34 | { | ||
| 35 | case "NativeImage": | ||
| 36 | this.ParseNativeImageElement(intermediate, section, element, fileId); | ||
| 37 | break; | ||
| 38 | default: | ||
| 39 | this.ParseHelper.UnexpectedElement(parentElement, element); | ||
| 40 | break; | ||
| 41 | } | ||
| 42 | break; | ||
| 43 | default: | ||
| 44 | this.ParseHelper.UnexpectedElement(parentElement, element); | ||
| 45 | break; | ||
| 46 | } | ||
| 47 | } | ||
| 48 | |||
| 49 | /// <summary> | ||
| 50 | /// Parses a NativeImage element. | ||
| 51 | /// </summary> | ||
| 52 | /// <param name="element">The element to parse.</param> | ||
| 53 | /// <param name="fileId">The file identifier of the parent element.</param> | ||
| 54 | private void ParseNativeImageElement(Intermediate intermediate, IntermediateSection section, XElement element, string fileId) | ||
| 55 | { | ||
| 56 | var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); | ||
| 57 | Identifier id = null; | ||
| 58 | string appBaseDirectory = null; | ||
| 59 | string assemblyApplication = null; | ||
| 60 | int attributes = 0x8; // 32bit is on by default | ||
| 61 | int priority = 3; | ||
| 62 | |||
| 63 | foreach (var attrib in element.Attributes()) | ||
| 64 | { | ||
| 65 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) | ||
| 66 | { | ||
| 67 | switch (attrib.Name.LocalName) | ||
| 68 | { | ||
| 69 | case "Id": | ||
| 70 | id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib); | ||
| 71 | break; | ||
| 72 | case "AppBaseDirectory": | ||
| 73 | appBaseDirectory = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); | ||
| 74 | |||
| 75 | // See if a formatted value is specified. | ||
| 76 | if (-1 == appBaseDirectory.IndexOf("[", StringComparison.Ordinal)) | ||
| 77 | { | ||
| 78 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, SymbolDefinitions.Directory, appBaseDirectory); | ||
| 79 | } | ||
| 80 | break; | ||
| 81 | case "AssemblyApplication": | ||
| 82 | assemblyApplication = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); | ||
| 83 | |||
| 84 | // See if a formatted value is specified. | ||
| 85 | if (-1 == assemblyApplication.IndexOf("[", StringComparison.Ordinal)) | ||
| 86 | { | ||
| 87 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, SymbolDefinitions.File, assemblyApplication); | ||
| 88 | } | ||
| 89 | break; | ||
| 90 | case "Debug": | ||
| 91 | if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) | ||
| 92 | { | ||
| 93 | attributes |= 0x1; | ||
| 94 | } | ||
| 95 | break; | ||
| 96 | case "Dependencies": | ||
| 97 | if (YesNoType.No == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) | ||
| 98 | { | ||
| 99 | attributes |= 0x2; | ||
| 100 | } | ||
| 101 | break; | ||
| 102 | case "Platform": | ||
| 103 | string platformValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); | ||
| 104 | if (0 < platformValue.Length) | ||
| 105 | { | ||
| 106 | switch (platformValue) | ||
| 107 | { | ||
| 108 | case "32bit": | ||
| 109 | // 0x8 is already on by default | ||
| 110 | break; | ||
| 111 | case "64bit": | ||
| 112 | attributes &= ~0x8; | ||
| 113 | attributes |= 0x10; | ||
| 114 | break; | ||
| 115 | case "all": | ||
| 116 | attributes |= 0x10; | ||
| 117 | break; | ||
| 118 | } | ||
| 119 | } | ||
| 120 | break; | ||
| 121 | case "Priority": | ||
| 122 | priority = this.ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, 3); | ||
| 123 | break; | ||
| 124 | case "Profile": | ||
| 125 | if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) | ||
| 126 | { | ||
| 127 | attributes |= 0x4; | ||
| 128 | } | ||
| 129 | break; | ||
| 130 | default: | ||
| 131 | this.ParseHelper.UnexpectedAttribute(element, attrib); | ||
| 132 | break; | ||
| 133 | } | ||
| 134 | } | ||
| 135 | else | ||
| 136 | { | ||
| 137 | this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib); | ||
| 138 | } | ||
| 139 | } | ||
| 140 | |||
| 141 | if (null == id) | ||
| 142 | { | ||
| 143 | id = this.ParseHelper.CreateIdentifier("nni", fileId); | ||
| 144 | } | ||
| 145 | |||
| 146 | this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element); | ||
| 147 | |||
| 148 | this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "Wix4NetFxScheduleNativeImage", this.Context.Platform, CustomActionPlatforms.ARM64 | CustomActionPlatforms.X64 | CustomActionPlatforms.X86); | ||
| 149 | |||
| 150 | if (!this.Messaging.EncounteredError) | ||
| 151 | { | ||
| 152 | section.AddSymbol(new NetFxNativeImageSymbol(sourceLineNumbers, id) | ||
| 153 | { | ||
| 154 | FileRef = fileId, | ||
| 155 | Priority = priority, | ||
| 156 | Attributes = attributes, | ||
| 157 | ApplicationFileRef = assemblyApplication, | ||
| 158 | ApplicationBaseDirectoryRef = appBaseDirectory, | ||
| 159 | }); | ||
| 160 | } | ||
| 161 | } | ||
| 162 | } | ||
| 163 | } | ||
diff --git a/src/ext/NetFx/wixext/NetFxDecompiler.cs b/src/ext/NetFx/wixext/NetFxDecompiler.cs new file mode 100644 index 00000000..e30905d1 --- /dev/null +++ b/src/ext/NetFx/wixext/NetFxDecompiler.cs | |||
| @@ -0,0 +1,139 @@ | |||
| 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 | |||
| 3 | namespace WixToolset.Extensions | ||
| 4 | { | ||
| 5 | #if TODO_CONSIDER_DECOMPILER | ||
| 6 | using System; | ||
| 7 | using System.Collections; | ||
| 8 | using System.Diagnostics; | ||
| 9 | using System.Globalization; | ||
| 10 | using WixToolset.Data; | ||
| 11 | using WixToolset.Extensibility; | ||
| 12 | using NetFx = WixToolset.Extensions.Serialize.NetFx; | ||
| 13 | using Wix = WixToolset.Data.Serialize; | ||
| 14 | |||
| 15 | /// <summary> | ||
| 16 | /// The decompiler for the WiX Toolset .NET Framework Extension. | ||
| 17 | /// </summary> | ||
| 18 | public sealed class NetFxDecompiler : DecompilerExtension | ||
| 19 | { | ||
| 20 | /// <summary> | ||
| 21 | /// Creates a decompiler for NetFx Extension. | ||
| 22 | /// </summary> | ||
| 23 | public NetFxDecompiler() | ||
| 24 | { | ||
| 25 | this.TableDefinitions = NetFxExtensionData.GetExtensionTableDefinitions(); | ||
| 26 | } | ||
| 27 | |||
| 28 | /// <summary> | ||
| 29 | /// Get the extensions library to be removed. | ||
| 30 | /// </summary> | ||
| 31 | /// <param name="tableDefinitions">Table definitions for library.</param> | ||
| 32 | /// <returns>Library to remove from decompiled output.</returns> | ||
| 33 | public override Library GetLibraryToRemove(TableDefinitionCollection tableDefinitions) | ||
| 34 | { | ||
| 35 | return NetFxExtensionData.GetExtensionLibrary(tableDefinitions); | ||
| 36 | } | ||
| 37 | |||
| 38 | /// <summary> | ||
| 39 | /// Decompiles an extension table. | ||
| 40 | /// </summary> | ||
| 41 | /// <param name="table">The table to decompile.</param> | ||
| 42 | public override void DecompileTable(Table table) | ||
| 43 | { | ||
| 44 | switch (table.Name) | ||
| 45 | { | ||
| 46 | case "NetFxNativeImage": | ||
| 47 | this.DecompileNetFxNativeImageTable(table); | ||
| 48 | break; | ||
| 49 | default: | ||
| 50 | base.DecompileTable(table); | ||
| 51 | break; | ||
| 52 | } | ||
| 53 | } | ||
| 54 | |||
| 55 | /// <summary> | ||
| 56 | /// Decompile the NetFxNativeImage table. | ||
| 57 | /// </summary> | ||
| 58 | /// <param name="table">The table to decompile.</param> | ||
| 59 | private void DecompileNetFxNativeImageTable(Table table) | ||
| 60 | { | ||
| 61 | foreach (Row row in table.Rows) | ||
| 62 | { | ||
| 63 | NetFx.NativeImage nativeImage = new NetFx.NativeImage(); | ||
| 64 | |||
| 65 | nativeImage.Id = (string)row[0]; | ||
| 66 | |||
| 67 | switch ((int)row[2]) | ||
| 68 | { | ||
| 69 | case 0: | ||
| 70 | nativeImage.Priority = NetFx.NativeImage.PriorityType.Item0; | ||
| 71 | break; | ||
| 72 | case 1: | ||
| 73 | nativeImage.Priority = NetFx.NativeImage.PriorityType.Item1; | ||
| 74 | break; | ||
| 75 | case 2: | ||
| 76 | nativeImage.Priority = NetFx.NativeImage.PriorityType.Item2; | ||
| 77 | break; | ||
| 78 | case 3: | ||
| 79 | nativeImage.Priority = NetFx.NativeImage.PriorityType.Item3; | ||
| 80 | break; | ||
| 81 | } | ||
| 82 | |||
| 83 | if (null != row[3]) | ||
| 84 | { | ||
| 85 | int attributes = (int)row[3]; | ||
| 86 | |||
| 87 | if (0x1 == (attributes & 0x1)) | ||
| 88 | { | ||
| 89 | nativeImage.Debug = NetFx.YesNoType.yes; | ||
| 90 | } | ||
| 91 | |||
| 92 | if (0x2 == (attributes & 0x2)) | ||
| 93 | { | ||
| 94 | nativeImage.Dependencies = NetFx.YesNoType.no; | ||
| 95 | } | ||
| 96 | |||
| 97 | if (0x4 == (attributes & 0x4)) | ||
| 98 | { | ||
| 99 | nativeImage.Profile = NetFx.YesNoType.yes; | ||
| 100 | } | ||
| 101 | |||
| 102 | if (0x8 == (attributes & 0x8) && 0x10 == (attributes & 0x10)) | ||
| 103 | { | ||
| 104 | nativeImage.Platform = NetFx.NativeImage.PlatformType.all; | ||
| 105 | } | ||
| 106 | else if (0x8 == (attributes & 0x8)) | ||
| 107 | { | ||
| 108 | nativeImage.Platform = NetFx.NativeImage.PlatformType.Item32bit; | ||
| 109 | } | ||
| 110 | else if (0x10 == (attributes & 0x10)) | ||
| 111 | { | ||
| 112 | nativeImage.Platform = NetFx.NativeImage.PlatformType.Item64bit; | ||
| 113 | } | ||
| 114 | } | ||
| 115 | |||
| 116 | if (null != row[4]) | ||
| 117 | { | ||
| 118 | nativeImage.AssemblyApplication = (string)row[4]; | ||
| 119 | } | ||
| 120 | |||
| 121 | if (null != row[5]) | ||
| 122 | { | ||
| 123 | nativeImage.AppBaseDirectory = (string)row[5]; | ||
| 124 | } | ||
| 125 | |||
| 126 | Wix.File file = (Wix.File)this.Core.GetIndexedElement("File", (string)row[1]); | ||
| 127 | if (null != file) | ||
| 128 | { | ||
| 129 | file.AddChild(nativeImage); | ||
| 130 | } | ||
| 131 | else | ||
| 132 | { | ||
| 133 | this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "File_", (string)row[1], "File")); | ||
| 134 | } | ||
| 135 | } | ||
| 136 | } | ||
| 137 | } | ||
| 138 | #endif | ||
| 139 | } | ||
diff --git a/src/ext/NetFx/wixext/NetFxExtensionData.cs b/src/ext/NetFx/wixext/NetFxExtensionData.cs new file mode 100644 index 00000000..0a24ef1e --- /dev/null +++ b/src/ext/NetFx/wixext/NetFxExtensionData.cs | |||
| @@ -0,0 +1,25 @@ | |||
| 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 | |||
| 3 | namespace WixToolset.Netfx | ||
| 4 | { | ||
| 5 | using WixToolset.Data; | ||
| 6 | using WixToolset.Extensibility; | ||
| 7 | using WixToolset.Netfx.Symbols; | ||
| 8 | |||
| 9 | /// <summary> | ||
| 10 | /// The WiX Toolset .NET Framework Extension. | ||
| 11 | /// </summary> | ||
| 12 | public sealed class NetfxExtensionData : BaseExtensionData | ||
| 13 | { | ||
| 14 | public override bool TryGetSymbolDefinitionByName(string name, out IntermediateSymbolDefinition symbolDefinition) | ||
| 15 | { | ||
| 16 | symbolDefinition = (name == NetfxSymbolDefinitionNames.NetFxNativeImage) ? NetfxSymbolDefinitions.NetFxNativeImage : null; | ||
| 17 | return symbolDefinition != null; | ||
| 18 | } | ||
| 19 | |||
| 20 | public override Intermediate GetLibrary(ISymbolDefinitionCreator symbolDefinitions) | ||
| 21 | { | ||
| 22 | return Intermediate.Load(typeof(NetfxExtensionData).Assembly, "WixToolset.Netfx.netfx.wixlib", symbolDefinitions); | ||
| 23 | } | ||
| 24 | } | ||
| 25 | } | ||
diff --git a/src/ext/NetFx/wixext/NetfxExtensionFactory.cs b/src/ext/NetFx/wixext/NetfxExtensionFactory.cs new file mode 100644 index 00000000..fe618460 --- /dev/null +++ b/src/ext/NetFx/wixext/NetfxExtensionFactory.cs | |||
| @@ -0,0 +1,18 @@ | |||
| 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 | |||
| 3 | namespace WixToolset.Netfx | ||
| 4 | { | ||
| 5 | using System; | ||
| 6 | using System.Collections.Generic; | ||
| 7 | using WixToolset.Extensibility; | ||
| 8 | |||
| 9 | public class NetfxExtensionFactory : BaseExtensionFactory | ||
| 10 | { | ||
| 11 | protected override IReadOnlyCollection<Type> ExtensionTypes => new[] | ||
| 12 | { | ||
| 13 | typeof(NetfxCompiler), | ||
| 14 | typeof(NetfxExtensionData), | ||
| 15 | typeof(NetfxWindowsInstallerBackendBinderExtension), | ||
| 16 | }; | ||
| 17 | } | ||
| 18 | } | ||
diff --git a/src/ext/NetFx/wixext/NetfxTableDefinitions.cs b/src/ext/NetFx/wixext/NetfxTableDefinitions.cs new file mode 100644 index 00000000..1b2a4d21 --- /dev/null +++ b/src/ext/NetFx/wixext/NetfxTableDefinitions.cs | |||
| @@ -0,0 +1,30 @@ | |||
| 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 | |||
| 3 | namespace WixToolset.Netfx | ||
| 4 | { | ||
| 5 | using WixToolset.Data.WindowsInstaller; | ||
| 6 | using WixToolset.Netfx.Symbols; | ||
| 7 | |||
| 8 | public static class NetfxTableDefinitions | ||
| 9 | { | ||
| 10 | public static readonly TableDefinition NetFxNativeImage = new TableDefinition( | ||
| 11 | "Wix4NetFxNativeImage", | ||
| 12 | NetfxSymbolDefinitions.NetFxNativeImage, | ||
| 13 | new[] | ||
| 14 | { | ||
| 15 | new ColumnDefinition("Wix4NetFxNativeImage", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "The primary key, a non-localized token.", modularizeType: ColumnModularizeType.Column), | ||
| 16 | new ColumnDefinition("File_", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Identifier, keyTable: "File", keyColumn: 1, description: "The assembly for which a native image will be generated.", modularizeType: ColumnModularizeType.Column), | ||
| 17 | new ColumnDefinition("Priority", ColumnType.Number, 2, primaryKey: false, nullable: false, ColumnCategory.Integer, minValue: 0, maxValue: 3, description: "The priority for generating this native image: 0 is syncronous, 1-3 represent various levels of queued generation."), | ||
| 18 | new ColumnDefinition("Attributes", ColumnType.Number, 4, primaryKey: false, nullable: false, ColumnCategory.Integer, minValue: 0, maxValue: 2147483647, description: "Integer containing bit flags representing native image attributes."), | ||
| 19 | new ColumnDefinition("File_Application", ColumnType.String, 72, primaryKey: false, nullable: true, ColumnCategory.Formatted, description: "The application which loads this assembly.", modularizeType: ColumnModularizeType.Column), | ||
| 20 | new ColumnDefinition("Directory_ApplicationBase", ColumnType.String, 72, primaryKey: false, nullable: true, ColumnCategory.Formatted, description: "The directory containing the application which loads this assembly.", modularizeType: ColumnModularizeType.Column), | ||
| 21 | }, | ||
| 22 | symbolIdIsPrimaryKey: true | ||
| 23 | ); | ||
| 24 | |||
| 25 | public static readonly TableDefinition[] All = new[] | ||
| 26 | { | ||
| 27 | NetFxNativeImage, | ||
| 28 | }; | ||
| 29 | } | ||
| 30 | } | ||
diff --git a/src/ext/NetFx/wixext/NetfxWindowsInstallerBackendExtension.cs b/src/ext/NetFx/wixext/NetfxWindowsInstallerBackendExtension.cs new file mode 100644 index 00000000..7d4fe475 --- /dev/null +++ b/src/ext/NetFx/wixext/NetfxWindowsInstallerBackendExtension.cs | |||
| @@ -0,0 +1,13 @@ | |||
| 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 | |||
| 3 | namespace WixToolset.Netfx | ||
| 4 | { | ||
| 5 | using System.Collections.Generic; | ||
| 6 | using WixToolset.Data.WindowsInstaller; | ||
| 7 | using WixToolset.Extensibility; | ||
| 8 | |||
| 9 | public class NetfxWindowsInstallerBackendBinderExtension : BaseWindowsInstallerBackendBinderExtension | ||
| 10 | { | ||
| 11 | public override IReadOnlyCollection<TableDefinition> TableDefinitions => NetfxTableDefinitions.All; | ||
| 12 | } | ||
| 13 | } | ||
diff --git a/src/ext/NetFx/wixext/Symbols/NetFxNativeImageSymbol.cs b/src/ext/NetFx/wixext/Symbols/NetFxNativeImageSymbol.cs new file mode 100644 index 00000000..3803abd6 --- /dev/null +++ b/src/ext/NetFx/wixext/Symbols/NetFxNativeImageSymbol.cs | |||
| @@ -0,0 +1,58 @@ | |||
| 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 | |||
| 3 | namespace WixToolset.Netfx.Symbols | ||
| 4 | { | ||
| 5 | using WixToolset.Data; | ||
| 6 | |||
| 7 | public enum NetFxNativeImageSymbolFields | ||
| 8 | { | ||
| 9 | FileRef, | ||
| 10 | Priority, | ||
| 11 | Attributes, | ||
| 12 | ApplicationFileRef, | ||
| 13 | ApplicationBaseDirectoryRef, | ||
| 14 | } | ||
| 15 | |||
| 16 | public class NetFxNativeImageSymbol : IntermediateSymbol | ||
| 17 | { | ||
| 18 | public NetFxNativeImageSymbol() : base(NetfxSymbolDefinitions.NetFxNativeImage, null, null) | ||
| 19 | { | ||
| 20 | } | ||
| 21 | |||
| 22 | public NetFxNativeImageSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(NetfxSymbolDefinitions.NetFxNativeImage, sourceLineNumber, id) | ||
| 23 | { | ||
| 24 | } | ||
| 25 | |||
| 26 | public IntermediateField this[NetFxNativeImageSymbolFields index] => this.Fields[(int)index]; | ||
| 27 | |||
| 28 | public string FileRef | ||
| 29 | { | ||
| 30 | get => this.Fields[(int)NetFxNativeImageSymbolFields.FileRef].AsString(); | ||
| 31 | set => this.Set((int)NetFxNativeImageSymbolFields.FileRef, value); | ||
| 32 | } | ||
| 33 | |||
| 34 | public int Priority | ||
| 35 | { | ||
| 36 | get => this.Fields[(int)NetFxNativeImageSymbolFields.Priority].AsNumber(); | ||
| 37 | set => this.Set((int)NetFxNativeImageSymbolFields.Priority, value); | ||
| 38 | } | ||
| 39 | |||
| 40 | public int Attributes | ||
| 41 | { | ||
| 42 | get => this.Fields[(int)NetFxNativeImageSymbolFields.Attributes].AsNumber(); | ||
| 43 | set => this.Set((int)NetFxNativeImageSymbolFields.Attributes, value); | ||
| 44 | } | ||
| 45 | |||
| 46 | public string ApplicationFileRef | ||
| 47 | { | ||
| 48 | get => this.Fields[(int)NetFxNativeImageSymbolFields.ApplicationFileRef].AsString(); | ||
| 49 | set => this.Set((int)NetFxNativeImageSymbolFields.ApplicationFileRef, value); | ||
| 50 | } | ||
| 51 | |||
| 52 | public string ApplicationBaseDirectoryRef | ||
| 53 | { | ||
| 54 | get => this.Fields[(int)NetFxNativeImageSymbolFields.ApplicationBaseDirectoryRef].AsString(); | ||
| 55 | set => this.Set((int)NetFxNativeImageSymbolFields.ApplicationBaseDirectoryRef, value); | ||
| 56 | } | ||
| 57 | } | ||
| 58 | } \ No newline at end of file | ||
diff --git a/src/ext/NetFx/wixext/Symbols/NetfxSymbolDefinitions.cs b/src/ext/NetFx/wixext/Symbols/NetfxSymbolDefinitions.cs new file mode 100644 index 00000000..3c0f1176 --- /dev/null +++ b/src/ext/NetFx/wixext/Symbols/NetfxSymbolDefinitions.cs | |||
| @@ -0,0 +1,26 @@ | |||
| 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 | |||
| 3 | namespace WixToolset.Netfx.Symbols | ||
| 4 | { | ||
| 5 | using WixToolset.Data; | ||
| 6 | |||
| 7 | public static class NetfxSymbolDefinitionNames | ||
| 8 | { | ||
| 9 | public static string NetFxNativeImage { get; } = "NetFxNativeImage"; | ||
| 10 | } | ||
| 11 | |||
| 12 | public static class NetfxSymbolDefinitions | ||
| 13 | { | ||
| 14 | public static readonly IntermediateSymbolDefinition NetFxNativeImage = new IntermediateSymbolDefinition( | ||
| 15 | NetfxSymbolDefinitionNames.NetFxNativeImage, | ||
| 16 | new[] | ||
| 17 | { | ||
| 18 | new IntermediateFieldDefinition(nameof(NetFxNativeImageSymbolFields.FileRef), IntermediateFieldType.String), | ||
| 19 | new IntermediateFieldDefinition(nameof(NetFxNativeImageSymbolFields.Priority), IntermediateFieldType.Number), | ||
| 20 | new IntermediateFieldDefinition(nameof(NetFxNativeImageSymbolFields.Attributes), IntermediateFieldType.Number), | ||
| 21 | new IntermediateFieldDefinition(nameof(NetFxNativeImageSymbolFields.ApplicationFileRef), IntermediateFieldType.String), | ||
| 22 | new IntermediateFieldDefinition(nameof(NetFxNativeImageSymbolFields.ApplicationBaseDirectoryRef), IntermediateFieldType.String), | ||
| 23 | }, | ||
| 24 | typeof(NetFxNativeImageSymbol)); | ||
| 25 | } | ||
| 26 | } | ||
diff --git a/src/ext/NetFx/wixext/WixToolset.Netfx.wixext.csproj b/src/ext/NetFx/wixext/WixToolset.Netfx.wixext.csproj new file mode 100644 index 00000000..7c1d55c1 --- /dev/null +++ b/src/ext/NetFx/wixext/WixToolset.Netfx.wixext.csproj | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <!-- 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. --> | ||
| 3 | |||
| 4 | <Project Sdk="Microsoft.NET.Sdk"> | ||
| 5 | <PropertyGroup> | ||
| 6 | <TargetFramework>netstandard2.0</TargetFramework> | ||
| 7 | <DebugType>embedded</DebugType> | ||
| 8 | <RootNamespace>WixToolset.Netfx</RootNamespace> | ||
| 9 | <Description>WiX Toolset .NET Framework Extension</Description> | ||
| 10 | <Title>WiX Toolset .NET Framework Extension</Title> | ||
| 11 | <IncludeSymbols>true</IncludeSymbols> | ||
| 12 | </PropertyGroup> | ||
| 13 | |||
| 14 | <ItemGroup> | ||
| 15 | <EmbeddedResource Include="$(OutputPath)..\netfx.wixlib" /> | ||
| 16 | </ItemGroup> | ||
| 17 | |||
| 18 | <ItemGroup> | ||
| 19 | <ProjectReference Include="..\wixlib\netfx.wixproj" ReferenceOutputAssembly="false" Condition=" '$(NCrunch)'=='' " /> | ||
| 20 | </ItemGroup> | ||
| 21 | |||
| 22 | <ItemGroup> | ||
| 23 | <PackageReference Include="WixToolset.Data" Version="4.0.*" PrivateAssets="all" /> | ||
| 24 | <PackageReference Include="WixToolset.Extensibility" Version="4.0.*" PrivateAssets="all" /> | ||
| 25 | </ItemGroup> | ||
| 26 | |||
| 27 | <ItemGroup> | ||
| 28 | <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="all" /> | ||
| 29 | <PackageReference Include="Nerdbank.GitVersioning" Version="3.3.37" PrivateAssets="all" /> | ||
| 30 | </ItemGroup> | ||
| 31 | </Project> | ||
diff --git a/src/ext/NetFx/wixext/WixToolset.Netfx.wixext.nuspec b/src/ext/NetFx/wixext/WixToolset.Netfx.wixext.nuspec new file mode 100644 index 00000000..ba3eaade --- /dev/null +++ b/src/ext/NetFx/wixext/WixToolset.Netfx.wixext.nuspec | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | <?xml version="1.0"?> | ||
| 2 | <package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> | ||
| 3 | <metadata minClientVersion="4.0"> | ||
| 4 | <id>$id$</id> | ||
| 5 | <version>$version$</version> | ||
| 6 | <title>$title$</title> | ||
| 7 | <description>$description$</description> | ||
| 8 | <authors>$authors$</authors> | ||
| 9 | <license type="expression">MS-RL</license> | ||
| 10 | <requireLicenseAcceptance>false</requireLicenseAcceptance> | ||
| 11 | <copyright>$copyright$</copyright> | ||
| 12 | <projectUrl>$projectUrl$</projectUrl> | ||
| 13 | <repository type="$repositorytype$" url="$repositoryurl$" commit="$repositorycommit$" /> | ||
| 14 | </metadata> | ||
| 15 | |||
| 16 | <files> | ||
| 17 | <file src="$projectFolder$$id$.targets" target="build" /> | ||
| 18 | |||
| 19 | <file src="netstandard2.0\$id$.dll" target="tools" /> | ||
| 20 | |||
| 21 | <file src="ARM64\*.pdb" target="pdbs\ARM64" /> | ||
| 22 | <file src="x86\*.pdb" target="pdbs\x86" /> | ||
| 23 | <file src="x64\*.pdb" target="pdbs\x64" /> | ||
| 24 | </files> | ||
| 25 | </package> | ||
diff --git a/src/ext/NetFx/wixext/WixToolset.Netfx.wixext.targets b/src/ext/NetFx/wixext/WixToolset.Netfx.wixext.targets new file mode 100644 index 00000000..2ed9c488 --- /dev/null +++ b/src/ext/NetFx/wixext/WixToolset.Netfx.wixext.targets | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <!-- 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. --> | ||
| 3 | |||
| 4 | <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> | ||
| 5 | <PropertyGroup> | ||
| 6 | <WixToolsetNetfxWixextPath Condition=" '$(WixToolsetNetfxWixextPath)' == '' ">$(MSBuildThisFileDirectory)..\tools\WixToolset.Netfx.wixext.dll</WixToolsetNetfxWixextPath> | ||
| 7 | </PropertyGroup> | ||
| 8 | <ItemGroup> | ||
| 9 | <WixExtension Include="$(WixToolsetNetfxWixextPath)" /> | ||
| 10 | </ItemGroup> | ||
| 11 | </Project> | ||
diff --git a/src/ext/NetFx/wixext/WixToolset.Netfx.wixext.v3.ncrunchproject b/src/ext/NetFx/wixext/WixToolset.Netfx.wixext.v3.ncrunchproject new file mode 100644 index 00000000..93e4df3d --- /dev/null +++ b/src/ext/NetFx/wixext/WixToolset.Netfx.wixext.v3.ncrunchproject | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | <ProjectConfiguration> | ||
| 2 | <Settings> | ||
| 3 | <AdditionalFilesToIncludeForProject> | ||
| 4 | <Value>..\..\build\Debug\netfx.wixlib</Value> | ||
| 5 | </AdditionalFilesToIncludeForProject> | ||
| 6 | </Settings> | ||
| 7 | </ProjectConfiguration> \ No newline at end of file | ||
