diff options
Diffstat (limited to 'src')
34 files changed, 900 insertions, 0 deletions
diff --git a/src/ext/DifxApp/CSharp.Build.props b/src/ext/DifxApp/CSharp.Build.props new file mode 100644 index 00000000..b12f4c6e --- /dev/null +++ b/src/ext/DifxApp/CSharp.Build.props | |||
| @@ -0,0 +1,11 @@ | |||
| 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 | Do NOT modify this file. Update the canonical version in Home\repo-template\src\CSharp.Build.props | ||
| 4 | then update all of the repos. | ||
| 5 | --> | ||
| 6 | <Project> | ||
| 7 | <PropertyGroup> | ||
| 8 | <SignAssembly>true</SignAssembly> | ||
| 9 | <AssemblyOriginatorKeyFile>$([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)wix.snk))</AssemblyOriginatorKeyFile> | ||
| 10 | </PropertyGroup> | ||
| 11 | </Project> | ||
diff --git a/src/ext/DifxApp/DifxApp.wixext.sln b/src/ext/DifxApp/DifxApp.wixext.sln new file mode 100644 index 00000000..2b891405 --- /dev/null +++ b/src/ext/DifxApp/DifxApp.wixext.sln | |||
| @@ -0,0 +1,63 @@ | |||
| 1 | | ||
| 2 | Microsoft Visual Studio Solution File, Format Version 12.00 | ||
| 3 | # Visual Studio Version 16 | ||
| 4 | VisualStudioVersion = 16.0.30611.23 | ||
| 5 | MinimumVisualStudioVersion = 15.0.26124.0 | ||
| 6 | Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "difxapp", "src\wixlib\difxapp.wixproj", "{5066EB93-D8F7-4FAE-B687-024D7A81BD95}" | ||
| 7 | EndProject | ||
| 8 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolset.DifxApp.wixext", "src\wixext\WixToolset.DifxApp.wixext.csproj", "{2256EFD7-E678-4485-818D-986D590068BE}" | ||
| 9 | EndProject | ||
| 10 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolsetTest.DifxApp", "src\test\WixToolsetTest.DifxApp\WixToolsetTest.DifxApp.csproj", "{883D7BA3-1ADC-47AC-95B0-221BB0B7788D}" | ||
| 11 | EndProject | ||
| 12 | Global | ||
| 13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
| 14 | Debug|Any CPU = Debug|Any CPU | ||
| 15 | Debug|x64 = Debug|x64 | ||
| 16 | Debug|x86 = Debug|x86 | ||
| 17 | Release|Any CPU = Release|Any CPU | ||
| 18 | Release|x64 = Release|x64 | ||
| 19 | Release|x86 = Release|x86 | ||
| 20 | EndGlobalSection | ||
| 21 | GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
| 22 | {5066EB93-D8F7-4FAE-B687-024D7A81BD95}.Debug|Any CPU.ActiveCfg = Debug|x86 | ||
| 23 | {5066EB93-D8F7-4FAE-B687-024D7A81BD95}.Debug|Any CPU.Build.0 = Debug|x86 | ||
| 24 | {5066EB93-D8F7-4FAE-B687-024D7A81BD95}.Debug|x64.ActiveCfg = Debug|x86 | ||
| 25 | {5066EB93-D8F7-4FAE-B687-024D7A81BD95}.Debug|x86.ActiveCfg = Debug|x86 | ||
| 26 | {5066EB93-D8F7-4FAE-B687-024D7A81BD95}.Debug|x86.Build.0 = Debug|x86 | ||
| 27 | {5066EB93-D8F7-4FAE-B687-024D7A81BD95}.Release|Any CPU.ActiveCfg = Release|x86 | ||
| 28 | {5066EB93-D8F7-4FAE-B687-024D7A81BD95}.Release|Any CPU.Build.0 = Release|x86 | ||
| 29 | {5066EB93-D8F7-4FAE-B687-024D7A81BD95}.Release|x64.ActiveCfg = Release|x86 | ||
| 30 | {5066EB93-D8F7-4FAE-B687-024D7A81BD95}.Release|x86.ActiveCfg = Release|x86 | ||
| 31 | {5066EB93-D8F7-4FAE-B687-024D7A81BD95}.Release|x86.Build.0 = Release|x86 | ||
| 32 | {2256EFD7-E678-4485-818D-986D590068BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| 33 | {2256EFD7-E678-4485-818D-986D590068BE}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| 34 | {2256EFD7-E678-4485-818D-986D590068BE}.Debug|x64.ActiveCfg = Debug|Any CPU | ||
| 35 | {2256EFD7-E678-4485-818D-986D590068BE}.Debug|x64.Build.0 = Debug|Any CPU | ||
| 36 | {2256EFD7-E678-4485-818D-986D590068BE}.Debug|x86.ActiveCfg = Debug|Any CPU | ||
| 37 | {2256EFD7-E678-4485-818D-986D590068BE}.Debug|x86.Build.0 = Debug|Any CPU | ||
| 38 | {2256EFD7-E678-4485-818D-986D590068BE}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| 39 | {2256EFD7-E678-4485-818D-986D590068BE}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| 40 | {2256EFD7-E678-4485-818D-986D590068BE}.Release|x64.ActiveCfg = Release|Any CPU | ||
| 41 | {2256EFD7-E678-4485-818D-986D590068BE}.Release|x64.Build.0 = Release|Any CPU | ||
| 42 | {2256EFD7-E678-4485-818D-986D590068BE}.Release|x86.ActiveCfg = Release|Any CPU | ||
| 43 | {2256EFD7-E678-4485-818D-986D590068BE}.Release|x86.Build.0 = Release|Any CPU | ||
| 44 | {883D7BA3-1ADC-47AC-95B0-221BB0B7788D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| 45 | {883D7BA3-1ADC-47AC-95B0-221BB0B7788D}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| 46 | {883D7BA3-1ADC-47AC-95B0-221BB0B7788D}.Debug|x64.ActiveCfg = Debug|Any CPU | ||
| 47 | {883D7BA3-1ADC-47AC-95B0-221BB0B7788D}.Debug|x64.Build.0 = Debug|Any CPU | ||
| 48 | {883D7BA3-1ADC-47AC-95B0-221BB0B7788D}.Debug|x86.ActiveCfg = Debug|Any CPU | ||
| 49 | {883D7BA3-1ADC-47AC-95B0-221BB0B7788D}.Debug|x86.Build.0 = Debug|Any CPU | ||
| 50 | {883D7BA3-1ADC-47AC-95B0-221BB0B7788D}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| 51 | {883D7BA3-1ADC-47AC-95B0-221BB0B7788D}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| 52 | {883D7BA3-1ADC-47AC-95B0-221BB0B7788D}.Release|x64.ActiveCfg = Release|Any CPU | ||
| 53 | {883D7BA3-1ADC-47AC-95B0-221BB0B7788D}.Release|x64.Build.0 = Release|Any CPU | ||
| 54 | {883D7BA3-1ADC-47AC-95B0-221BB0B7788D}.Release|x86.ActiveCfg = Release|Any CPU | ||
| 55 | {883D7BA3-1ADC-47AC-95B0-221BB0B7788D}.Release|x86.Build.0 = Release|Any CPU | ||
| 56 | EndGlobalSection | ||
| 57 | GlobalSection(SolutionProperties) = preSolution | ||
| 58 | HideSolutionNode = FALSE | ||
| 59 | EndGlobalSection | ||
| 60 | GlobalSection(ExtensibilityGlobals) = postSolution | ||
| 61 | SolutionGuid = {60A3EA0F-9313-47F8-BF6B-74478A57B577} | ||
| 62 | EndGlobalSection | ||
| 63 | EndGlobal | ||
diff --git a/src/ext/DifxApp/Directory.Build.props b/src/ext/DifxApp/Directory.Build.props new file mode 100644 index 00000000..f83cc154 --- /dev/null +++ b/src/ext/DifxApp/Directory.Build.props | |||
| @@ -0,0 +1,29 @@ | |||
| 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="CSharp.Build.props" Condition=" '$(MSBuildProjectExtension)'=='.csproj' and Exists('CSharp.Build.props') " /> | ||
| 26 | <Import Project="Cpp.Build.props" Condition=" Exists('Cpp.Build.props') And '$(MSBuildProjectExtension)'=='.vcxproj' " /> | ||
| 27 | <Import Project="Wix.Build.props" Condition=" Exists('Wix.Build.props') And '$(MSBuildProjectExtension)'=='.wixproj' " /> | ||
| 28 | <Import Project="Custom.Build.props" Condition=" Exists('Custom.Build.props') " /> | ||
| 29 | </Project> | ||
diff --git a/src/ext/DifxApp/Directory.Build.targets b/src/ext/DifxApp/Directory.Build.targets new file mode 100644 index 00000000..dac7452a --- /dev/null +++ b/src/ext/DifxApp/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/ext/DifxApp/README.md b/src/ext/DifxApp/README.md new file mode 100644 index 00000000..49f30df8 --- /dev/null +++ b/src/ext/DifxApp/README.md | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | # DifxApp.wixext | ||
| 2 | WixToolset.DifxApp.wixext - DIFxApp WiX Toolset Extension | ||
diff --git a/src/ext/DifxApp/appveyor.cmd b/src/ext/DifxApp/appveyor.cmd new file mode 100644 index 00000000..ec37397e --- /dev/null +++ b/src/ext/DifxApp/appveyor.cmd | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | @setlocal | ||
| 2 | @pushd %~dp0 | ||
| 3 | |||
| 4 | nuget restore || exit /b | ||
| 5 | |||
| 6 | msbuild -p:Configuration=Release -t:Restore || exit /b | ||
| 7 | |||
| 8 | msbuild -p:Configuration=Release src\test\WixToolsetTest.DifxApp\WixToolsetTest.DifxApp.csproj || exit /b | ||
| 9 | dotnet test -c Release --no-build src\test\WixToolsetTest.DifxApp || exit /b | ||
| 10 | |||
| 11 | msbuild -p:Configuration=Release -t:Pack src\wixext\WixToolset.DifxApp.wixext.csproj || exit /b | ||
| 12 | |||
| 13 | @popd | ||
| 14 | @endlocal \ No newline at end of file | ||
diff --git a/src/ext/DifxApp/appveyor.yml b/src/ext/DifxApp/appveyor.yml new file mode 100644 index 00000000..7c686b04 --- /dev/null +++ b/src/ext/DifxApp/appveyor.yml | |||
| @@ -0,0 +1,40 @@ | |||
| 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 | # Do NOT modify this file. Update the canonical version in Home\repo-template\src\appveyor.yml | ||
| 4 | # then update all of the repos. | ||
| 5 | |||
| 6 | branches: | ||
| 7 | only: | ||
| 8 | - master | ||
| 9 | - develop | ||
| 10 | |||
| 11 | image: Visual Studio 2019 | ||
| 12 | |||
| 13 | version: 0.0.0.{build} | ||
| 14 | configuration: Release | ||
| 15 | |||
| 16 | environment: | ||
| 17 | DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true | ||
| 18 | DOTNET_CLI_TELEMETRY_OPTOUT: 1 | ||
| 19 | NUGET_XMLDOC_MODE: skip | ||
| 20 | |||
| 21 | build_script: | ||
| 22 | - appveyor.cmd | ||
| 23 | |||
| 24 | pull_requests: | ||
| 25 | do_not_increment_build_number: true | ||
| 26 | |||
| 27 | nuget: | ||
| 28 | disable_publish_on_pr: true | ||
| 29 | |||
| 30 | skip_branch_with_pr: true | ||
| 31 | skip_tags: true | ||
| 32 | |||
| 33 | artifacts: | ||
| 34 | - path: build\Release\**\*.nupkg | ||
| 35 | name: nuget | ||
| 36 | |||
| 37 | notifications: | ||
| 38 | - provider: Slack | ||
| 39 | incoming_webhook: | ||
| 40 | secure: p5xuu+4x2JHfwGDMDe5KcG1k7gZxqYc4jWVwvyNZv5cvkubPD2waJs5yXMAXZNN7Z63/3PWHb7q4KoY/99AjauYa1nZ4c5qYqRPFRBKTHfA= | ||
diff --git a/src/ext/DifxApp/nuget.config b/src/ext/DifxApp/nuget.config new file mode 100644 index 00000000..db7aba29 --- /dev/null +++ b/src/ext/DifxApp/nuget.config | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <configuration> | ||
| 3 | <packageSources> | ||
| 4 | <clear /> | ||
| 5 | <add key="wixtoolset-burn" value="https://ci.appveyor.com/nuget/wixtoolset-burn" /> | ||
| 6 | <add key="wixtoolset-data" value="https://ci.appveyor.com/nuget/wixtoolset-data" /> | ||
| 7 | <add key="wixtoolset-extensibility" value="https://ci.appveyor.com/nuget/wixtoolset-extensibility" /> | ||
| 8 | <add key="wixtoolset-core" value="https://ci.appveyor.com/nuget/wixtoolset-core" /> | ||
| 9 | <add key="wixtoolset-core-native" value="https://ci.appveyor.com/nuget/wixtoolset-core-native" /> | ||
| 10 | <add key="wixtoolset-dtf" value="https://ci.appveyor.com/nuget/wixtoolset-dtf" /> | ||
| 11 | <add key="wixtoolset-dutil" value="https://ci.appveyor.com/nuget/wixtoolset-dutil" /> | ||
| 12 | <add key="wixtoolset-wcautil" value="https://ci.appveyor.com/nuget/wixtoolset-wcautil" /> | ||
| 13 | <add key="wixtoolset-tools" value="https://ci.appveyor.com/nuget/wixtoolset-tools" /> | ||
| 14 | <add key="wixbuildtools" value="https://ci.appveyor.com/nuget/wixbuildtools" /> | ||
| 15 | <add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" /> | ||
| 16 | </packageSources> | ||
| 17 | </configuration> \ No newline at end of file | ||
diff --git a/src/ext/DifxApp/test/WixToolsetTest.DifxApp/DifxAppExtensionFixture.cs b/src/ext/DifxApp/test/WixToolsetTest.DifxApp/DifxAppExtensionFixture.cs new file mode 100644 index 00000000..f5166453 --- /dev/null +++ b/src/ext/DifxApp/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\t", | ||
| 23 | "CustomAction:MsiInstallDrivers\t3073\tDIFxAppA.dll\tInstallDriverPackages\t", | ||
| 24 | "CustomAction:MsiProcessDrivers\t1\tDIFxApp.dll\tProcessDriverPackages\t", | ||
| 25 | "CustomAction:MsiRollbackInstall\t3329\tDIFxAppA.dll\tRollbackInstall\t", | ||
| 26 | "CustomAction:MsiUninstallDrivers\t3073\tDIFxAppA.dll\tUninstallDriverPackages\t", | ||
| 27 | }, results); | ||
| 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/ext/DifxApp/test/WixToolsetTest.DifxApp/TestData/UsingDriver/Package.en-us.wxl b/src/ext/DifxApp/test/WixToolsetTest.DifxApp/TestData/UsingDriver/Package.en-us.wxl new file mode 100644 index 00000000..38c12ac1 --- /dev/null +++ b/src/ext/DifxApp/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/ext/DifxApp/test/WixToolsetTest.DifxApp/TestData/UsingDriver/Package.wxs b/src/ext/DifxApp/test/WixToolsetTest.DifxApp/TestData/UsingDriver/Package.wxs new file mode 100644 index 00000000..411893bc --- /dev/null +++ b/src/ext/DifxApp/test/WixToolsetTest.DifxApp/TestData/UsingDriver/Package.wxs | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
| 2 | <Package Name="MsiPackage" Language="1033" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a"> | ||
| 3 | <MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeError)" /> | ||
| 4 | |||
| 5 | <Feature Id="ProductFeature" Title="!(loc.FeatureTitle)"> | ||
| 6 | <ComponentGroupRef Id="ProductComponents" /> | ||
| 7 | </Feature> | ||
| 8 | </Package> | ||
| 9 | |||
| 10 | <Fragment> | ||
| 11 | <StandardDirectory Id="ProgramFilesFolder"> | ||
| 12 | <Directory Id="INSTALLFOLDER" Name="MsiPackage" /> | ||
| 13 | </StandardDirectory> | ||
| 14 | </Fragment> | ||
| 15 | </Wix> | ||
diff --git a/src/ext/DifxApp/test/WixToolsetTest.DifxApp/TestData/UsingDriver/PackageComponents.wxs b/src/ext/DifxApp/test/WixToolsetTest.DifxApp/TestData/UsingDriver/PackageComponents.wxs new file mode 100644 index 00000000..9609771a --- /dev/null +++ b/src/ext/DifxApp/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/ext/DifxApp/test/WixToolsetTest.DifxApp/TestData/UsingDriver/example.txt b/src/ext/DifxApp/test/WixToolsetTest.DifxApp/TestData/UsingDriver/example.txt new file mode 100644 index 00000000..1b4ffe8a --- /dev/null +++ b/src/ext/DifxApp/test/WixToolsetTest.DifxApp/TestData/UsingDriver/example.txt | |||
| @@ -0,0 +1 @@ | |||
| This is example.txt. \ No newline at end of file | |||
diff --git a/src/ext/DifxApp/test/WixToolsetTest.DifxApp/WixToolsetTest.DifxApp.csproj b/src/ext/DifxApp/test/WixToolsetTest.DifxApp/WixToolsetTest.DifxApp.csproj new file mode 100644 index 00000000..e205d24a --- /dev/null +++ b/src/ext/DifxApp/test/WixToolsetTest.DifxApp/WixToolsetTest.DifxApp.csproj | |||
| @@ -0,0 +1,41 @@ | |||
| 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>netcoreapp3.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" Version="4.0.*" /> | ||
| 27 | <PackageReference Include="WixToolset.Core.Burn" Version="4.0.*" /> | ||
| 28 | <PackageReference Include="WixToolset.Core.WindowsInstaller" Version="4.0.*" /> | ||
| 29 | <PackageReference Include="WixToolset.Core.TestPackage" Version="4.0.*" /> | ||
| 30 | </ItemGroup> | ||
| 31 | |||
| 32 | <ItemGroup> | ||
| 33 | <PackageReference Include="WixBuildTools.TestSupport" Version="4.0.*" /> | ||
| 34 | </ItemGroup> | ||
| 35 | |||
| 36 | <ItemGroup> | ||
| 37 | <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" /> | ||
| 38 | <PackageReference Include="xunit" Version="2.4.1" /> | ||
| 39 | <PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" PrivateAssets="All" /> | ||
| 40 | </ItemGroup> | ||
| 41 | </Project> | ||
diff --git a/src/ext/DifxApp/wix.snk b/src/ext/DifxApp/wix.snk new file mode 100644 index 00000000..3908a66a --- /dev/null +++ b/src/ext/DifxApp/wix.snk | |||
| Binary files differ | |||
diff --git a/src/ext/DifxApp/wixext/DifxAppCompiler.cs b/src/ext/DifxApp/wixext/DifxAppCompiler.cs new file mode 100644 index 00000000..e056988f --- /dev/null +++ b/src/ext/DifxApp/wixext/DifxAppCompiler.cs | |||
| @@ -0,0 +1,161 @@ | |||
| 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 System.Xml.Linq; | ||
| 8 | using WixToolset.Data; | ||
| 9 | using WixToolset.DifxApp.Symbols; | ||
| 10 | using WixToolset.Extensibility; | ||
| 11 | |||
| 12 | /// <summary> | ||
| 13 | /// The compiler for the WiX Toolset Driver Install Frameworks for Applications Extension. | ||
| 14 | /// </summary> | ||
| 15 | public sealed class DifxAppCompiler : BaseCompilerExtension | ||
| 16 | { | ||
| 17 | private HashSet<string> components; | ||
| 18 | |||
| 19 | public override XNamespace Namespace => "http://wixtoolset.org/schemas/v4/wxs/difxapp"; | ||
| 20 | /// <summary> | ||
| 21 | /// Instantiate a new DifxAppCompiler. | ||
| 22 | /// </summary> | ||
| 23 | public DifxAppCompiler() | ||
| 24 | { | ||
| 25 | this.components = new HashSet<string>(); | ||
| 26 | } | ||
| 27 | |||
| 28 | /// <summary> | ||
| 29 | /// Processes an element for the Compiler. | ||
| 30 | /// </summary> | ||
| 31 | /// <param name="sourceLineNumbers">Source line number for the parent element.</param> | ||
| 32 | /// <param name="parentElement">Parent element of element to process.</param> | ||
| 33 | /// <param name="element">Element to process.</param> | ||
| 34 | /// <param name="contextValues">Extra information about the context in which this element is being parsed.</param> | ||
| 35 | public override void ParseElement(Intermediate intermediate, IntermediateSection section, XElement parentElement, XElement element, IDictionary<string, string> context) | ||
| 36 | { | ||
| 37 | switch (parentElement.Name.LocalName) | ||
| 38 | { | ||
| 39 | case "Component": | ||
| 40 | var componentId = context["ComponentId"]; | ||
| 41 | var directoryId = context["DirectoryId"]; | ||
| 42 | var componentWin64 = Boolean.Parse(context["Win64"]); | ||
| 43 | |||
| 44 | switch (element.Name.LocalName) | ||
| 45 | { | ||
| 46 | case "Driver": | ||
| 47 | this.ParseDriverElement(intermediate, section, element, componentId, componentWin64); | ||
| 48 | break; | ||
| 49 | default: | ||
| 50 | this.ParseHelper.UnexpectedElement(parentElement, element); | ||
| 51 | break; | ||
| 52 | } | ||
| 53 | break; | ||
| 54 | default: | ||
| 55 | this.ParseHelper.UnexpectedElement(parentElement, element); | ||
| 56 | break; | ||
| 57 | } | ||
| 58 | } | ||
| 59 | |||
| 60 | /// <summary> | ||
| 61 | /// Parses a Driver element. | ||
| 62 | /// </summary> | ||
| 63 | /// <param name="node">Element to parse.</param> | ||
| 64 | /// <param name="componentId">Identifier for parent component.</param> | ||
| 65 | private void ParseDriverElement(Intermediate intermediate, IntermediateSection section, XElement node, string componentId, bool win64) | ||
| 66 | { | ||
| 67 | var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node); | ||
| 68 | int attributes = 0; | ||
| 69 | var sequence = CompilerConstants.IntegerNotSet; | ||
| 70 | |||
| 71 | // check the number of times a Driver element has been nested under this Component element | ||
| 72 | if (null != componentId) | ||
| 73 | { | ||
| 74 | if (this.components.Contains(componentId)) | ||
| 75 | { | ||
| 76 | this.Messaging.Write(ErrorMessages.TooManyElements(sourceLineNumbers, "Component", node.Name.LocalName, 1)); | ||
| 77 | } | ||
| 78 | else | ||
| 79 | { | ||
| 80 | this.components.Add(componentId); | ||
| 81 | } | ||
| 82 | } | ||
| 83 | |||
| 84 | foreach (var attrib in node.Attributes()) | ||
| 85 | { | ||
| 86 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) | ||
| 87 | { | ||
| 88 | switch (attrib.Name.LocalName) | ||
| 89 | { | ||
| 90 | case "AddRemovePrograms": | ||
| 91 | if (YesNoType.No == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) | ||
| 92 | { | ||
| 93 | attributes |= 0x4; | ||
| 94 | } | ||
| 95 | break; | ||
| 96 | case "DeleteFiles": | ||
| 97 | if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) | ||
| 98 | { | ||
| 99 | attributes |= 0x10; | ||
| 100 | } | ||
| 101 | break; | ||
| 102 | case "ForceInstall": | ||
| 103 | if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) | ||
| 104 | { | ||
| 105 | attributes |= 0x1; | ||
| 106 | } | ||
| 107 | break; | ||
| 108 | case "Legacy": | ||
| 109 | if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) | ||
| 110 | { | ||
| 111 | attributes |= 0x8; | ||
| 112 | } | ||
| 113 | break; | ||
| 114 | case "PlugAndPlayPrompt": | ||
| 115 | if (YesNoType.No == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) | ||
| 116 | { | ||
| 117 | attributes |= 0x2; | ||
| 118 | } | ||
| 119 | break; | ||
| 120 | case "Sequence": | ||
| 121 | sequence = this.ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, int.MaxValue); | ||
| 122 | break; | ||
| 123 | default: | ||
| 124 | this.ParseHelper.UnexpectedAttribute(node, attrib); | ||
| 125 | break; | ||
| 126 | } | ||
| 127 | } | ||
| 128 | else | ||
| 129 | { | ||
| 130 | this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, node, attrib); | ||
| 131 | } | ||
| 132 | } | ||
| 133 | |||
| 134 | this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, node); | ||
| 135 | |||
| 136 | if (!this.Messaging.EncounteredError) | ||
| 137 | { | ||
| 138 | switch (this.Context.Platform) | ||
| 139 | { | ||
| 140 | case Platform.X86: | ||
| 141 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, SymbolDefinitions.CustomAction, "MsiProcessDrivers"); | ||
| 142 | break; | ||
| 143 | case Platform.X64: | ||
| 144 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, SymbolDefinitions.CustomAction, "MsiProcessDrivers_x64"); | ||
| 145 | break; | ||
| 146 | } | ||
| 147 | |||
| 148 | var symbol = section.AddSymbol(new MsiDriverPackagesSymbol(sourceLineNumbers) | ||
| 149 | { | ||
| 150 | ComponentRef = componentId, | ||
| 151 | Flags = attributes, | ||
| 152 | }); | ||
| 153 | |||
| 154 | if (CompilerConstants.IntegerNotSet != sequence) | ||
| 155 | { | ||
| 156 | symbol.Sequence = sequence; | ||
| 157 | } | ||
| 158 | } | ||
| 159 | } | ||
| 160 | } | ||
| 161 | } | ||
diff --git a/src/ext/DifxApp/wixext/DifxAppDecompiler.cs b/src/ext/DifxApp/wixext/DifxAppDecompiler.cs new file mode 100644 index 00000000..e41d8b98 --- /dev/null +++ b/src/ext/DifxApp/wixext/DifxAppDecompiler.cs | |||
| @@ -0,0 +1,98 @@ | |||
| 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 | #if TODO_CONSIDER_DECOMPILER | ||
| 6 | using System; | ||
| 7 | using System.Collections; | ||
| 8 | using System.Globalization; | ||
| 9 | using WixToolset.Data; | ||
| 10 | using WixToolset.Extensibility; | ||
| 11 | using DifxApp = WixToolset.Extensions.Serialize.DifxApp; | ||
| 12 | using Wix = WixToolset.Data.Serialize; | ||
| 13 | |||
| 14 | /// <summary> | ||
| 15 | /// The decompiler for the WiX Toolset Driver Install Frameworks for Applications Extension. | ||
| 16 | /// </summary> | ||
| 17 | public sealed class DifxAppDecompiler : DecompilerExtension | ||
| 18 | { | ||
| 19 | /// <summary> | ||
| 20 | /// Creates a decompiler for Gaming Extension. | ||
| 21 | /// </summary> | ||
| 22 | public DifxAppDecompiler() | ||
| 23 | { | ||
| 24 | this.TableDefinitions = DifxAppExtensionData.GetExtensionTableDefinitions(); | ||
| 25 | } | ||
| 26 | |||
| 27 | /// <summary> | ||
| 28 | /// Decompiles an extension table. | ||
| 29 | /// </summary> | ||
| 30 | /// <param name="table">The table to decompile.</param> | ||
| 31 | public override void DecompileTable(Table table) | ||
| 32 | { | ||
| 33 | switch (table.Name) | ||
| 34 | { | ||
| 35 | case "MsiDriverPackages": | ||
| 36 | this.DecompileMsiDriverPackagesTable(table); | ||
| 37 | break; | ||
| 38 | default: | ||
| 39 | base.DecompileTable(table); | ||
| 40 | break; | ||
| 41 | } | ||
| 42 | } | ||
| 43 | |||
| 44 | /// <summary> | ||
| 45 | /// Decompile the MsiDriverPackages table. | ||
| 46 | /// </summary> | ||
| 47 | /// <param name="table">The table to decompile.</param> | ||
| 48 | private void DecompileMsiDriverPackagesTable(Table table) | ||
| 49 | { | ||
| 50 | foreach (Row row in table.Rows) | ||
| 51 | { | ||
| 52 | DifxApp.Driver driver = new DifxApp.Driver(); | ||
| 53 | |||
| 54 | int attributes = (int)row[1]; | ||
| 55 | if (0x1 == (attributes & 0x1)) | ||
| 56 | { | ||
| 57 | driver.ForceInstall = DifxApp.YesNoType.yes; | ||
| 58 | } | ||
| 59 | |||
| 60 | if (0x2 == (attributes & 0x2)) | ||
| 61 | { | ||
| 62 | driver.PlugAndPlayPrompt = DifxApp.YesNoType.no; | ||
| 63 | } | ||
| 64 | |||
| 65 | if (0x4 == (attributes & 0x4)) | ||
| 66 | { | ||
| 67 | driver.AddRemovePrograms = DifxApp.YesNoType.no; | ||
| 68 | } | ||
| 69 | |||
| 70 | if (0x8 == (attributes & 0x8)) | ||
| 71 | { | ||
| 72 | driver.Legacy = DifxApp.YesNoType.yes; | ||
| 73 | } | ||
| 74 | |||
| 75 | if (0x10 == (attributes & 0x10)) | ||
| 76 | { | ||
| 77 | driver.DeleteFiles = DifxApp.YesNoType.yes; | ||
| 78 | } | ||
| 79 | |||
| 80 | if (null != row[2]) | ||
| 81 | { | ||
| 82 | driver.Sequence = (int)row[2]; | ||
| 83 | } | ||
| 84 | |||
| 85 | Wix.Component component = (Wix.Component)this.Core.GetIndexedElement("Component", (string)row[0]); | ||
| 86 | if (null != component) | ||
| 87 | { | ||
| 88 | component.AddChild(driver); | ||
| 89 | } | ||
| 90 | else | ||
| 91 | { | ||
| 92 | this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "Component", (string)row[0], "Component")); | ||
| 93 | } | ||
| 94 | } | ||
| 95 | } | ||
| 96 | } | ||
| 97 | #endif | ||
| 98 | } | ||
diff --git a/src/ext/DifxApp/wixext/DifxAppExtensionData.cs b/src/ext/DifxApp/wixext/DifxAppExtensionData.cs new file mode 100644 index 00000000..31a95b8e --- /dev/null +++ b/src/ext/DifxApp/wixext/DifxAppExtensionData.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.DifxApp | ||
| 4 | { | ||
| 5 | using WixToolset.Data; | ||
| 6 | using WixToolset.Extensibility; | ||
| 7 | |||
| 8 | public sealed class DifxAppExtensionData : BaseExtensionData | ||
| 9 | { | ||
| 10 | public override string DefaultCulture => "en-US"; | ||
| 11 | |||
| 12 | public override bool TryGetSymbolDefinitionByName(string name, out IntermediateSymbolDefinition symbolDefinition) | ||
| 13 | { | ||
| 14 | symbolDefinition = DifxAppSymbolDefinitions.ByName(name); | ||
| 15 | return symbolDefinition != null; | ||
| 16 | } | ||
| 17 | |||
| 18 | public override Intermediate GetLibrary(ISymbolDefinitionCreator symbolDefinitions) | ||
| 19 | { | ||
| 20 | return Intermediate.Load(typeof(DifxAppExtensionData).Assembly, "WixToolset.DifxApp.difxapp.wixlib", symbolDefinitions); | ||
| 21 | } | ||
| 22 | } | ||
| 23 | } | ||
diff --git a/src/ext/DifxApp/wixext/DifxAppExtensionFactory.cs b/src/ext/DifxApp/wixext/DifxAppExtensionFactory.cs new file mode 100644 index 00000000..3932685d --- /dev/null +++ b/src/ext/DifxApp/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 IReadOnlyCollection<Type> ExtensionTypes => new[] | ||
| 12 | { | ||
| 13 | typeof(DifxAppCompiler), | ||
| 14 | typeof(DifxAppExtensionData), | ||
| 15 | typeof(DifxAppWindowsInstallerBackendBinderExtension), | ||
| 16 | }; | ||
| 17 | } | ||
| 18 | } | ||
diff --git a/src/ext/DifxApp/wixext/DifxAppTableDefinitions.cs b/src/ext/DifxApp/wixext/DifxAppTableDefinitions.cs new file mode 100644 index 00000000..a6c26444 --- /dev/null +++ b/src/ext/DifxApp/wixext/DifxAppTableDefinitions.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 WixToolset.Data.WindowsInstaller; | ||
| 6 | |||
| 7 | public static class DifxAppTableDefinitions | ||
| 8 | { | ||
| 9 | public static readonly TableDefinition MsiDriverPackages = new TableDefinition( | ||
| 10 | "MsiDriverPackages", | ||
| 11 | DifxAppSymbolDefinitions.MsiDriverPackages, | ||
| 12 | new[] | ||
| 13 | { | ||
| 14 | new ColumnDefinition("Component", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, keyTable: "Component", keyColumn: 1, description: "Name of the component that represents the driver package", modularizeType: ColumnModularizeType.Column), | ||
| 15 | new ColumnDefinition("Flags", ColumnType.Number, 4, primaryKey: false, nullable: false, ColumnCategory.Unknown, minValue: 0, maxValue: 31, description: "Flags for installing and uninstalling driver packages"), | ||
| 16 | new ColumnDefinition("Sequence", ColumnType.Number, 4, primaryKey: false, nullable: true, ColumnCategory.Unknown, minValue: 0, description: "Order in which the driver packages are processed"), | ||
| 17 | }, | ||
| 18 | symbolIdIsPrimaryKey: false | ||
| 19 | ); | ||
| 20 | |||
| 21 | public static readonly TableDefinition[] All = new[] | ||
| 22 | { | ||
| 23 | MsiDriverPackages, | ||
| 24 | }; | ||
| 25 | } | ||
| 26 | } | ||
diff --git a/src/ext/DifxApp/wixext/DifxAppWindowsInstallerBackendBinderExtension.cs b/src/ext/DifxApp/wixext/DifxAppWindowsInstallerBackendBinderExtension.cs new file mode 100644 index 00000000..41f01175 --- /dev/null +++ b/src/ext/DifxApp/wixext/DifxAppWindowsInstallerBackendBinderExtension.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.DifxApp | ||
| 4 | { | ||
| 5 | using System.Collections.Generic; | ||
| 6 | using WixToolset.Data.WindowsInstaller; | ||
| 7 | using WixToolset.Extensibility; | ||
| 8 | |||
| 9 | public class DifxAppWindowsInstallerBackendBinderExtension : BaseWindowsInstallerBackendBinderExtension | ||
| 10 | { | ||
| 11 | public override IReadOnlyCollection<TableDefinition> TableDefinitions => DifxAppTableDefinitions.All; | ||
| 12 | } | ||
| 13 | } | ||
diff --git a/src/ext/DifxApp/wixext/Symbols/DifxAppSymbolDefinitions.cs b/src/ext/DifxApp/wixext/Symbols/DifxAppSymbolDefinitions.cs new file mode 100644 index 00000000..76f4d88f --- /dev/null +++ b/src/ext/DifxApp/wixext/Symbols/DifxAppSymbolDefinitions.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 DifxAppSymbolDefinitionType | ||
| 9 | { | ||
| 10 | MsiDriverPackages, | ||
| 11 | } | ||
| 12 | |||
| 13 | public static partial class DifxAppSymbolDefinitions | ||
| 14 | { | ||
| 15 | public static readonly Version Version = new Version("4.0.0"); | ||
| 16 | |||
| 17 | public static IntermediateSymbolDefinition ByName(string name) | ||
| 18 | { | ||
| 19 | if (!Enum.TryParse(name, out DifxAppSymbolDefinitionType type)) | ||
| 20 | { | ||
| 21 | return null; | ||
| 22 | } | ||
| 23 | |||
| 24 | return ByType(type); | ||
| 25 | } | ||
| 26 | |||
| 27 | public static IntermediateSymbolDefinition ByType(DifxAppSymbolDefinitionType type) | ||
| 28 | { | ||
| 29 | switch (type) | ||
| 30 | { | ||
| 31 | case DifxAppSymbolDefinitionType.MsiDriverPackages: | ||
| 32 | return DifxAppSymbolDefinitions.MsiDriverPackages; | ||
| 33 | |||
| 34 | default: | ||
| 35 | throw new ArgumentOutOfRangeException(nameof(type)); | ||
| 36 | } | ||
| 37 | } | ||
| 38 | } | ||
| 39 | } | ||
diff --git a/src/ext/DifxApp/wixext/Symbols/MsiDriverPackagesSymbol.cs b/src/ext/DifxApp/wixext/Symbols/MsiDriverPackagesSymbol.cs new file mode 100644 index 00000000..2fd91bc8 --- /dev/null +++ b/src/ext/DifxApp/wixext/Symbols/MsiDriverPackagesSymbol.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.Symbols; | ||
| 7 | |||
| 8 | public static partial class DifxAppSymbolDefinitions | ||
| 9 | { | ||
| 10 | public static readonly IntermediateSymbolDefinition MsiDriverPackages = new IntermediateSymbolDefinition( | ||
| 11 | DifxAppSymbolDefinitionType.MsiDriverPackages.ToString(), | ||
| 12 | new[] | ||
| 13 | { | ||
| 14 | new IntermediateFieldDefinition(nameof(MsiDriverPackagesSymbolFields.ComponentRef), IntermediateFieldType.String), | ||
| 15 | new IntermediateFieldDefinition(nameof(MsiDriverPackagesSymbolFields.Flags), IntermediateFieldType.Number), | ||
| 16 | new IntermediateFieldDefinition(nameof(MsiDriverPackagesSymbolFields.Sequence), IntermediateFieldType.Number), | ||
| 17 | }, | ||
| 18 | typeof(MsiDriverPackagesSymbol)); | ||
| 19 | } | ||
| 20 | } | ||
| 21 | |||
| 22 | namespace WixToolset.DifxApp.Symbols | ||
| 23 | { | ||
| 24 | using WixToolset.Data; | ||
| 25 | |||
| 26 | public enum MsiDriverPackagesSymbolFields | ||
| 27 | { | ||
| 28 | ComponentRef, | ||
| 29 | Flags, | ||
| 30 | Sequence, | ||
| 31 | } | ||
| 32 | |||
| 33 | public class MsiDriverPackagesSymbol : IntermediateSymbol | ||
| 34 | { | ||
| 35 | public MsiDriverPackagesSymbol() : base(DifxAppSymbolDefinitions.MsiDriverPackages, null, null) | ||
| 36 | { | ||
| 37 | } | ||
| 38 | |||
| 39 | public MsiDriverPackagesSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(DifxAppSymbolDefinitions.MsiDriverPackages, sourceLineNumber, id) | ||
| 40 | { | ||
| 41 | } | ||
| 42 | |||
| 43 | public IntermediateField this[MsiDriverPackagesSymbolFields index] => this.Fields[(int)index]; | ||
| 44 | |||
| 45 | public string ComponentRef | ||
| 46 | { | ||
| 47 | get => this.Fields[(int)MsiDriverPackagesSymbolFields.ComponentRef].AsString(); | ||
| 48 | set => this.Set((int)MsiDriverPackagesSymbolFields.ComponentRef, value); | ||
| 49 | } | ||
| 50 | |||
| 51 | public int Flags | ||
| 52 | { | ||
| 53 | get => this.Fields[(int)MsiDriverPackagesSymbolFields.Flags].AsNumber(); | ||
| 54 | set => this.Set((int)MsiDriverPackagesSymbolFields.Flags, value); | ||
| 55 | } | ||
| 56 | |||
| 57 | public int? Sequence | ||
| 58 | { | ||
| 59 | get => this.Fields[(int)MsiDriverPackagesSymbolFields.Sequence].AsNullableNumber(); | ||
| 60 | set => this.Set((int)MsiDriverPackagesSymbolFields.Sequence, value); | ||
| 61 | } | ||
| 62 | } | ||
| 63 | } \ No newline at end of file | ||
diff --git a/src/ext/DifxApp/wixext/WixToolset.DifxApp.wixext.csproj b/src/ext/DifxApp/wixext/WixToolset.DifxApp.wixext.csproj new file mode 100644 index 00000000..50d3debf --- /dev/null +++ b/src/ext/DifxApp/wixext/WixToolset.DifxApp.wixext.csproj | |||
| @@ -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 | <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 | <EmbeddedResource Include="$(OutputPath)..\difxapp.wixlib" /> | ||
| 16 | </ItemGroup> | ||
| 17 | <ItemGroup> | ||
| 18 | <PackageReference Include="WixToolset.Extensibility" Version="4.0.*" PrivateAssets="all" /> | ||
| 19 | </ItemGroup> | ||
| 20 | |||
| 21 | <ItemGroup> | ||
| 22 | <ProjectReference Include="..\wixlib\difxapp.wixproj" ReferenceOutputAssembly="false" Condition=" '$(NCrunch)'=='' " /> | ||
| 23 | </ItemGroup> | ||
| 24 | |||
| 25 | <ItemGroup> | ||
| 26 | <PackageReference Include="Nerdbank.GitVersioning" Version="3.3.37" PrivateAssets="all" /> | ||
| 27 | </ItemGroup> | ||
| 28 | </Project> | ||
diff --git a/src/ext/DifxApp/wixext/WixToolset.DifxApp.wixext.targets b/src/ext/DifxApp/wixext/WixToolset.DifxApp.wixext.targets new file mode 100644 index 00000000..b01d4116 --- /dev/null +++ b/src/ext/DifxApp/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/ext/DifxApp/wixlib/DifxAppExtension_Platform.wxi b/src/ext/DifxApp/wixlib/DifxAppExtension_Platform.wxi new file mode 100644 index 00000000..b8d613c9 --- /dev/null +++ b/src/ext/DifxApp/wixlib/DifxAppExtension_Platform.wxi | |||
| @@ -0,0 +1,22 @@ | |||
| 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 | |||
| 4 | <Include xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
| 5 | <?include caSuffix.wxi ?> | ||
| 6 | |||
| 7 | <Fragment> | ||
| 8 | <InstallExecuteSequence> | ||
| 9 | <Custom Action="MsiProcessDrivers" After="InstallFiles" Condition="VersionNT > 400" /> | ||
| 10 | <Custom Action="MsiCleanupOnSuccess" After="InstallFinalize" Condition="VersionNT > 400" /> | ||
| 11 | </InstallExecuteSequence> | ||
| 12 | |||
| 13 | <Binary Id="DIFxApp.dll$(var.Suffix)" SourceFile="$(var.platform)\DIFxApp.dll" /> | ||
| 14 | <Binary Id="DIFxAppA.dll$(var.Suffix)" SourceFile="$(var.platform)\DIFxAppA.dll" /> | ||
| 15 | |||
| 16 | <CustomAction Id="MsiProcessDrivers$(var.Suffix)" DllEntry="ProcessDriverPackages" SuppressModularization="yes" Execute="immediate" BinaryRef="DIFxApp.dll$(var.Suffix)" /> | ||
| 17 | <CustomAction Id="MsiInstallDrivers$(var.Suffix)" DllEntry="InstallDriverPackages" SuppressModularization="yes" Execute="deferred" Impersonate="no" BinaryRef="DIFxAppA.dll$(var.Suffix)" /> | ||
| 18 | <CustomAction Id="MsiUninstallDrivers$(var.Suffix)" DllEntry="UninstallDriverPackages" SuppressModularization="yes" Execute="deferred" Impersonate="no" BinaryRef="DIFxAppA.dll$(var.Suffix)" /> | ||
| 19 | <CustomAction Id="MsiRollbackInstall$(var.Suffix)" DllEntry="RollbackInstall" SuppressModularization="yes" Execute="rollback" Impersonate="no" BinaryRef="DIFxAppA.dll$(var.Suffix)" /> | ||
| 20 | <CustomAction Id="MsiCleanupOnSuccess$(var.Suffix)" DllEntry="CleanupOnSuccess" SuppressModularization="yes" Execute="immediate" BinaryRef="DIFxApp.dll$(var.Suffix)" /> | ||
| 21 | </Fragment> | ||
| 22 | </Include> | ||
diff --git a/src/ext/DifxApp/wixlib/DifxAppExtension_x64.wxs b/src/ext/DifxApp/wixlib/DifxAppExtension_x64.wxs new file mode 100644 index 00000000..3c534363 --- /dev/null +++ b/src/ext/DifxApp/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/ext/DifxApp/wixlib/DifxAppExtension_x86.wxs b/src/ext/DifxApp/wixlib/DifxAppExtension_x86.wxs new file mode 100644 index 00000000..d352a272 --- /dev/null +++ b/src/ext/DifxApp/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/ext/DifxApp/wixlib/caSuffix.wxi b/src/ext/DifxApp/wixlib/caSuffix.wxi new file mode 100644 index 00000000..a56a2393 --- /dev/null +++ b/src/ext/DifxApp/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/ext/DifxApp/wixlib/difxapp.wixproj b/src/ext/DifxApp/wixlib/difxapp.wixproj new file mode 100644 index 00000000..2ae9a097 --- /dev/null +++ b/src/ext/DifxApp/wixlib/difxapp.wixproj | |||
| @@ -0,0 +1,14 @@ | |||
| 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 | <Project Sdk="WixToolset.Sdk"> | ||
| 3 | |||
| 4 | <PropertyGroup> | ||
| 5 | <OutputType>Library</OutputType> | ||
| 6 | <BindFiles>true</BindFiles> | ||
| 7 | <Cultures>en-us</Cultures> | ||
| 8 | </PropertyGroup> | ||
| 9 | |||
| 10 | <ItemGroup> | ||
| 11 | <PackageReference Include="Nerdbank.GitVersioning" Version="3.3.37" PrivateAssets="All" /> | ||
| 12 | </ItemGroup> | ||
| 13 | |||
| 14 | </Project> | ||
diff --git a/src/ext/DifxApp/wixlib/x64/DIFxApp.dll b/src/ext/DifxApp/wixlib/x64/DIFxApp.dll new file mode 100644 index 00000000..69a44cc8 --- /dev/null +++ b/src/ext/DifxApp/wixlib/x64/DIFxApp.dll | |||
| Binary files differ | |||
diff --git a/src/ext/DifxApp/wixlib/x64/DIFxAppA.dll b/src/ext/DifxApp/wixlib/x64/DIFxAppA.dll new file mode 100644 index 00000000..99458040 --- /dev/null +++ b/src/ext/DifxApp/wixlib/x64/DIFxAppA.dll | |||
| Binary files differ | |||
diff --git a/src/ext/DifxApp/wixlib/x86/DIFxApp.dll b/src/ext/DifxApp/wixlib/x86/DIFxApp.dll new file mode 100644 index 00000000..678a9d95 --- /dev/null +++ b/src/ext/DifxApp/wixlib/x86/DIFxApp.dll | |||
| Binary files differ | |||
diff --git a/src/ext/DifxApp/wixlib/x86/DIFxAppA.dll b/src/ext/DifxApp/wixlib/x86/DIFxAppA.dll new file mode 100644 index 00000000..3ac0838d --- /dev/null +++ b/src/ext/DifxApp/wixlib/x86/DIFxAppA.dll | |||
| Binary files differ | |||
