From 73e6559b809f5f5ae2041d22ec81479df0fe91f9 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sat, 2 Feb 2019 14:07:55 -0600 Subject: Integrate into latest v4. --- src/Cpp.Build.props | 104 +++++++++++++++++++++ src/Directory.Build.props | 28 ++++++ src/Directory.Build.targets | 48 ++++++++++ src/FindLocalWix.props | 8 ++ src/ca/directx.def | 2 +- src/ca/directx.vcxproj | 47 ---------- src/ca/directxca.vcxproj | 61 ++++++++++++ src/ca/packages.config | 5 + src/ca/precomp.h | 3 - .../DirectXExtensionFixture.cs | 32 +++++++ .../UsingPixelShaderVersion/Package.en-us.wxl | 11 +++ .../TestData/UsingPixelShaderVersion/Package.wxs | 22 +++++ .../UsingPixelShaderVersion/PackageComponents.wxs | 11 +++ .../TestData/UsingPixelShaderVersion/example.txt | 1 + .../WixToolsetTest.DirectX.csproj | 38 ++++++++ src/wixext/DirectXDecompiler.cs | 4 +- src/wixext/DirectXExtensionData.cs | 24 ++--- src/wixext/DirectXExtensionFactory.cs | 16 ++++ src/wixext/WixDirectXExtension.csproj | 31 ------ src/wixext/WixToolset.DirectX.wixext.csproj | 31 ++++++ src/wixext/WixToolset.DirectX.wixext.targets | 11 +++ src/wixlib/DirectXExtension.wixproj | 24 ----- src/wixlib/DirectXExtension.wxs | 4 +- src/wixlib/caerr.wxi | 96 +++++++++++++++++++ src/wixlib/directx.wixproj | 40 ++++++++ src/wixlib/packages.config | 5 + 26 files changed, 581 insertions(+), 126 deletions(-) create mode 100644 src/Cpp.Build.props create mode 100644 src/Directory.Build.props create mode 100644 src/Directory.Build.targets create mode 100644 src/FindLocalWix.props delete mode 100644 src/ca/directx.vcxproj create mode 100644 src/ca/directxca.vcxproj create mode 100644 src/ca/packages.config create mode 100644 src/test/WixToolsetTest.DirectX/DirectXExtensionFixture.cs create mode 100644 src/test/WixToolsetTest.DirectX/TestData/UsingPixelShaderVersion/Package.en-us.wxl create mode 100644 src/test/WixToolsetTest.DirectX/TestData/UsingPixelShaderVersion/Package.wxs create mode 100644 src/test/WixToolsetTest.DirectX/TestData/UsingPixelShaderVersion/PackageComponents.wxs create mode 100644 src/test/WixToolsetTest.DirectX/TestData/UsingPixelShaderVersion/example.txt create mode 100644 src/test/WixToolsetTest.DirectX/WixToolsetTest.DirectX.csproj create mode 100644 src/wixext/DirectXExtensionFactory.cs delete mode 100644 src/wixext/WixDirectXExtension.csproj create mode 100644 src/wixext/WixToolset.DirectX.wixext.csproj create mode 100644 src/wixext/WixToolset.DirectX.wixext.targets delete mode 100644 src/wixlib/DirectXExtension.wixproj create mode 100644 src/wixlib/caerr.wxi create mode 100644 src/wixlib/directx.wixproj create mode 100644 src/wixlib/packages.config (limited to 'src') diff --git a/src/Cpp.Build.props b/src/Cpp.Build.props new file mode 100644 index 00000000..0e00132b --- /dev/null +++ b/src/Cpp.Build.props @@ -0,0 +1,104 @@ + + + + + + Win32 + $(BaseIntermediateOutputPath)$(Configuration)\$(Platform)\ + $(OutputPath)$(Platform)\ + + + + $([Microsoft.Build.Utilities.ToolLocationHelper]::GetLatestSDKTargetPlatformVersion('Windows', '10.0')) + + + + + $(DisableSpecificCompilerWarnings) + Level4 + $(ProjectDir)inc;$(MSBuildProjectDirectory);$(IntDir);$(SqlCESdkIncludePath);$(ProjectAdditionalIncludeDirectories);%(AdditionalIncludeDirectories) + WIN32;_WINDOWS;_WIN32_MSI=500;_WIN32_WINNT=0x0501;$(ArmPreprocessorDefinitions);$(UnicodePreprocessorDefinitions);_CRT_STDIO_LEGACY_WIDE_SPECIFIERS;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions) + Use + precomp.h + StdCall + true + false + -YlprecompDefine + /Zc:threadSafeInit- %(AdditionalOptions) + true + + + $(ArmPreprocessorDefinitions);%(PreprocessorDefinitions) + $(ProjectAdditionalResourceIncludeDirectories);%(AdditionalIncludeDirectories) + + + $(OutDir);$(AdditionalMultiTargetLibraryPath);$(ProjectAdditionalLibraryDirectories);%(AdditionalLibraryDirectories) + + + $(ProjectSubSystem) + $(ProjectModuleDefinitionFile) + $(ResourceOnlyDll) + true + $(ProjectAdditionalLinkLibraries);advapi32.lib;comdlg32.lib;user32.lib;oleaut32.lib;gdi32.lib;shell32.lib;ole32.lib;version.lib;%(AdditionalDependencies) + $(OutDir);$(AdditionalMultiTargetLibraryPath);$(ArmLibraryDirectories);$(ProjectAdditionalLinkLibraryDirectories);%(AdditionalLibraryDirectories) + /IGNORE:4099 %(AdditionalOptions) + + + + + + NoExtensions + + + + + CDecl + + + + + OldStyle + true + true + + + + + Disabled + EnableFastChecks + _DEBUG;DEBUG;%(PreprocessorDefinitions) + MultiThreadedDebug + + + + + + MultiThreadedDebugDll + + + + + MinSpace + NDEBUG;%(PreprocessorDefinitions) + true + true + MultiThreaded + + + true + true + + + + + + MultiThreadedDll + + + + + $(LinkKeyFile) + $(LinkDelaySign) + + + diff --git a/src/Directory.Build.props b/src/Directory.Build.props new file mode 100644 index 00000000..a22f4470 --- /dev/null +++ b/src/Directory.Build.props @@ -0,0 +1,28 @@ + + + + + + Debug + false + MSB3246 + + $(MSBuildProjectName) + $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\build\)) + $(BaseOutputPath)obj\$(ProjectName)\ + $(BaseOutputPath)$(Configuration)\ + + WiX Toolset Team + WiX Toolset + Copyright (c) .NET Foundation and contributors. All rights reserved. + MS-RL + WiX Toolset + + + + + + diff --git a/src/Directory.Build.targets b/src/Directory.Build.targets new file mode 100644 index 00000000..dac7452a --- /dev/null +++ b/src/Directory.Build.targets @@ -0,0 +1,48 @@ + + + + + + + true + $(SolutionPath) + $(NCrunchOriginalSolutionPath) + + + + + + + $([System.IO.File]::ReadAllText($(TheSolutionPath))) + $([System.IO.Path]::GetDirectoryName( $(TheSolutionPath) )) + (?<="[PackageName]", ")(.*)(?=", ") + + + + + + %(Identity) + $(SolutionFileContent.Contains('\%(Identity).csproj')) + + + + + $(RegexPattern.Replace('[PackageName]','%(PackageName)') ) + $([System.Text.RegularExpressions.Regex]::Match('$(SolutionFileContent)', '%(Pattern)')) + + + + + + + + + + + diff --git a/src/FindLocalWix.props b/src/FindLocalWix.props new file mode 100644 index 00000000..a784e352 --- /dev/null +++ b/src/FindLocalWix.props @@ -0,0 +1,8 @@ + + + + + + $(MSBuildThisFileDirectory)..\..\Tools\build\Debug\net461\wix.targets + + diff --git a/src/ca/directx.def b/src/ca/directx.def index 5841db88..8f46f9a8 100644 --- a/src/ca/directx.def +++ b/src/ca/directx.def @@ -1,7 +1,7 @@ ; 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. -LIBRARY "directx" +LIBRARY "directxca" EXPORTS WixQueryDirectXCaps diff --git a/src/ca/directx.vcxproj b/src/ca/directx.vcxproj deleted file mode 100644 index e4020bcc..00000000 --- a/src/ca/directx.vcxproj +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - Debug - Win32 - - - Release - Win32 - - - - - {F72D34CA-48DA-4DFD-91A9-A0C78BEF6981} - DynamicLibrary - Unicode - directx - directx.def - - - - - - $(WixRoot)src\libs\dutil\inc;$(WixRoot)src\libs\wcautil - d3d9.lib;msi.lib;dutil.lib;wcautil.lib - - - - - - - - - - - - - - - - - - diff --git a/src/ca/directxca.vcxproj b/src/ca/directxca.vcxproj new file mode 100644 index 00000000..f3fb07a8 --- /dev/null +++ b/src/ca/directxca.vcxproj @@ -0,0 +1,61 @@ + + + + + + + + + + Debug + Win32 + + + Release + Win32 + + + + + {76542B28-0FFD-47D3-AD6A-D0F20FA875AC} + DynamicLibrary + v141 + Unicode + directxca + directx.def + WiX Toolset DirectX CustomAction + + + + + + + d3d9.lib;msi.lib + + + + + + Create + + + + + + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + diff --git a/src/ca/packages.config b/src/ca/packages.config new file mode 100644 index 00000000..b87f9ab4 --- /dev/null +++ b/src/ca/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/ca/precomp.h b/src/ca/precomp.h index 8480f2b2..75a15829 100644 --- a/src/ca/precomp.h +++ b/src/ca/precomp.h @@ -7,8 +7,5 @@ #include #include -#include "wixstrsafe.h" #include "wcautil.h" #include "strutil.h" - -#include "CustomMsiErrors.h" diff --git a/src/test/WixToolsetTest.DirectX/DirectXExtensionFixture.cs b/src/test/WixToolsetTest.DirectX/DirectXExtensionFixture.cs new file mode 100644 index 00000000..b11cb7fc --- /dev/null +++ b/src/test/WixToolsetTest.DirectX/DirectXExtensionFixture.cs @@ -0,0 +1,32 @@ +// 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 WixToolsetTest.DirectX +{ + using System.Linq; + using WixBuildTools.TestSupport; + using WixToolset.Core.TestPackage; + using WixToolset.DirectX; + using Xunit; + + public class DirectXExtensionFixture + { + [Fact] + public void CanBuildUsingPixelShaderVersion() + { + var folder = TestData.Get(@"TestData\UsingPixelShaderVersion"); + var build = new Builder(folder, typeof(DirectXExtensionFactory), new[] { folder }); + + var results = build.BuildAndQuery(Build, "CustomAction"); + Assert.Equal(new[] + { + "CustomAction:WixQueryDirectXCaps\t65\tDirectXCA\tWixQueryDirectXCaps\t0", + }, results.OrderBy(s => s).ToArray()); + } + + private static void Build(string[] args) + { + var result = WixRunner.Execute(args) + .AssertSuccess(); + } + } +} diff --git a/src/test/WixToolsetTest.DirectX/TestData/UsingPixelShaderVersion/Package.en-us.wxl b/src/test/WixToolsetTest.DirectX/TestData/UsingPixelShaderVersion/Package.en-us.wxl new file mode 100644 index 00000000..38c12ac1 --- /dev/null +++ b/src/test/WixToolsetTest.DirectX/TestData/UsingPixelShaderVersion/Package.en-us.wxl @@ -0,0 +1,11 @@ + + + + + + A newer version of [ProductName] is already installed. + MsiPackage + + diff --git a/src/test/WixToolsetTest.DirectX/TestData/UsingPixelShaderVersion/Package.wxs b/src/test/WixToolsetTest.DirectX/TestData/UsingPixelShaderVersion/Package.wxs new file mode 100644 index 00000000..68ff98fd --- /dev/null +++ b/src/test/WixToolsetTest.DirectX/TestData/UsingPixelShaderVersion/Package.wxs @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.DirectX/TestData/UsingPixelShaderVersion/PackageComponents.wxs b/src/test/WixToolsetTest.DirectX/TestData/UsingPixelShaderVersion/PackageComponents.wxs new file mode 100644 index 00000000..f3a2ae92 --- /dev/null +++ b/src/test/WixToolsetTest.DirectX/TestData/UsingPixelShaderVersion/PackageComponents.wxs @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.DirectX/TestData/UsingPixelShaderVersion/example.txt b/src/test/WixToolsetTest.DirectX/TestData/UsingPixelShaderVersion/example.txt new file mode 100644 index 00000000..1b4ffe8a --- /dev/null +++ b/src/test/WixToolsetTest.DirectX/TestData/UsingPixelShaderVersion/example.txt @@ -0,0 +1 @@ +This is example.txt. \ No newline at end of file diff --git a/src/test/WixToolsetTest.DirectX/WixToolsetTest.DirectX.csproj b/src/test/WixToolsetTest.DirectX/WixToolsetTest.DirectX.csproj new file mode 100644 index 00000000..8edce963 --- /dev/null +++ b/src/test/WixToolsetTest.DirectX/WixToolsetTest.DirectX.csproj @@ -0,0 +1,38 @@ + + + + + + netcoreapp2.1 + false + + + + NU1701 + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/wixext/DirectXDecompiler.cs b/src/wixext/DirectXDecompiler.cs index c8056c12..03f90163 100644 --- a/src/wixext/DirectXDecompiler.cs +++ b/src/wixext/DirectXDecompiler.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.DirectX { +#if TODO_CONSIDER_DECOMPILER using System; using System.Text; using WixToolset.Data; @@ -67,4 +68,5 @@ namespace WixToolset.Extensions } } } +#endif } diff --git a/src/wixext/DirectXExtensionData.cs b/src/wixext/DirectXExtensionData.cs index 828b087d..0221d104 100644 --- a/src/wixext/DirectXExtensionData.cs +++ b/src/wixext/DirectXExtensionData.cs @@ -1,34 +1,24 @@ // 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.DirectX { - using System; - using System.Reflection; using WixToolset.Data; using WixToolset.Extensibility; /// /// The WiX Toolset DirectX Extension. /// - public sealed class DirectXExtensionData : ExtensionData + public sealed class DirectXExtensionData : BaseExtensionData { /// - /// Gets the library associated with this extension. + /// Gets the default culture. /// - /// The table definitions to use while loading the library. - /// The loaded library. - public override Library GetLibrary(TableDefinitionCollection tableDefinitions) - { - return DirectXExtensionData.GetExtensionLibrary(tableDefinitions); - } + /// The default culture. + public override string DefaultCulture => "en-US"; - /// - /// 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.DirectX.wixlib", tableDefinitions); + return Intermediate.Load(typeof(DirectXExtensionData).Assembly, "WixToolset.DirectX.directx.wixlib", tupleDefinitions); } } } diff --git a/src/wixext/DirectXExtensionFactory.cs b/src/wixext/DirectXExtensionFactory.cs new file mode 100644 index 00000000..b3755ee9 --- /dev/null +++ b/src/wixext/DirectXExtensionFactory.cs @@ -0,0 +1,16 @@ +// 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.DirectX +{ + using System; + using System.Collections.Generic; + using WixToolset.Extensibility; + + public class DirectXExtensionFactory : BaseExtensionFactory + { + protected override IEnumerable ExtensionTypes => new[] + { + typeof(DirectXExtensionData), + }; + } +} diff --git a/src/wixext/WixDirectXExtension.csproj b/src/wixext/WixDirectXExtension.csproj deleted file mode 100644 index 577d36f3..00000000 --- a/src/wixext/WixDirectXExtension.csproj +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - {6182DBCA-146A-4F37-8406-3139BBE04636} - WixDirectXExtension - Library - WixToolset.Extensions - - - - - - - Data\DirectX.wixlib - - - - - - - - - - false - - - - diff --git a/src/wixext/WixToolset.DirectX.wixext.csproj b/src/wixext/WixToolset.DirectX.wixext.csproj new file mode 100644 index 00000000..a848ff9a --- /dev/null +++ b/src/wixext/WixToolset.DirectX.wixext.csproj @@ -0,0 +1,31 @@ + + + + + + netstandard2.0 + WixToolset.DirectX + WiX Toolset DirectX Extension + WiX Toolset DirectX Extension + true + build + + + + + + + + + + + + + + + + + + + + diff --git a/src/wixext/WixToolset.DirectX.wixext.targets b/src/wixext/WixToolset.DirectX.wixext.targets new file mode 100644 index 00000000..4e27a6da --- /dev/null +++ b/src/wixext/WixToolset.DirectX.wixext.targets @@ -0,0 +1,11 @@ + + + + + + $(MSBuildThisFileDirectory)..\tools\WixToolset.DirectX.wixext.dll + + + + + diff --git a/src/wixlib/DirectXExtension.wixproj b/src/wixlib/DirectXExtension.wixproj deleted file mode 100644 index e98970e9..00000000 --- a/src/wixlib/DirectXExtension.wixproj +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - {4D8DDEC7-AAAC-4A32-87D0-5992FE382ED9} - directx - Library - true - true - en-us - - - - - - - - - - - - diff --git a/src/wixlib/DirectXExtension.wxs b/src/wixlib/DirectXExtension.wxs index 022ea5a5..12a8bbb6 100644 --- a/src/wixlib/DirectXExtension.wxs +++ b/src/wixlib/DirectXExtension.wxs @@ -7,11 +7,11 @@ - + - + VersionNT > 400 diff --git a/src/wixlib/caerr.wxi b/src/wixlib/caerr.wxi new file mode 100644 index 00000000..141942f2 --- /dev/null +++ b/src/wixlib/caerr.wxi @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/wixlib/directx.wixproj b/src/wixlib/directx.wixproj new file mode 100644 index 00000000..4516133d --- /dev/null +++ b/src/wixlib/directx.wixproj @@ -0,0 +1,40 @@ + + + + + + + {4D8DDEC7-AAAC-4A32-87D0-5992FE382ED9} + directx + Library + true + true + en-us + + + + + + + + + + + directxca + {76542B28-0FFD-47D3-AD6A-D0F20FA875AC} + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + diff --git a/src/wixlib/packages.config b/src/wixlib/packages.config new file mode 100644 index 00000000..f3d424e1 --- /dev/null +++ b/src/wixlib/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file -- cgit v1.2.3-55-g6feb