diff options
Diffstat (limited to 'src')
27 files changed, 552 insertions, 153 deletions
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 @@ | |||
| 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 | Do NOT modify this file. Update the canonical version in Home\repo-template\src\Directory.Build.props | ||
| 5 | then update all of the repos. | ||
| 6 | --> | ||
| 7 | <Project> | ||
| 8 | <PropertyGroup> | ||
| 9 | <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
| 10 | <EnableSourceLink Condition=" '$(NCrunch)' == '1' ">false</EnableSourceLink> | ||
| 11 | <MSBuildWarningsAsMessages>MSB3246</MSBuildWarningsAsMessages> | ||
| 12 | |||
| 13 | <ProjectName Condition=" '$(ProjectName)' == '' ">$(MSBuildProjectName)</ProjectName> | ||
| 14 | <BaseOutputPath>$([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\build\))</BaseOutputPath> | ||
| 15 | <BaseIntermediateOutputPath>$(BaseOutputPath)obj\$(ProjectName)\</BaseIntermediateOutputPath> | ||
| 16 | <OutputPath>$(BaseOutputPath)$(Configuration)\</OutputPath> | ||
| 17 | |||
| 18 | <Authors>WiX Toolset Team</Authors> | ||
| 19 | <Company>WiX Toolset</Company> | ||
| 20 | <Copyright>Copyright (c) .NET Foundation and contributors. All rights reserved.</Copyright> | ||
| 21 | <PackageLicenseExpression>MS-RL</PackageLicenseExpression> | ||
| 22 | <Product>WiX Toolset</Product> | ||
| 23 | </PropertyGroup> | ||
| 24 | |||
| 25 | <Import Project="Cpp.Build.props" Condition=" Exists('Cpp.Build.props') And '$(MSBuildProjectExtension)'=='.vcxproj' " /> | ||
| 26 | <Import Project="Wix.Build.props" Condition=" Exists('Wix.Build.props') And '$(MSBuildProjectExtension)'=='.wixproj' " /> | ||
| 27 | <Import Project="Custom.Build.props" Condition=" Exists('Custom.Build.props') " /> | ||
| 28 | </Project> | ||
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 @@ | |||
| 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 | Do NOT modify this file. Update the canonical version in Home\repo-template\src\Directory.Build.targets | ||
| 5 | then update all of the repos. | ||
| 6 | --> | ||
| 7 | <!-- | ||
| 8 | Replace PackageReferences with ProjectReferences when the projects can be found in .sln. | ||
| 9 | See the original here: https://github.com/dotnet/sdk/issues/1151#issuecomment-385133284 | ||
| 10 | --> | ||
| 11 | <Project> | ||
| 12 | <PropertyGroup> | ||
| 13 | <ReplacePackageReferences>true</ReplacePackageReferences> | ||
| 14 | <TheSolutionPath Condition=" '$(NCrunch)'=='' ">$(SolutionPath)</TheSolutionPath> | ||
| 15 | <TheSolutionPath Condition=" '$(NCrunch)'=='1' ">$(NCrunchOriginalSolutionPath)</TheSolutionPath> | ||
| 16 | </PropertyGroup> | ||
| 17 | |||
| 18 | <Choose> | ||
| 19 | <When Condition="$(ReplacePackageReferences) AND '$(TheSolutionPath)' != '' AND '$(TheSolutionPath)' != '*undefined*' AND Exists('$(TheSolutionPath)')"> | ||
| 20 | |||
| 21 | <PropertyGroup> | ||
| 22 | <SolutionFileContent>$([System.IO.File]::ReadAllText($(TheSolutionPath)))</SolutionFileContent> | ||
| 23 | <SmartSolutionDir>$([System.IO.Path]::GetDirectoryName( $(TheSolutionPath) ))</SmartSolutionDir> | ||
| 24 | <RegexPattern>(?<="[PackageName]", ")(.*)(?=", ")</RegexPattern> | ||
| 25 | </PropertyGroup> | ||
| 26 | |||
| 27 | <ItemGroup> | ||
| 28 | <!-- Keep the identity of the PackageReference --> | ||
| 29 | <SmartPackageReference Include="@(PackageReference)"> | ||
| 30 | <PackageName>%(Identity)</PackageName> | ||
| 31 | <InSolution>$(SolutionFileContent.Contains('\%(Identity).csproj'))</InSolution> | ||
| 32 | </SmartPackageReference> | ||
| 33 | |||
| 34 | <!-- Filter them by mapping them to another ItemGroup using the WithMetadataValue item function --> | ||
| 35 | <PackageInSolution Include="@(SmartPackageReference->WithMetadataValue('InSolution', True))"> | ||
| 36 | <Pattern>$(RegexPattern.Replace('[PackageName]','%(PackageName)') )</Pattern> | ||
| 37 | <SmartPath>$([System.Text.RegularExpressions.Regex]::Match('$(SolutionFileContent)', '%(Pattern)'))</SmartPath> | ||
| 38 | </PackageInSolution> | ||
| 39 | |||
| 40 | <ProjectReference Include="@(PackageInSolution->'$(SmartSolutionDir)\%(SmartPath)' )"/> | ||
| 41 | |||
| 42 | <!-- Remove the package references that are now referenced as projects --> | ||
| 43 | <PackageReference Remove="@(PackageInSolution->'%(PackageName)' )"/> | ||
| 44 | </ItemGroup> | ||
| 45 | |||
| 46 | </When> | ||
| 47 | </Choose> | ||
| 48 | </Project> | ||
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 @@ | |||
| 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"> | ||
| 5 | <PropertyGroup> | ||
| 6 | <WixTargetsPath Condition=" '$(Configuration)' == 'Debug' And Exists('$(MSBuildThisFileDirectory)..\..\Tools\README.md') ">$(MSBuildThisFileDirectory)..\..\Tools\build\Debug\net461\wix.targets</WixTargetsPath> | ||
| 7 | </PropertyGroup> | ||
| 8 | </Project> | ||
diff --git a/src/test/WixToolsetTest.DifxApp/DifxAppExtensionFixture.cs b/src/test/WixToolsetTest.DifxApp/DifxAppExtensionFixture.cs new file mode 100644 index 00000000..dbe257fa --- /dev/null +++ b/src/test/WixToolsetTest.DifxApp/DifxAppExtensionFixture.cs | |||
| @@ -0,0 +1,36 @@ | |||
| 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 WixToolsetTest.DifxApp | ||
| 4 | { | ||
| 5 | using System.Linq; | ||
| 6 | using WixBuildTools.TestSupport; | ||
| 7 | using WixToolset.Core.TestPackage; | ||
| 8 | using WixToolset.DifxApp; | ||
| 9 | using Xunit; | ||
| 10 | |||
| 11 | public class DifxAppExtensionFixture | ||
| 12 | { | ||
| 13 | [Fact] | ||
| 14 | public void CanBuildUsingDriver() | ||
| 15 | { | ||
| 16 | var folder = TestData.Get(@"TestData\UsingDriver"); | ||
| 17 | var build = new Builder(folder, typeof(DifxAppExtensionFactory), new[] { folder }); | ||
| 18 | |||
| 19 | var results = build.BuildAndQuery(Build, "CustomAction"); | ||
| 20 | Assert.Equal(new[] | ||
| 21 | { | ||
| 22 | "CustomAction:MsiCleanupOnSuccess\t1\tDIFxApp.dll\tCleanupOnSuccess\t0", | ||
| 23 | "CustomAction:MsiInstallDrivers\t3073\tDIFxAppA.dll\tInstallDriverPackages\t0", | ||
| 24 | "CustomAction:MsiProcessDrivers\t1\tDIFxApp.dll\tProcessDriverPackages\t0", | ||
| 25 | "CustomAction:MsiRollbackInstall\t3329\tDIFxAppA.dll\tRollbackInstall\t0", | ||
| 26 | "CustomAction:MsiUninstallDrivers\t3073\tDIFxAppA.dll\tUninstallDriverPackages\t0", | ||
| 27 | }, results.OrderBy(s => s).ToArray()); | ||
| 28 | } | ||
| 29 | |||
| 30 | private static void Build(string[] args) | ||
| 31 | { | ||
| 32 | var result = WixRunner.Execute(args) | ||
| 33 | .AssertSuccess(); | ||
| 34 | } | ||
| 35 | } | ||
| 36 | } | ||
diff --git a/src/test/WixToolsetTest.DifxApp/TestData/UsingDriver/Package.en-us.wxl b/src/test/WixToolsetTest.DifxApp/TestData/UsingDriver/Package.en-us.wxl new file mode 100644 index 00000000..38c12ac1 --- /dev/null +++ b/src/test/WixToolsetTest.DifxApp/TestData/UsingDriver/Package.en-us.wxl | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | |||
| 3 | <!-- | ||
| 4 | This file contains the declaration of all the localizable strings. | ||
| 5 | --> | ||
| 6 | <WixLocalization xmlns="http://wixtoolset.org/schemas/v4/wxl" Culture="en-US"> | ||
| 7 | |||
| 8 | <String Id="DowngradeError">A newer version of [ProductName] is already installed.</String> | ||
| 9 | <String Id="FeatureTitle">MsiPackage</String> | ||
| 10 | |||
| 11 | </WixLocalization> | ||
diff --git a/src/test/WixToolsetTest.DifxApp/TestData/UsingDriver/Package.wxs b/src/test/WixToolsetTest.DifxApp/TestData/UsingDriver/Package.wxs new file mode 100644 index 00000000..cdc323ec --- /dev/null +++ b/src/test/WixToolsetTest.DifxApp/TestData/UsingDriver/Package.wxs | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
| 3 | <Product Id="*" Name="MsiPackage" Language="1033" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a"> | ||
| 4 | <Package InstallerVersion="200" Compressed="no" InstallScope="perMachine" /> | ||
| 5 | |||
| 6 | <MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeError)" /> | ||
| 7 | <MediaTemplate /> | ||
| 8 | |||
| 9 | <Feature Id="ProductFeature" Title="!(loc.FeatureTitle)"> | ||
| 10 | <ComponentGroupRef Id="ProductComponents" /> | ||
| 11 | </Feature> | ||
| 12 | </Product> | ||
| 13 | |||
| 14 | <Fragment> | ||
| 15 | <Directory Id="TARGETDIR" Name="SourceDir"> | ||
| 16 | <Directory Id="ProgramFilesFolder"> | ||
| 17 | <Directory Id="INSTALLFOLDER" Name="MsiPackage" /> | ||
| 18 | </Directory> | ||
| 19 | </Directory> | ||
| 20 | </Fragment> | ||
| 21 | </Wix> | ||
diff --git a/src/test/WixToolsetTest.DifxApp/TestData/UsingDriver/PackageComponents.wxs b/src/test/WixToolsetTest.DifxApp/TestData/UsingDriver/PackageComponents.wxs new file mode 100644 index 00000000..9609771a --- /dev/null +++ b/src/test/WixToolsetTest.DifxApp/TestData/UsingDriver/PackageComponents.wxs | |||
| @@ -0,0 +1,12 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" | ||
| 3 | xmlns:difxapp="http://wixtoolset.org/schemas/v4/wxs/difxapp"> | ||
| 4 | <Fragment> | ||
| 5 | <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> | ||
| 6 | <Component> | ||
| 7 | <File Source="example.txt" /> | ||
| 8 | <difxapp:Driver /> | ||
| 9 | </Component> | ||
| 10 | </ComponentGroup> | ||
| 11 | </Fragment> | ||
| 12 | </Wix> | ||
diff --git a/src/test/WixToolsetTest.DifxApp/TestData/UsingDriver/example.txt b/src/test/WixToolsetTest.DifxApp/TestData/UsingDriver/example.txt new file mode 100644 index 00000000..1b4ffe8a --- /dev/null +++ b/src/test/WixToolsetTest.DifxApp/TestData/UsingDriver/example.txt | |||
| @@ -0,0 +1 @@ | |||
| This is example.txt. \ No newline at end of file | |||
diff --git a/src/test/WixToolsetTest.DifxApp/WixToolsetTest.DifxApp.csproj b/src/test/WixToolsetTest.DifxApp/WixToolsetTest.DifxApp.csproj new file mode 100644 index 00000000..d2d0de50 --- /dev/null +++ b/src/test/WixToolsetTest.DifxApp/WixToolsetTest.DifxApp.csproj | |||
| @@ -0,0 +1,38 @@ | |||
| 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>netcoreapp2.1</TargetFramework> | ||
| 7 | <IsPackable>false</IsPackable> | ||
| 8 | </PropertyGroup> | ||
| 9 | |||
| 10 | <PropertyGroup> | ||
| 11 | <NoWarn>NU1701</NoWarn> | ||
| 12 | </PropertyGroup> | ||
| 13 | |||
| 14 | <ItemGroup> | ||
| 15 | <Content Include="TestData\UsingDriver\example.txt" CopyToOutputDirectory="PreserveNewest" /> | ||
| 16 | <Content Include="TestData\UsingDriver\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> | ||
| 17 | <Content Include="TestData\UsingDriver\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> | ||
| 18 | <Content Include="TestData\UsingDriver\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> | ||
| 19 | </ItemGroup> | ||
| 20 | |||
| 21 | <ItemGroup> | ||
| 22 | <ProjectReference Include="..\..\wixext\WixToolset.DifxApp.wixext.csproj" /> | ||
| 23 | </ItemGroup> | ||
| 24 | |||
| 25 | <ItemGroup> | ||
| 26 | <PackageReference Include="WixToolset.Core.TestPackage" Version="4.0.*" PrivateAssets="all" /> | ||
| 27 | </ItemGroup> | ||
| 28 | |||
| 29 | <ItemGroup> | ||
| 30 | <PackageReference Include="WixBuildTools.TestSupport" Version="4.0.*" /> | ||
| 31 | </ItemGroup> | ||
| 32 | |||
| 33 | <ItemGroup> | ||
| 34 | <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" /> | ||
| 35 | <PackageReference Include="xunit" Version="2.4.0" /> | ||
| 36 | <PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" /> | ||
| 37 | </ItemGroup> | ||
| 38 | </Project> | ||
diff --git a/src/wixext/DifxAppCompiler.cs b/src/wixext/DifxAppCompiler.cs index 63396932..98f36b3f 100644 --- a/src/wixext/DifxAppCompiler.cs +++ b/src/wixext/DifxAppCompiler.cs | |||
| @@ -1,26 +1,27 @@ | |||
| 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. | 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 | 2 | ||
| 3 | namespace WixToolset.Extensions | 3 | namespace WixToolset.DifxApp |
| 4 | { | 4 | { |
| 5 | using System; | 5 | using System; |
| 6 | using System.Collections.Generic; | 6 | using System.Collections.Generic; |
| 7 | using System.Xml.Linq; | 7 | using System.Xml.Linq; |
| 8 | using WixToolset.Data; | 8 | using WixToolset.Data; |
| 9 | using WixToolset.DifxApp.Tuples; | ||
| 9 | using WixToolset.Extensibility; | 10 | using WixToolset.Extensibility; |
| 10 | 11 | ||
| 11 | /// <summary> | 12 | /// <summary> |
| 12 | /// The compiler for the WiX Toolset Driver Install Frameworks for Applications Extension. | 13 | /// The compiler for the WiX Toolset Driver Install Frameworks for Applications Extension. |
| 13 | /// </summary> | 14 | /// </summary> |
| 14 | public sealed class DifxAppCompiler : CompilerExtension | 15 | public sealed class DifxAppCompiler : BaseCompilerExtension |
| 15 | { | 16 | { |
| 16 | private HashSet<string> components; | 17 | private HashSet<string> components; |
| 17 | 18 | ||
| 19 | public override XNamespace Namespace => "http://wixtoolset.org/schemas/v4/wxs/difxapp"; | ||
| 18 | /// <summary> | 20 | /// <summary> |
| 19 | /// Instantiate a new DifxAppCompiler. | 21 | /// Instantiate a new DifxAppCompiler. |
| 20 | /// </summary> | 22 | /// </summary> |
| 21 | public DifxAppCompiler() | 23 | public DifxAppCompiler() |
| 22 | { | 24 | { |
| 23 | this.Namespace = "http://wixtoolset.org/schemas/v4/wxs/difxapp"; | ||
| 24 | this.components = new HashSet<string>(); | 25 | this.components = new HashSet<string>(); |
| 25 | } | 26 | } |
| 26 | 27 | ||
| @@ -31,26 +32,27 @@ namespace WixToolset.Extensions | |||
| 31 | /// <param name="parentElement">Parent element of element to process.</param> | 32 | /// <param name="parentElement">Parent element of element to process.</param> |
| 32 | /// <param name="element">Element to process.</param> | 33 | /// <param name="element">Element to process.</param> |
| 33 | /// <param name="contextValues">Extra information about the context in which this element is being parsed.</param> | 34 | /// <param name="contextValues">Extra information about the context in which this element is being parsed.</param> |
| 34 | public override void ParseElement(XElement parentElement, XElement element, IDictionary<string, string> context) | 35 | public override void ParseElement(Intermediate intermediate, IntermediateSection section, XElement parentElement, XElement element, IDictionary<string, string> context) |
| 35 | { | 36 | { |
| 36 | switch (parentElement.Name.LocalName) | 37 | switch (parentElement.Name.LocalName) |
| 37 | { | 38 | { |
| 38 | case "Component": | 39 | case "Component": |
| 39 | string componentId = context["ComponentId"]; | 40 | string componentId = context["ComponentId"]; |
| 40 | string directoryId = context["DirectoryId"]; | 41 | string directoryId = context["DirectoryId"]; |
| 42 | bool componentWin64 = Boolean.Parse(context["Win64"]); | ||
| 41 | 43 | ||
| 42 | switch (element.Name.LocalName) | 44 | switch (element.Name.LocalName) |
| 43 | { | 45 | { |
| 44 | case "Driver": | 46 | case "Driver": |
| 45 | this.ParseDriverElement(element, componentId); | 47 | this.ParseDriverElement(intermediate, section, element, componentId, componentWin64); |
| 46 | break; | 48 | break; |
| 47 | default: | 49 | default: |
| 48 | this.Core.UnexpectedElement(parentElement, element); | 50 | this.ParseHelper.UnexpectedElement(parentElement, element); |
| 49 | break; | 51 | break; |
| 50 | } | 52 | } |
| 51 | break; | 53 | break; |
| 52 | default: | 54 | default: |
| 53 | this.Core.UnexpectedElement(parentElement, element); | 55 | this.ParseHelper.UnexpectedElement(parentElement, element); |
| 54 | break; | 56 | break; |
| 55 | } | 57 | } |
| 56 | } | 58 | } |
| @@ -60,9 +62,9 @@ namespace WixToolset.Extensions | |||
| 60 | /// </summary> | 62 | /// </summary> |
| 61 | /// <param name="node">Element to parse.</param> | 63 | /// <param name="node">Element to parse.</param> |
| 62 | /// <param name="componentId">Identifier for parent component.</param> | 64 | /// <param name="componentId">Identifier for parent component.</param> |
| 63 | private void ParseDriverElement(XElement node, string componentId) | 65 | private void ParseDriverElement(Intermediate intermediate, IntermediateSection section, XElement node, string componentId, bool win64) |
| 64 | { | 66 | { |
| 65 | SourceLineNumber sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); | 67 | SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node); |
| 66 | int attributes = 0; | 68 | int attributes = 0; |
| 67 | int sequence = CompilerConstants.IntegerNotSet; | 69 | int sequence = CompilerConstants.IntegerNotSet; |
| 68 | 70 | ||
| @@ -71,7 +73,7 @@ namespace WixToolset.Extensions | |||
| 71 | { | 73 | { |
| 72 | if (this.components.Contains(componentId)) | 74 | if (this.components.Contains(componentId)) |
| 73 | { | 75 | { |
| 74 | this.Core.OnMessage(WixErrors.TooManyElements(sourceLineNumbers, "Component", node.Name.LocalName, 1)); | 76 | this.Messaging.Write(ErrorMessages.TooManyElements(sourceLineNumbers, "Component", node.Name.LocalName, 1)); |
| 75 | } | 77 | } |
| 76 | else | 78 | else |
| 77 | { | 79 | { |
| @@ -86,62 +88,74 @@ namespace WixToolset.Extensions | |||
| 86 | switch (attrib.Name.LocalName) | 88 | switch (attrib.Name.LocalName) |
| 87 | { | 89 | { |
| 88 | case "AddRemovePrograms": | 90 | case "AddRemovePrograms": |
| 89 | if (YesNoType.No == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) | 91 | if (YesNoType.No == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) |
| 90 | { | 92 | { |
| 91 | attributes |= 0x4; | 93 | attributes |= 0x4; |
| 92 | } | 94 | } |
| 93 | break; | 95 | break; |
| 94 | case "DeleteFiles": | 96 | case "DeleteFiles": |
| 95 | if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) | 97 | if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) |
| 96 | { | 98 | { |
| 97 | attributes |= 0x10; | 99 | attributes |= 0x10; |
| 98 | } | 100 | } |
| 99 | break; | 101 | break; |
| 100 | case "ForceInstall": | 102 | case "ForceInstall": |
| 101 | if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) | 103 | if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) |
| 102 | { | 104 | { |
| 103 | attributes |= 0x1; | 105 | attributes |= 0x1; |
| 104 | } | 106 | } |
| 105 | break; | 107 | break; |
| 106 | case "Legacy": | 108 | case "Legacy": |
| 107 | if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) | 109 | if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) |
| 108 | { | 110 | { |
| 109 | attributes |= 0x8; | 111 | attributes |= 0x8; |
| 110 | } | 112 | } |
| 111 | break; | 113 | break; |
| 112 | case "PlugAndPlayPrompt": | 114 | case "PlugAndPlayPrompt": |
| 113 | if (YesNoType.No == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) | 115 | if (YesNoType.No == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) |
| 114 | { | 116 | { |
| 115 | attributes |= 0x2; | 117 | attributes |= 0x2; |
| 116 | } | 118 | } |
| 117 | break; | 119 | break; |
| 118 | case "Sequence": | 120 | case "Sequence": |
| 119 | sequence = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, int.MaxValue); | 121 | sequence = this.ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, int.MaxValue); |
| 120 | break; | 122 | break; |
| 121 | default: | 123 | default: |
| 122 | this.Core.UnexpectedAttribute(node, attrib); | 124 | this.ParseHelper.UnexpectedAttribute(node, attrib); |
| 123 | break; | 125 | break; |
| 124 | } | 126 | } |
| 125 | } | 127 | } |
| 126 | else | 128 | else |
| 127 | { | 129 | { |
| 128 | this.Core.ParseExtensionAttribute(node, attrib); | 130 | this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, node, attrib); |
| 129 | } | 131 | } |
| 130 | } | 132 | } |
| 131 | 133 | ||
| 132 | this.Core.ParseForExtensionElements(node); | 134 | this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, node); |
| 133 | 135 | ||
| 134 | if (!this.Core.EncounteredError) | 136 | if (!this.Messaging.EncounteredError) |
| 135 | { | 137 | { |
| 136 | Row row = this.Core.CreateRow(sourceLineNumbers, "MsiDriverPackages"); | 138 | switch (this.Context.Platform) |
| 137 | row[0] = componentId; | ||
| 138 | row[1] = attributes; | ||
| 139 | if (CompilerConstants.IntegerNotSet != sequence) | ||
| 140 | { | 139 | { |
| 141 | row[2] = sequence; | 140 | case Platform.X86: |
| 141 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "MsiProcessDrivers"); | ||
| 142 | break; | ||
| 143 | case Platform.X64: | ||
| 144 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "MsiProcessDrivers_x64"); | ||
| 145 | break; | ||
| 146 | case Platform.IA64: | ||
| 147 | case Platform.ARM: | ||
| 148 | this.Messaging.Write(ErrorMessages.UnsupportedPlatformForElement(sourceLineNumbers, this.Context.Platform.ToString(), node.Name.LocalName)); | ||
| 149 | break; | ||
| 142 | } | 150 | } |
| 143 | 151 | ||
| 144 | this.Core.CreateSimpleReference(sourceLineNumbers, "CustomAction", "MsiProcessDrivers"); | 152 | var row = (MsiDriverPackagesTuple)this.ParseHelper.CreateRow(section, sourceLineNumbers, "MsiDriverPackages"); |
| 153 | row.Set(0, componentId); | ||
| 154 | row.Set(1, attributes); | ||
| 155 | if (CompilerConstants.IntegerNotSet != sequence) | ||
| 156 | { | ||
| 157 | row.Set(2, sequence); | ||
| 158 | } | ||
| 145 | } | 159 | } |
| 146 | } | 160 | } |
| 147 | } | 161 | } |
diff --git a/src/wixext/DifxAppDecompiler.cs b/src/wixext/DifxAppDecompiler.cs index db42b3d0..e41d8b98 100644 --- a/src/wixext/DifxAppDecompiler.cs +++ b/src/wixext/DifxAppDecompiler.cs | |||
| @@ -1,7 +1,8 @@ | |||
| 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. | 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 | 2 | ||
| 3 | namespace WixToolset.Extensions | 3 | namespace WixToolset.DifxApp |
| 4 | { | 4 | { |
| 5 | #if TODO_CONSIDER_DECOMPILER | ||
| 5 | using System; | 6 | using System; |
| 6 | using System.Collections; | 7 | using System.Collections; |
| 7 | using System.Globalization; | 8 | using System.Globalization; |
| @@ -93,4 +94,5 @@ namespace WixToolset.Extensions | |||
| 93 | } | 94 | } |
| 94 | } | 95 | } |
| 95 | } | 96 | } |
| 97 | #endif | ||
| 96 | } | 98 | } |
diff --git a/src/wixext/DifxAppExtensionData.cs b/src/wixext/DifxAppExtensionData.cs index 266f5ee4..49e1354f 100644 --- a/src/wixext/DifxAppExtensionData.cs +++ b/src/wixext/DifxAppExtensionData.cs | |||
| @@ -1,43 +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. | 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 | 2 | ||
| 3 | namespace WixToolset.Extensions | 3 | namespace WixToolset.DifxApp |
| 4 | { | 4 | { |
| 5 | using System; | ||
| 6 | using System.Reflection; | ||
| 7 | using WixToolset.Data; | 5 | using WixToolset.Data; |
| 8 | using WixToolset.Extensibility; | 6 | using WixToolset.Extensibility; |
| 9 | 7 | ||
| 10 | /// <summary> | 8 | public sealed class DifxAppExtensionData : BaseExtensionData |
| 11 | /// The WiX Toolset Driver Install Frameworks for Applications Extension. | ||
| 12 | /// </summary> | ||
| 13 | public sealed class DifxAppExtensionData : ExtensionData | ||
| 14 | { | 9 | { |
| 15 | private static TableDefinitionCollection tableDefinitions; | 10 | public override string DefaultCulture => "en-US"; |
| 16 | 11 | ||
| 17 | /// <summary> | 12 | public override bool TryGetTupleDefinitionByName(string name, out IntermediateTupleDefinition tupleDefinition) |
| 18 | /// Gets the optional table definitions for this extension. | ||
| 19 | /// </summary> | ||
| 20 | /// <value>The optional table definitions for this extension.</value> | ||
| 21 | public override TableDefinitionCollection TableDefinitions | ||
| 22 | { | 13 | { |
| 23 | get | 14 | tupleDefinition = DifxAppTupleDefinitions.ByName(name); |
| 24 | { | 15 | return tupleDefinition != null; |
| 25 | return DifxAppExtensionData.GetExtensionTableDefinitions(); | ||
| 26 | } | ||
| 27 | } | 16 | } |
| 28 | 17 | ||
| 29 | /// <summary> | 18 | public override Intermediate GetLibrary(ITupleDefinitionCreator tupleDefinitions) |
| 30 | /// Internal mechanism to access the extension's table definitions. | ||
| 31 | /// </summary> | ||
| 32 | /// <returns>Extension's table definitions.</returns> | ||
| 33 | internal static TableDefinitionCollection GetExtensionTableDefinitions() | ||
| 34 | { | 19 | { |
| 35 | if (null == DifxAppExtensionData.tableDefinitions) | 20 | return Intermediate.Load(typeof(DifxAppExtensionData).Assembly, "WixToolset.DifxApp.difxapp.wixlib", tupleDefinitions); |
| 36 | { | ||
| 37 | DifxAppExtensionData.tableDefinitions = ExtensionData.LoadTableDefinitionHelper(Assembly.GetExecutingAssembly(), "WixToolset.Extensions.Data.tables.xml"); | ||
| 38 | } | ||
| 39 | |||
| 40 | return DifxAppExtensionData.tableDefinitions; | ||
| 41 | } | 21 | } |
| 42 | } | 22 | } |
| 43 | } | 23 | } |
diff --git a/src/wixext/DifxAppExtensionFactory.cs b/src/wixext/DifxAppExtensionFactory.cs new file mode 100644 index 00000000..4565ce17 --- /dev/null +++ b/src/wixext/DifxAppExtensionFactory.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.DifxApp | ||
| 4 | { | ||
| 5 | using System; | ||
| 6 | using System.Collections.Generic; | ||
| 7 | using WixToolset.Extensibility; | ||
| 8 | |||
| 9 | public class DifxAppExtensionFactory : BaseExtensionFactory | ||
| 10 | { | ||
| 11 | protected override IEnumerable<Type> ExtensionTypes => new[] | ||
| 12 | { | ||
| 13 | typeof(DifxAppCompiler), | ||
| 14 | typeof(DifxAppExtensionData), | ||
| 15 | typeof(DifxAppWindowsInstallerBackendBinderExtension), | ||
| 16 | }; | ||
| 17 | } | ||
| 18 | } | ||
diff --git a/src/wixext/DifxAppWindowsInstallerBackendBinderExtension.cs b/src/wixext/DifxAppWindowsInstallerBackendBinderExtension.cs new file mode 100644 index 00000000..4d81c134 --- /dev/null +++ b/src/wixext/DifxAppWindowsInstallerBackendBinderExtension.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.DifxApp | ||
| 4 | { | ||
| 5 | using System.Linq; | ||
| 6 | using System.Xml; | ||
| 7 | using WixToolset.Data.WindowsInstaller; | ||
| 8 | using WixToolset.Extensibility; | ||
| 9 | |||
| 10 | public class DifxAppWindowsInstallerBackendBinderExtension : BaseWindowsInstallerBackendBinderExtension | ||
| 11 | { | ||
| 12 | private static readonly TableDefinition[] Tables = LoadTables(); | ||
| 13 | |||
| 14 | protected override TableDefinition[] TableDefinitionsForTuples => Tables; | ||
| 15 | |||
| 16 | private static TableDefinition[] LoadTables() | ||
| 17 | { | ||
| 18 | using (var resourceStream = typeof(DifxAppWindowsInstallerBackendBinderExtension).Assembly.GetManifestResourceStream("WixToolset.DifxApp.tables.xml")) | ||
| 19 | using (var reader = XmlReader.Create(resourceStream)) | ||
| 20 | { | ||
| 21 | var tables = TableDefinitionCollection.Load(reader); | ||
| 22 | return tables.ToArray(); | ||
| 23 | } | ||
| 24 | } | ||
| 25 | } | ||
| 26 | } | ||
diff --git a/src/wixext/Tuples/DifxAppTupleDefinitions.cs b/src/wixext/Tuples/DifxAppTupleDefinitions.cs new file mode 100644 index 00000000..37dabb86 --- /dev/null +++ b/src/wixext/Tuples/DifxAppTupleDefinitions.cs | |||
| @@ -0,0 +1,39 @@ | |||
| 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.DifxApp | ||
| 4 | { | ||
| 5 | using System; | ||
| 6 | using WixToolset.Data; | ||
| 7 | |||
| 8 | public enum DifxAppTupleDefinitionType | ||
| 9 | { | ||
| 10 | MsiDriverPackages, | ||
| 11 | } | ||
| 12 | |||
| 13 | public static partial class DifxAppTupleDefinitions | ||
| 14 | { | ||
| 15 | public static readonly Version Version = new Version("4.0.0"); | ||
| 16 | |||
| 17 | public static IntermediateTupleDefinition ByName(string name) | ||
| 18 | { | ||
| 19 | if (!Enum.TryParse(name, out DifxAppTupleDefinitionType type)) | ||
| 20 | { | ||
| 21 | return null; | ||
| 22 | } | ||
| 23 | |||
| 24 | return ByType(type); | ||
| 25 | } | ||
| 26 | |||
| 27 | public static IntermediateTupleDefinition ByType(DifxAppTupleDefinitionType type) | ||
| 28 | { | ||
| 29 | switch (type) | ||
| 30 | { | ||
| 31 | case DifxAppTupleDefinitionType.MsiDriverPackages: | ||
| 32 | return DifxAppTupleDefinitions.MsiDriverPackages; | ||
| 33 | |||
| 34 | default: | ||
| 35 | throw new ArgumentOutOfRangeException(nameof(type)); | ||
| 36 | } | ||
| 37 | } | ||
| 38 | } | ||
| 39 | } | ||
diff --git a/src/wixext/Tuples/MsiDriverPackagesTuple.cs b/src/wixext/Tuples/MsiDriverPackagesTuple.cs new file mode 100644 index 00000000..aecc7e77 --- /dev/null +++ b/src/wixext/Tuples/MsiDriverPackagesTuple.cs | |||
| @@ -0,0 +1,63 @@ | |||
| 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.DifxApp | ||
| 4 | { | ||
| 5 | using WixToolset.Data; | ||
| 6 | using WixToolset.DifxApp.Tuples; | ||
| 7 | |||
| 8 | public static partial class DifxAppTupleDefinitions | ||
| 9 | { | ||
| 10 | public static readonly IntermediateTupleDefinition MsiDriverPackages = new IntermediateTupleDefinition( | ||
| 11 | DifxAppTupleDefinitionType.MsiDriverPackages.ToString(), | ||
| 12 | new[] | ||
| 13 | { | ||
| 14 | new IntermediateFieldDefinition(nameof(MsiDriverPackagesTupleFields.Component), IntermediateFieldType.String), | ||
| 15 | new IntermediateFieldDefinition(nameof(MsiDriverPackagesTupleFields.Flags), IntermediateFieldType.Number), | ||
| 16 | new IntermediateFieldDefinition(nameof(MsiDriverPackagesTupleFields.Sequence), IntermediateFieldType.Number), | ||
| 17 | }, | ||
| 18 | typeof(MsiDriverPackagesTuple)); | ||
| 19 | } | ||
| 20 | } | ||
| 21 | |||
| 22 | namespace WixToolset.DifxApp.Tuples | ||
| 23 | { | ||
| 24 | using WixToolset.Data; | ||
| 25 | |||
| 26 | public enum MsiDriverPackagesTupleFields | ||
| 27 | { | ||
| 28 | Component, | ||
| 29 | Flags, | ||
| 30 | Sequence, | ||
| 31 | } | ||
| 32 | |||
| 33 | public class MsiDriverPackagesTuple : IntermediateTuple | ||
| 34 | { | ||
| 35 | public MsiDriverPackagesTuple() : base(DifxAppTupleDefinitions.MsiDriverPackages, null, null) | ||
| 36 | { | ||
| 37 | } | ||
| 38 | |||
| 39 | public MsiDriverPackagesTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(DifxAppTupleDefinitions.MsiDriverPackages, sourceLineNumber, id) | ||
| 40 | { | ||
| 41 | } | ||
| 42 | |||
| 43 | public IntermediateField this[MsiDriverPackagesTupleFields index] => this.Fields[(int)index]; | ||
| 44 | |||
| 45 | public string Component | ||
| 46 | { | ||
| 47 | get => this.Fields[(int)MsiDriverPackagesTupleFields.Component].AsString(); | ||
| 48 | set => this.Set((int)MsiDriverPackagesTupleFields.Component, value); | ||
| 49 | } | ||
| 50 | |||
| 51 | public int Flags | ||
| 52 | { | ||
| 53 | get => this.Fields[(int)MsiDriverPackagesTupleFields.Flags].AsNumber(); | ||
| 54 | set => this.Set((int)MsiDriverPackagesTupleFields.Flags, value); | ||
| 55 | } | ||
| 56 | |||
| 57 | public int Sequence | ||
| 58 | { | ||
| 59 | get => this.Fields[(int)MsiDriverPackagesTupleFields.Sequence].AsNumber(); | ||
| 60 | set => this.Set((int)MsiDriverPackagesTupleFields.Sequence, value); | ||
| 61 | } | ||
| 62 | } | ||
| 63 | } \ No newline at end of file | ||
diff --git a/src/wixext/WixDifxAppExtension.csproj b/src/wixext/WixDifxAppExtension.csproj deleted file mode 100644 index 5e85c675..00000000 --- a/src/wixext/WixDifxAppExtension.csproj +++ /dev/null | |||
| @@ -1,47 +0,0 @@ | |||
| 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 | |||
| 5 | <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> | ||
| 6 | <PropertyGroup> | ||
| 7 | <ProjectGuid>{2256EFD7-E678-4485-818D-986D590068BE}</ProjectGuid> | ||
| 8 | <AssemblyName>WixDifxAppExtension</AssemblyName> | ||
| 9 | <OutputType>Library</OutputType> | ||
| 10 | <RootNamespace>WixToolset.Extensions</RootNamespace> | ||
| 11 | </PropertyGroup> | ||
| 12 | <ItemGroup> | ||
| 13 | <Compile Include="AssemblyInfo.cs" /> | ||
| 14 | <Compile Include="DifxAppCompiler.cs" /> | ||
| 15 | <Compile Include="DifxAppDecompiler.cs" /> | ||
| 16 | <Compile Include="DifxAppExtensionData.cs" /> | ||
| 17 | <EmbeddedFlattenedResource Include="Data\tables.xml"> | ||
| 18 | <LogicalName>$(RootNamespace).Data.tables.xml</LogicalName> | ||
| 19 | </EmbeddedFlattenedResource> | ||
| 20 | <EmbeddedFlattenedResource Include="Xsd\difxapp.xsd"> | ||
| 21 | <LogicalName>$(RootNamespace).Xsd.difxapp.xsd</LogicalName> | ||
| 22 | <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
| 23 | </EmbeddedFlattenedResource> | ||
| 24 | <XsdGenSource Include="Xsd\difxapp.xsd"> | ||
| 25 | <SubType>Designer</SubType> | ||
| 26 | <CommonNamespace>WixToolset.Data.Serialize</CommonNamespace> | ||
| 27 | <Namespace>WixToolset.Extensions.Serialize.DifxApp</Namespace> | ||
| 28 | </XsdGenSource> | ||
| 29 | </ItemGroup> | ||
| 30 | <ItemGroup> | ||
| 31 | <Reference Include="System" /> | ||
| 32 | <Reference Include="System.Xml" /> | ||
| 33 | <Reference Include="System.Xml.Linq" /> | ||
| 34 | <ProjectReference Include="..\..\..\libs\WixToolset.Data\WixToolset.Data.csproj" /> | ||
| 35 | <ProjectReference Include="..\..\..\libs\WixToolset.Extensibility\WixToolset.Extensibility.csproj" /> | ||
| 36 | <ProjectReference Include="..\..\..\tools\wix\Wix.csproj" /> | ||
| 37 | <ProjectReference Include="..\wixlib\DIFxAppExtension.wixproj"> | ||
| 38 | <Properties>Platform=x86</Properties> | ||
| 39 | <ReferenceOutputAssembly>false</ReferenceOutputAssembly> | ||
| 40 | </ProjectReference> | ||
| 41 | <ProjectReference Include="..\wixlib\DIFxAppExtension.wixproj"> | ||
| 42 | <Properties>Platform=x64</Properties> | ||
| 43 | <ReferenceOutputAssembly>false</ReferenceOutputAssembly> | ||
| 44 | </ProjectReference> | ||
| 45 | </ItemGroup> | ||
| 46 | <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), wix.proj))\tools\WixBuild.targets" /> | ||
| 47 | </Project> | ||
diff --git a/src/wixext/WixToolset.DifxApp.wixext.csproj b/src/wixext/WixToolset.DifxApp.wixext.csproj new file mode 100644 index 00000000..5717b42a --- /dev/null +++ b/src/wixext/WixToolset.DifxApp.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.DifxApp</RootNamespace> | ||
| 8 | <Description>WiX Toolset DIFxApp Extension</Description> | ||
| 9 | <Title>WiX Toolset DIFxApp Extension</Title> | ||
| 10 | <IsTool>true</IsTool> | ||
| 11 | <ContentTargetFolders>build</ContentTargetFolders> | ||
| 12 | </PropertyGroup> | ||
| 13 | <ItemGroup> | ||
| 14 | <Content Include="$(MSBuildThisFileName).targets" /> | ||
| 15 | <Content Include="difxapp.xsd" PackagePath="tools" /> | ||
| 16 | <EmbeddedResource Include="tables.xml" /> | ||
| 17 | <EmbeddedResource Include="$(OutputPath)..\difxapp.wixlib" /> | ||
| 18 | </ItemGroup> | ||
| 19 | <ItemGroup> | ||
| 20 | <PackageReference Include="WixToolset.Extensibility" Version="4.0.*" PrivateAssets="all" /> | ||
| 21 | </ItemGroup> | ||
| 22 | |||
| 23 | <ItemGroup> | ||
| 24 | <ProjectReference Include="..\wixlib\difxapp.wixproj" ReferenceOutputAssembly="false" Condition=" '$(NCrunch)'=='' " /> | ||
| 25 | </ItemGroup> | ||
| 26 | |||
| 27 | <ItemGroup> | ||
| 28 | <PackageReference Include="Nerdbank.GitVersioning" Version="2.1.65" PrivateAssets="all" /> | ||
| 29 | </ItemGroup> | ||
| 30 | </Project> | ||
diff --git a/src/wixext/WixToolset.DifxApp.wixext.targets b/src/wixext/WixToolset.DifxApp.wixext.targets new file mode 100644 index 00000000..b01d4116 --- /dev/null +++ b/src/wixext/WixToolset.DifxApp.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 | <WixToolsetDifxAppWixextPath Condition=" '$(WixToolsetDifxAppWixextPath)' == '' ">$(MSBuildThisFileDirectory)..\tools\WixToolset.DifxApp.wixext.dll</WixToolsetDifxAppWixextPath> | ||
| 7 | </PropertyGroup> | ||
| 8 | <ItemGroup> | ||
| 9 | <WixExtension Include="$(WixToolsetDifxAppWixextPath)" /> | ||
| 10 | </ItemGroup> | ||
| 11 | </Project> | ||
diff --git a/src/wixlib/DIFxAppExtension.wixproj b/src/wixlib/DIFxAppExtension.wixproj deleted file mode 100644 index f4a7eb74..00000000 --- a/src/wixlib/DIFxAppExtension.wixproj +++ /dev/null | |||
| @@ -1,30 +0,0 @@ | |||
| 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 | |||
| 5 | <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> | ||
| 6 | <PropertyGroup> | ||
| 7 | <ProjectGuid>{5066EB93-D8F7-4FAE-B687-024D7A81BD95}</ProjectGuid> | ||
| 8 | <OutputName>difxapp_$(Platform)</OutputName> | ||
| 9 | <OutputType>Library</OutputType> | ||
| 10 | <BindFiles>true</BindFiles> | ||
| 11 | <Pedantic>true</Pedantic> | ||
| 12 | <Cultures>en-us</Cultures> | ||
| 13 | </PropertyGroup> | ||
| 14 | |||
| 15 | <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), wix.proj))\tools\WixBuild.props" /> | ||
| 16 | |||
| 17 | <PropertyGroup> | ||
| 18 | <DefineConstants> | ||
| 19 | $(DefineConstants); | ||
| 20 | DIFxAppDll=$(ProjectDir)$(Platform)\DIFxApp.dll; | ||
| 21 | DIFxAppADll=$(ProjectDir)$(Platform)\DIFxAppA.dll; | ||
| 22 | </DefineConstants> | ||
| 23 | </PropertyGroup> | ||
| 24 | |||
| 25 | <ItemGroup> | ||
| 26 | <Compile Include="DIFxAppExtension.wxs" /> | ||
| 27 | </ItemGroup> | ||
| 28 | |||
| 29 | <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), wix.proj))\tools\WixBuild.targets" /> | ||
| 30 | </Project> | ||
diff --git a/src/wixlib/DIFxAppExtension.wxs b/src/wixlib/DIFxAppExtension.wxs deleted file mode 100644 index 44b0ce2c..00000000 --- a/src/wixlib/DIFxAppExtension.wxs +++ /dev/null | |||
| @@ -1,21 +0,0 @@ | |||
| 1 | <?xml version='1.0'?> | ||
| 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 | |||
| 5 | <Wix xmlns='http://wixtoolset.org/schemas/v4/wxs'> | ||
| 6 | <Fragment Id='DIFxAppCustomActions'> | ||
| 7 | <InstallExecuteSequence> | ||
| 8 | <Custom Action='MsiProcessDrivers' After='InstallFiles'>VersionNT > 400</Custom> | ||
| 9 | <Custom Action='MsiCleanupOnSuccess' After='InstallFinalize'>VersionNT > 400</Custom> | ||
| 10 | </InstallExecuteSequence> | ||
| 11 | |||
| 12 | <Binary Id='DIFxApp.dll' SourceFile='$(var.DIFxAppDll)'/> | ||
| 13 | <Binary Id='DIFxAppA.dll' SourceFile='$(var.DIFxAppADll)'/> | ||
| 14 | |||
| 15 | <CustomAction Id='MsiProcessDrivers' BinaryKey='DIFxApp.dll' DllEntry='ProcessDriverPackages' SuppressModularization='yes' Execute='immediate' /> | ||
| 16 | <CustomAction Id='MsiInstallDrivers' BinaryKey='DIFxAppA.dll' DllEntry='InstallDriverPackages' SuppressModularization='yes' Execute='deferred' Impersonate='no' /> | ||
| 17 | <CustomAction Id='MsiUninstallDrivers' BinaryKey='DIFxAppA.dll' DllEntry='UninstallDriverPackages' SuppressModularization='yes' Execute='deferred' Impersonate='no' /> | ||
| 18 | <CustomAction Id='MsiRollbackInstall' BinaryKey='DIFxAppA.dll' DllEntry='RollbackInstall' SuppressModularization='yes' Execute='rollback' Impersonate='no' /> | ||
| 19 | <CustomAction Id='MsiCleanupOnSuccess' BinaryKey='DIFxApp.dll' DllEntry='CleanupOnSuccess' SuppressModularization='yes' Execute='immediate' /> | ||
| 20 | </Fragment> | ||
| 21 | </Wix> | ||
diff --git a/src/wixlib/DifxAppExtension_Platform.wxi b/src/wixlib/DifxAppExtension_Platform.wxi new file mode 100644 index 00000000..7583f7ea --- /dev/null +++ b/src/wixlib/DifxAppExtension_Platform.wxi | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | <?xml version='1.0'?> | ||
| 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 | |||
| 5 | <Include xmlns='http://wixtoolset.org/schemas/v4/wxs'> | ||
| 6 | <?include caSuffix.wxi ?> | ||
| 7 | |||
| 8 | <Fragment> | ||
| 9 | <InstallExecuteSequence> | ||
| 10 | <Custom Action='MsiProcessDrivers' After='InstallFiles'>VersionNT > 400</Custom> | ||
| 11 | <Custom Action='MsiCleanupOnSuccess' After='InstallFinalize'>VersionNT > 400</Custom> | ||
| 12 | </InstallExecuteSequence> | ||
| 13 | |||
| 14 | <Binary Id='DIFxApp.dll$(var.Suffix)' SourceFile='$(var.platform)\DIFxApp.dll'/> | ||
| 15 | <Binary Id='DIFxAppA.dll$(var.Suffix)' SourceFile='$(var.platform)\DIFxAppA.dll'/> | ||
| 16 | |||
| 17 | <CustomAction Id='MsiProcessDrivers$(var.Suffix)' BinaryKey='DIFxApp.dll$(var.Suffix)' DllEntry='ProcessDriverPackages' SuppressModularization='yes' Execute='immediate' /> | ||
| 18 | <CustomAction Id='MsiInstallDrivers$(var.Suffix)' BinaryKey='DIFxAppA.dll$(var.Suffix)' DllEntry='InstallDriverPackages' SuppressModularization='yes' Execute='deferred' Impersonate='no' /> | ||
| 19 | <CustomAction Id='MsiUninstallDrivers$(var.Suffix)' BinaryKey='DIFxAppA.dll$(var.Suffix)' DllEntry='UninstallDriverPackages' SuppressModularization='yes' Execute='deferred' Impersonate='no' /> | ||
| 20 | <CustomAction Id='MsiRollbackInstall$(var.Suffix)' BinaryKey='DIFxAppA.dll$(var.Suffix)' DllEntry='RollbackInstall' SuppressModularization='yes' Execute='rollback' Impersonate='no' /> | ||
| 21 | <CustomAction Id='MsiCleanupOnSuccess$(var.Suffix)' BinaryKey='DIFxApp.dll$(var.Suffix)' DllEntry='CleanupOnSuccess' SuppressModularization='yes' Execute='immediate' /> | ||
| 22 | </Fragment> | ||
| 23 | </Include> | ||
diff --git a/src/wixlib/DifxAppExtension_x64.wxs b/src/wixlib/DifxAppExtension_x64.wxs new file mode 100644 index 00000000..3c534363 --- /dev/null +++ b/src/wixlib/DifxAppExtension_x64.wxs | |||
| @@ -0,0 +1,8 @@ | |||
| 1 | <?xml version="1.0"?> | ||
| 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 | |||
| 5 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
| 6 | <?define platform=x64 ?> | ||
| 7 | <?include DifxAppExtension_Platform.wxi ?> | ||
| 8 | </Wix> | ||
diff --git a/src/wixlib/DifxAppExtension_x86.wxs b/src/wixlib/DifxAppExtension_x86.wxs new file mode 100644 index 00000000..d352a272 --- /dev/null +++ b/src/wixlib/DifxAppExtension_x86.wxs | |||
| @@ -0,0 +1,8 @@ | |||
| 1 | <?xml version="1.0"?> | ||
| 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 | |||
| 5 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
| 6 | <?define platform=x86 ?> | ||
| 7 | <?include DifxAppExtension_Platform.wxi ?> | ||
| 8 | </Wix> | ||
diff --git a/src/wixlib/caSuffix.wxi b/src/wixlib/caSuffix.wxi new file mode 100644 index 00000000..a56a2393 --- /dev/null +++ b/src/wixlib/caSuffix.wxi | |||
| @@ -0,0 +1,28 @@ | |||
| 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 | <Include xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
| 5 | <?ifndef platform ?> | ||
| 6 | <?error Required value "platform" not defined in include caSuffix.wxi ?> | ||
| 7 | <?endif ?> | ||
| 8 | |||
| 9 | <?ifdef Suffix ?> | ||
| 10 | <?undef Suffix ?> | ||
| 11 | <?undef DeferredSuffix ?> | ||
| 12 | <?endif ?> | ||
| 13 | |||
| 14 | <?if $(var.platform)="x86" ?> | ||
| 15 | <?define Suffix="" ?> | ||
| 16 | <?define DeferredSuffix="" ?> | ||
| 17 | <?endif ?> | ||
| 18 | |||
| 19 | <?if $(var.platform)="x64" ?> | ||
| 20 | <?define Suffix="_x64" ?> | ||
| 21 | <?define DeferredSuffix="_64" ?> | ||
| 22 | <?endif ?> | ||
| 23 | |||
| 24 | <?if $(var.platform)="arm" ?> | ||
| 25 | <?define Suffix="_ARM" ?> | ||
| 26 | <?define DeferredSuffix="_ARM" ?> | ||
| 27 | <?endif ?> | ||
| 28 | </Include> | ||
diff --git a/src/wixlib/difxapp.wixproj b/src/wixlib/difxapp.wixproj new file mode 100644 index 00000000..9b414afd --- /dev/null +++ b/src/wixlib/difxapp.wixproj | |||
| @@ -0,0 +1,39 @@ | |||
| 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 | <Project DefaultTargets="Build" InitialTargets="EnsureWixToolsetInstalled" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="15.0"> | ||
| 4 | <Import Project="..\..\packages\WixToolset.MSBuild.4.0.0-build-0035\build\WixToolset.MSBuild.props" Condition="Exists('..\..\packages\WixToolset.MSBuild.4.0.0-build-0035\build\WixToolset.MSBuild.props')" /> | ||
| 5 | <Import Project="..\FindLocalWix.props" /> | ||
| 6 | <PropertyGroup> | ||
| 7 | <ProjectGuid>{5066EB93-D8F7-4FAE-B687-024D7A81BD95}</ProjectGuid> | ||
| 8 | <OutputName>difxapp</OutputName> | ||
| 9 | <OutputType>Library</OutputType> | ||
| 10 | <BindFiles>true</BindFiles> | ||
| 11 | <Pedantic>true</Pedantic> | ||
| 12 | <Cultures>en-us</Cultures> | ||
| 13 | </PropertyGroup> | ||
| 14 | |||
| 15 | <ItemGroup> | ||
| 16 | <Compile Include="DifxAppExtension_x64.wxs" /> | ||
| 17 | <Compile Include="DifxAppExtension_x86.wxs" /> | ||
| 18 | </ItemGroup> | ||
| 19 | |||
| 20 | <ItemGroup> | ||
| 21 | <None Include="caSuffix.wxi" /> | ||
| 22 | <None Include="DifxAppExtension_Platform.wxi" /> | ||
| 23 | <None Include="packages.config" /> | ||
| 24 | </ItemGroup> | ||
| 25 | |||
| 26 | <Import Project="$(WixTargetsPath)" Condition=" '$(WixTargetsPath)' != '' AND Exists('$(WixTargetsPath)') " /> | ||
| 27 | <Import Project="$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\wix.targets" Condition=" '$(WixTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\wix.targets') " /> | ||
| 28 | <Target Name="EnsureWixToolsetInstalled" Condition=" '$(WixTargetsImported)' != 'true' "> | ||
| 29 | <Error Text="WiX Toolset build tools (v4.0 or later) must be installed to build this project. To download the WiX Toolset, go to http://wixtoolset.org/releases/." /> | ||
| 30 | </Target> | ||
| 31 | <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> | ||
| 32 | <PropertyGroup> | ||
| 33 | <ErrorText>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}.</ErrorText> | ||
| 34 | </PropertyGroup> | ||
| 35 | <Error Condition="!Exists('..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets'))" /> | ||
| 36 | <Error Condition="!Exists('..\..\packages\WixToolset.MSBuild.4.0.0-build-0035\build\WixToolset.MSBuild.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.MSBuild.4.0.0-build-0035\build\WixToolset.MSBuild.props'))" /> | ||
| 37 | </Target> | ||
| 38 | <Import Project="..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets" Condition="Exists('..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets')" /> | ||
| 39 | </Project> | ||
diff --git a/src/wixlib/packages.config b/src/wixlib/packages.config new file mode 100644 index 00000000..7964daed --- /dev/null +++ b/src/wixlib/packages.config | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <packages> | ||
| 3 | <package id="Nerdbank.GitVersioning" version="2.1.65" developmentDependency="true" targetFramework="net40" /> | ||
| 4 | <package id="WixToolset.MSBuild" version="4.0.0-build-0035" developmentDependency="true" targetFramework="net40" /> | ||
| 5 | </packages> \ No newline at end of file | ||
