diff options
| author | Rob Mensching <rob@firegiant.com> | 2021-05-03 17:00:34 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2021-05-03 17:00:34 -0700 |
| commit | 592c6e2f7407c291a7bf9ef4c8ce50da9798cc68 (patch) | |
| tree | af42d0518b91cdc31590884006a2624bf7cdf4ed /src/ext/UI/wixext | |
| parent | 0e7fa93306858a9adde5b64ede920492632ba9e6 (diff) | |
| download | wix-592c6e2f7407c291a7bf9ef4c8ce50da9798cc68.tar.gz wix-592c6e2f7407c291a7bf9ef4c8ce50da9798cc68.tar.bz2 wix-592c6e2f7407c291a7bf9ef4c8ce50da9798cc68.zip | |
Move UI.wixext into ext
Diffstat (limited to 'src/ext/UI/wixext')
| -rw-r--r-- | src/ext/UI/wixext/UIDecompiler.cs | 59 | ||||
| -rw-r--r-- | src/ext/UI/wixext/UIExtensionData.cs | 23 | ||||
| -rw-r--r-- | src/ext/UI/wixext/UIExtensionFactory.cs | 16 | ||||
| -rw-r--r-- | src/ext/UI/wixext/WixToolset.UI.wixext.csproj | 30 | ||||
| -rw-r--r-- | src/ext/UI/wixext/WixToolset.UI.wixext.nuspec | 23 | ||||
| -rw-r--r-- | src/ext/UI/wixext/WixToolset.UI.wixext.targets | 11 |
6 files changed, 162 insertions, 0 deletions
diff --git a/src/ext/UI/wixext/UIDecompiler.cs b/src/ext/UI/wixext/UIDecompiler.cs new file mode 100644 index 00000000..2493e7c7 --- /dev/null +++ b/src/ext/UI/wixext/UIDecompiler.cs | |||
| @@ -0,0 +1,59 @@ | |||
| 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 Wix = WixToolset.Data.Serialize; | ||
| 13 | |||
| 14 | /// <summary> | ||
| 15 | /// The decompiler for the WiX Toolset UI Extension. | ||
| 16 | /// </summary> | ||
| 17 | public sealed class UIDecompiler : DecompilerExtension | ||
| 18 | { | ||
| 19 | private bool removeLibraryRows; | ||
| 20 | |||
| 21 | /// <summary> | ||
| 22 | /// Get the extensions library to be removed. | ||
| 23 | /// </summary> | ||
| 24 | /// <param name="tableDefinitions">Table definitions for library.</param> | ||
| 25 | /// <returns>Library to remove from decompiled output.</returns> | ||
| 26 | public override Library GetLibraryToRemove(TableDefinitionCollection tableDefinitions) | ||
| 27 | { | ||
| 28 | return removeLibraryRows ? UIExtensionData.GetExtensionLibrary(tableDefinitions) : null; | ||
| 29 | } | ||
| 30 | |||
| 31 | /// <summary> | ||
| 32 | /// Called at the beginning of the decompilation of a database. | ||
| 33 | /// </summary> | ||
| 34 | /// <param name="tables">The collection of all tables.</param> | ||
| 35 | public override void Initialize(TableIndexedCollection tables) | ||
| 36 | { | ||
| 37 | Table propertyTable = tables["Property"]; | ||
| 38 | |||
| 39 | if (null != propertyTable) | ||
| 40 | { | ||
| 41 | foreach (Row row in propertyTable.Rows) | ||
| 42 | { | ||
| 43 | if ("WixUI_Mode" == (string)row[0]) | ||
| 44 | { | ||
| 45 | Wix.UIRef uiRef = new Wix.UIRef(); | ||
| 46 | |||
| 47 | uiRef.Id = String.Concat("WixUI_", (string)row[1]); | ||
| 48 | |||
| 49 | this.Core.RootElement.AddChild(uiRef); | ||
| 50 | this.removeLibraryRows = true; | ||
| 51 | |||
| 52 | break; | ||
| 53 | } | ||
| 54 | } | ||
| 55 | } | ||
| 56 | } | ||
| 57 | } | ||
| 58 | #endif | ||
| 59 | } | ||
diff --git a/src/ext/UI/wixext/UIExtensionData.cs b/src/ext/UI/wixext/UIExtensionData.cs new file mode 100644 index 00000000..32557029 --- /dev/null +++ b/src/ext/UI/wixext/UIExtensionData.cs | |||
| @@ -0,0 +1,23 @@ | |||
| 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.UI | ||
| 4 | { | ||
| 5 | using WixToolset.Data; | ||
| 6 | using WixToolset.Extensibility; | ||
| 7 | |||
| 8 | public sealed class UIExtensionData : BaseExtensionData | ||
| 9 | { | ||
| 10 | public override string DefaultCulture => "en-US"; | ||
| 11 | |||
| 12 | public override bool TryGetSymbolDefinitionByName(string name, out IntermediateSymbolDefinition symbolDefinition) | ||
| 13 | { | ||
| 14 | symbolDefinition = null; | ||
| 15 | return symbolDefinition != null; | ||
| 16 | } | ||
| 17 | |||
| 18 | public override Intermediate GetLibrary(ISymbolDefinitionCreator symbolDefinitions) | ||
| 19 | { | ||
| 20 | return Intermediate.Load(typeof(UIExtensionData).Assembly, "WixToolset.UI.ui.wixlib", symbolDefinitions); | ||
| 21 | } | ||
| 22 | } | ||
| 23 | } | ||
diff --git a/src/ext/UI/wixext/UIExtensionFactory.cs b/src/ext/UI/wixext/UIExtensionFactory.cs new file mode 100644 index 00000000..141aa39f --- /dev/null +++ b/src/ext/UI/wixext/UIExtensionFactory.cs | |||
| @@ -0,0 +1,16 @@ | |||
| 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.UI | ||
| 4 | { | ||
| 5 | using System; | ||
| 6 | using System.Collections.Generic; | ||
| 7 | using WixToolset.Extensibility; | ||
| 8 | |||
| 9 | public class UIExtensionFactory : BaseExtensionFactory | ||
| 10 | { | ||
| 11 | protected override IReadOnlyCollection<Type> ExtensionTypes => new[] | ||
| 12 | { | ||
| 13 | typeof(UIExtensionData), | ||
| 14 | }; | ||
| 15 | } | ||
| 16 | } | ||
diff --git a/src/ext/UI/wixext/WixToolset.UI.wixext.csproj b/src/ext/UI/wixext/WixToolset.UI.wixext.csproj new file mode 100644 index 00000000..67c949b2 --- /dev/null +++ b/src/ext/UI/wixext/WixToolset.UI.wixext.csproj | |||
| @@ -0,0 +1,30 @@ | |||
| 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 | <RootNamespace>WixToolset.UI</RootNamespace> | ||
| 8 | <Description>WiX Toolset UI Extension</Description> | ||
| 9 | <Title>WiX Toolset UI Extension</Title> | ||
| 10 | <DebugType>embedded</DebugType> | ||
| 11 | <IncludeSymbols>true</IncludeSymbols> | ||
| 12 | </PropertyGroup> | ||
| 13 | |||
| 14 | <ItemGroup> | ||
| 15 | <EmbeddedResource Include="$(OutputPath)..\ui.wixlib" /> | ||
| 16 | </ItemGroup> | ||
| 17 | |||
| 18 | <ItemGroup> | ||
| 19 | <ProjectReference Include="..\wixlib\ui.wixproj" ReferenceOutputAssembly="false" Condition=" '$(NCrunch)'=='' " /> | ||
| 20 | </ItemGroup> | ||
| 21 | |||
| 22 | <ItemGroup> | ||
| 23 | <PackageReference Include="WixToolset.Extensibility" Version="4.0.*" PrivateAssets="all" /> | ||
| 24 | </ItemGroup> | ||
| 25 | |||
| 26 | <ItemGroup> | ||
| 27 | <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" /> | ||
| 28 | <PackageReference Include="Nerdbank.GitVersioning" Version="3.3.37" PrivateAssets="All" /> | ||
| 29 | </ItemGroup> | ||
| 30 | </Project> | ||
diff --git a/src/ext/UI/wixext/WixToolset.UI.wixext.nuspec b/src/ext/UI/wixext/WixToolset.UI.wixext.nuspec new file mode 100644 index 00000000..51c9708e --- /dev/null +++ b/src/ext/UI/wixext/WixToolset.UI.wixext.nuspec | |||
| @@ -0,0 +1,23 @@ | |||
| 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="x86\*.pdb" target="pdbs\x86" /> | ||
| 22 | </files> | ||
| 23 | </package> | ||
diff --git a/src/ext/UI/wixext/WixToolset.UI.wixext.targets b/src/ext/UI/wixext/WixToolset.UI.wixext.targets new file mode 100644 index 00000000..b07a0886 --- /dev/null +++ b/src/ext/UI/wixext/WixToolset.UI.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 | <WixToolsetUIWixextPath Condition=" '$(WixToolsetUIWixextPath)' == '' ">$(MSBuildThisFileDirectory)..\tools\WixToolset.UI.wixext.dll</WixToolsetUIWixextPath> | ||
| 7 | </PropertyGroup> | ||
| 8 | <ItemGroup> | ||
| 9 | <WixExtension Include="$(WixToolsetUIWixextPath)" /> | ||
| 10 | </ItemGroup> | ||
| 11 | </Project> | ||
