From 88ddf1293d0cc37474606fa191c3cf916e0f83e3 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sat, 2 Feb 2019 15:09:06 -0600 Subject: Initial commit --- .gitattributes | 2 + .gitignore | 341 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ LICENSE.TXT | 28 +++++ README.md | 2 + 4 files changed, 373 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 LICENSE.TXT create mode 100644 README.md diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..dfe07704 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Auto detect text files and perform LF normalization +* text=auto diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..3e8a1553 --- /dev/null +++ b/.gitignore @@ -0,0 +1,341 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ +# ASP.NET Core default setup: bower directory is configured as wwwroot/lib/ and bower restore is true +**/wwwroot/lib/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb diff --git a/LICENSE.TXT b/LICENSE.TXT new file mode 100644 index 00000000..d4d316ef --- /dev/null +++ b/LICENSE.TXT @@ -0,0 +1,28 @@ +Copyright (c) .NET Foundation and contributors. +This software is released under the Microsoft Reciprocal License (MS-RL) (the "License"); you may not use the software except in compliance with the License. + +The text of the Microsoft Reciprocal License (MS-RL) can be found online at: + http://opensource.org/licenses/ms-rl + + +Microsoft Reciprocal License (MS-RL) + +This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software. + +1. Definitions + The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law. + A "contribution" is the original software, or any additions or changes to the software. + A "contributor" is any person that distributes its contribution under this license. + "Licensed patents" are a contributor's patent claims that read directly on its contribution. + +2. Grant of Rights + (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create. + (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software. + +3. Conditions and Limitations + (A) Reciprocal Grants- For any file you distribute that contains code from the software (in source code or binary format), you must provide recipients the source code to that file along with a copy of this license, which license will govern that file. You may license other files that are entirely your own work and do not contain code from the software under any terms you choose. + (B) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks. + (C) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically. + (D) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software. + (E) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license. + (F) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement. diff --git a/README.md b/README.md new file mode 100644 index 00000000..49f30df8 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# DifxApp.wixext +WixToolset.DifxApp.wixext - DIFxApp WiX Toolset Extension -- cgit v1.2.3-55-g6feb From d694ea725efa855edfca0863cf462b1c0f26c156 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sat, 2 Feb 2019 15:13:20 -0600 Subject: Import code from old v4 repo --- src/wixext/DifxAppCompiler.cs | 148 ++++++++++++++++++++++++++++++++++ src/wixext/DifxAppDecompiler.cs | 96 ++++++++++++++++++++++ src/wixext/DifxAppExtensionData.cs | 43 ++++++++++ src/wixext/WixDifxAppExtension.csproj | 47 +++++++++++ src/wixext/difxapp.xsd | 108 +++++++++++++++++++++++++ src/wixext/tables.xml | 14 ++++ src/wixlib/DIFxAppExtension.wixproj | 30 +++++++ src/wixlib/DIFxAppExtension.wxs | 21 +++++ src/wixlib/x64/DIFxApp.dll | Bin 0 -> 153080 bytes src/wixlib/x64/DIFxAppA.dll | Bin 0 -> 707464 bytes src/wixlib/x86/DIFxApp.dll | Bin 0 -> 122248 bytes src/wixlib/x86/DIFxAppA.dll | Bin 0 -> 364424 bytes 12 files changed, 507 insertions(+) create mode 100644 src/wixext/DifxAppCompiler.cs create mode 100644 src/wixext/DifxAppDecompiler.cs create mode 100644 src/wixext/DifxAppExtensionData.cs create mode 100644 src/wixext/WixDifxAppExtension.csproj create mode 100644 src/wixext/difxapp.xsd create mode 100644 src/wixext/tables.xml create mode 100644 src/wixlib/DIFxAppExtension.wixproj create mode 100644 src/wixlib/DIFxAppExtension.wxs create mode 100644 src/wixlib/x64/DIFxApp.dll create mode 100644 src/wixlib/x64/DIFxAppA.dll create mode 100644 src/wixlib/x86/DIFxApp.dll create mode 100644 src/wixlib/x86/DIFxAppA.dll diff --git a/src/wixext/DifxAppCompiler.cs b/src/wixext/DifxAppCompiler.cs new file mode 100644 index 00000000..63396932 --- /dev/null +++ b/src/wixext/DifxAppCompiler.cs @@ -0,0 +1,148 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Extensions +{ + using System; + using System.Collections.Generic; + using System.Xml.Linq; + using WixToolset.Data; + using WixToolset.Extensibility; + + /// + /// The compiler for the WiX Toolset Driver Install Frameworks for Applications Extension. + /// + public sealed class DifxAppCompiler : CompilerExtension + { + private HashSet components; + + /// + /// Instantiate a new DifxAppCompiler. + /// + public DifxAppCompiler() + { + this.Namespace = "http://wixtoolset.org/schemas/v4/wxs/difxapp"; + this.components = new HashSet(); + } + + /// + /// Processes an element for the Compiler. + /// + /// Source line number for the parent element. + /// Parent element of element to process. + /// Element to process. + /// Extra information about the context in which this element is being parsed. + public override void ParseElement(XElement parentElement, XElement element, IDictionary context) + { + switch (parentElement.Name.LocalName) + { + case "Component": + string componentId = context["ComponentId"]; + string directoryId = context["DirectoryId"]; + + switch (element.Name.LocalName) + { + case "Driver": + this.ParseDriverElement(element, componentId); + break; + default: + this.Core.UnexpectedElement(parentElement, element); + break; + } + break; + default: + this.Core.UnexpectedElement(parentElement, element); + break; + } + } + + /// + /// Parses a Driver element. + /// + /// Element to parse. + /// Identifier for parent component. + private void ParseDriverElement(XElement node, string componentId) + { + SourceLineNumber sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); + int attributes = 0; + int sequence = CompilerConstants.IntegerNotSet; + + // check the number of times a Driver element has been nested under this Component element + if (null != componentId) + { + if (this.components.Contains(componentId)) + { + this.Core.OnMessage(WixErrors.TooManyElements(sourceLineNumbers, "Component", node.Name.LocalName, 1)); + } + else + { + this.components.Add(componentId); + } + } + + foreach (XAttribute attrib in node.Attributes()) + { + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) + { + switch (attrib.Name.LocalName) + { + case "AddRemovePrograms": + if (YesNoType.No == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + { + attributes |= 0x4; + } + break; + case "DeleteFiles": + if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + { + attributes |= 0x10; + } + break; + case "ForceInstall": + if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + { + attributes |= 0x1; + } + break; + case "Legacy": + if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + { + attributes |= 0x8; + } + break; + case "PlugAndPlayPrompt": + if (YesNoType.No == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + { + attributes |= 0x2; + } + break; + case "Sequence": + sequence = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, int.MaxValue); + break; + default: + this.Core.UnexpectedAttribute(node, attrib); + break; + } + } + else + { + this.Core.ParseExtensionAttribute(node, attrib); + } + } + + this.Core.ParseForExtensionElements(node); + + if (!this.Core.EncounteredError) + { + Row row = this.Core.CreateRow(sourceLineNumbers, "MsiDriverPackages"); + row[0] = componentId; + row[1] = attributes; + if (CompilerConstants.IntegerNotSet != sequence) + { + row[2] = sequence; + } + + this.Core.CreateSimpleReference(sourceLineNumbers, "CustomAction", "MsiProcessDrivers"); + } + } + } +} diff --git a/src/wixext/DifxAppDecompiler.cs b/src/wixext/DifxAppDecompiler.cs new file mode 100644 index 00000000..db42b3d0 --- /dev/null +++ b/src/wixext/DifxAppDecompiler.cs @@ -0,0 +1,96 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Extensions +{ + using System; + using System.Collections; + using System.Globalization; + using WixToolset.Data; + using WixToolset.Extensibility; + using DifxApp = WixToolset.Extensions.Serialize.DifxApp; + using Wix = WixToolset.Data.Serialize; + + /// + /// The decompiler for the WiX Toolset Driver Install Frameworks for Applications Extension. + /// + public sealed class DifxAppDecompiler : DecompilerExtension + { + /// + /// Creates a decompiler for Gaming Extension. + /// + public DifxAppDecompiler() + { + this.TableDefinitions = DifxAppExtensionData.GetExtensionTableDefinitions(); + } + + /// + /// Decompiles an extension table. + /// + /// The table to decompile. + public override void DecompileTable(Table table) + { + switch (table.Name) + { + case "MsiDriverPackages": + this.DecompileMsiDriverPackagesTable(table); + break; + default: + base.DecompileTable(table); + break; + } + } + + /// + /// Decompile the MsiDriverPackages table. + /// + /// The table to decompile. + private void DecompileMsiDriverPackagesTable(Table table) + { + foreach (Row row in table.Rows) + { + DifxApp.Driver driver = new DifxApp.Driver(); + + int attributes = (int)row[1]; + if (0x1 == (attributes & 0x1)) + { + driver.ForceInstall = DifxApp.YesNoType.yes; + } + + if (0x2 == (attributes & 0x2)) + { + driver.PlugAndPlayPrompt = DifxApp.YesNoType.no; + } + + if (0x4 == (attributes & 0x4)) + { + driver.AddRemovePrograms = DifxApp.YesNoType.no; + } + + if (0x8 == (attributes & 0x8)) + { + driver.Legacy = DifxApp.YesNoType.yes; + } + + if (0x10 == (attributes & 0x10)) + { + driver.DeleteFiles = DifxApp.YesNoType.yes; + } + + if (null != row[2]) + { + driver.Sequence = (int)row[2]; + } + + Wix.Component component = (Wix.Component)this.Core.GetIndexedElement("Component", (string)row[0]); + if (null != component) + { + component.AddChild(driver); + } + else + { + this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "Component", (string)row[0], "Component")); + } + } + } + } +} diff --git a/src/wixext/DifxAppExtensionData.cs b/src/wixext/DifxAppExtensionData.cs new file mode 100644 index 00000000..266f5ee4 --- /dev/null +++ b/src/wixext/DifxAppExtensionData.cs @@ -0,0 +1,43 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Extensions +{ + using System; + using System.Reflection; + using WixToolset.Data; + using WixToolset.Extensibility; + + /// + /// The WiX Toolset Driver Install Frameworks for Applications Extension. + /// + public sealed class DifxAppExtensionData : ExtensionData + { + private static TableDefinitionCollection tableDefinitions; + + /// + /// Gets the optional table definitions for this extension. + /// + /// The optional table definitions for this extension. + public override TableDefinitionCollection TableDefinitions + { + get + { + return DifxAppExtensionData.GetExtensionTableDefinitions(); + } + } + + /// + /// Internal mechanism to access the extension's table definitions. + /// + /// Extension's table definitions. + internal static TableDefinitionCollection GetExtensionTableDefinitions() + { + if (null == DifxAppExtensionData.tableDefinitions) + { + DifxAppExtensionData.tableDefinitions = ExtensionData.LoadTableDefinitionHelper(Assembly.GetExecutingAssembly(), "WixToolset.Extensions.Data.tables.xml"); + } + + return DifxAppExtensionData.tableDefinitions; + } + } +} diff --git a/src/wixext/WixDifxAppExtension.csproj b/src/wixext/WixDifxAppExtension.csproj new file mode 100644 index 00000000..5e85c675 --- /dev/null +++ b/src/wixext/WixDifxAppExtension.csproj @@ -0,0 +1,47 @@ + + + + + + + {2256EFD7-E678-4485-818D-986D590068BE} + WixDifxAppExtension + Library + WixToolset.Extensions + + + + + + + + $(RootNamespace).Data.tables.xml + + + $(RootNamespace).Xsd.difxapp.xsd + PreserveNewest + + + Designer + WixToolset.Data.Serialize + WixToolset.Extensions.Serialize.DifxApp + + + + + + + + + + + Platform=x86 + false + + + Platform=x64 + false + + + + diff --git a/src/wixext/difxapp.xsd b/src/wixext/difxapp.xsd new file mode 100644 index 00000000..e665d034 --- /dev/null +++ b/src/wixext/difxapp.xsd @@ -0,0 +1,108 @@ + + + + + + + + The source code schema for the WiX Toolset Driver Install Frameworks for Applications Extension. + + + + + + + + + + + + Installs a driver. To use this element, you need to reference the WixDifxAppExtension extension and add the + .wixlib appropriate for the target platform (difxapp_x86.wixlib or difxapp_x64.wixlib) + to your project. + + + + + + + Specifies that the DIFxApp CustomActions should add an entry in the Add/Remove Programs Control + Panel applet. The default is 'yes'. + + + + + + + If set to "yes", configures DIFxApp to delete binary files that were copied to the system from the driver + store when a driver package was installed. If this attribute is set to "no" or not present, DIFxApp does not + remove these files from a system. Note that configuring DIFxApp to delete these files is controlled by the + Flags entry value of the component that represents the driver package in the MsiDriverPackages custom table. + Setting DeleteFiles to "yes" sets the corresponding bit in the Flags entry value. Setting DeleteFiles to "no" + clears the corresponding bit in the Flags entry value. If this attribute is not present, DIFxApp uses a + default value of "no". + + + + + + + Specifies that the DIFxApp CustomActions should force the installation of a new Plug and Play driver + on a device, even if the currently installed driver on the device is a better match than the new driver. + Specifying 'no' is an excellent way to ensure the DIFxApp CustomActions recognize the Component contains + a driver for installation. The default is null which means the Component does not install a driver via + DIFxApp CustomActions. See http://www.microsoft.com/whdc/driver/install/difxtools.mspx + for more information. + + + + + + + If set to "yes", configures DIFxApp to install unsigned driver packages and driver packages with missing + files. For more information, see "Installing Unsigned Driver Packages in Legacy Mode" earlier in this paper. + If this attribute is set to "no" or not present, DIFxApp will install only signed driver packages. Note + that configuring DIFxApp to install unsigned drivers is controlled by the Flags entry value of the component + that represents the driver package in the MsiDriverPackages custom table. Setting Legacy to "yes" sets + the corresponding bit in the Flags entry value. Setting Legacy to "no" clears the bit in the Flags + entry value that configures DIFxApp to install unsigned driver packages. If this attribute is not present, + DIFxApp uses a default value of "no". + + + + + + + Specifies that the DIFxApp CustomActions should prompt the user to connect the Plug and Play + device if it is not connected. The default is 'yes'. + + + + + + + Specifies an optional installation sequence number. DIFxApp CustomActions install the driver packages in + an installation package in the order of increasing sequence numbers. The same sequence number can be used + for more than one driver; however, the order in which packages with the same sequence number are actually + installed cannot be determined. + + + + + + + + + Values of this type will either be "yes" or "no". + + + + + + + diff --git a/src/wixext/tables.xml b/src/wixext/tables.xml new file mode 100644 index 00000000..c328f875 --- /dev/null +++ b/src/wixext/tables.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/src/wixlib/DIFxAppExtension.wixproj b/src/wixlib/DIFxAppExtension.wixproj new file mode 100644 index 00000000..f4a7eb74 --- /dev/null +++ b/src/wixlib/DIFxAppExtension.wixproj @@ -0,0 +1,30 @@ + + + + + + + {5066EB93-D8F7-4FAE-B687-024D7A81BD95} + difxapp_$(Platform) + Library + true + true + en-us + + + + + + + $(DefineConstants); + DIFxAppDll=$(ProjectDir)$(Platform)\DIFxApp.dll; + DIFxAppADll=$(ProjectDir)$(Platform)\DIFxAppA.dll; + + + + + + + + + diff --git a/src/wixlib/DIFxAppExtension.wxs b/src/wixlib/DIFxAppExtension.wxs new file mode 100644 index 00000000..44b0ce2c --- /dev/null +++ b/src/wixlib/DIFxAppExtension.wxs @@ -0,0 +1,21 @@ + + + + + + + + VersionNT > 400 + VersionNT > 400 + + + + + + + + + + + + diff --git a/src/wixlib/x64/DIFxApp.dll b/src/wixlib/x64/DIFxApp.dll new file mode 100644 index 00000000..69a44cc8 Binary files /dev/null and b/src/wixlib/x64/DIFxApp.dll differ diff --git a/src/wixlib/x64/DIFxAppA.dll b/src/wixlib/x64/DIFxAppA.dll new file mode 100644 index 00000000..99458040 Binary files /dev/null and b/src/wixlib/x64/DIFxAppA.dll differ diff --git a/src/wixlib/x86/DIFxApp.dll b/src/wixlib/x86/DIFxApp.dll new file mode 100644 index 00000000..678a9d95 Binary files /dev/null and b/src/wixlib/x86/DIFxApp.dll differ diff --git a/src/wixlib/x86/DIFxAppA.dll b/src/wixlib/x86/DIFxAppA.dll new file mode 100644 index 00000000..3ac0838d Binary files /dev/null and b/src/wixlib/x86/DIFxAppA.dll differ -- cgit v1.2.3-55-g6feb From 704139b787d2016e43b6a87dbfc41555dac8326a Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sat, 2 Feb 2019 17:01:09 -0600 Subject: Integrate into latest v4. --- .editorconfig | 37 ++++++++++++ DifxApp.wixext.sln | 63 +++++++++++++++++++++ appveyor.cmd | 13 +++++ appveyor.yml | 42 ++++++++++++++ nuget.config | 16 ++++++ src/Directory.Build.props | 28 +++++++++ src/Directory.Build.targets | 48 ++++++++++++++++ src/FindLocalWix.props | 8 +++ .../DifxAppExtensionFixture.cs | 36 ++++++++++++ .../TestData/UsingDriver/Package.en-us.wxl | 11 ++++ .../TestData/UsingDriver/Package.wxs | 21 +++++++ .../TestData/UsingDriver/PackageComponents.wxs | 12 ++++ .../TestData/UsingDriver/example.txt | 1 + .../WixToolsetTest.DifxApp.csproj | 38 +++++++++++++ src/wixext/DifxAppCompiler.cs | 66 +++++++++++++--------- src/wixext/DifxAppDecompiler.cs | 4 +- src/wixext/DifxAppExtensionData.cs | 36 +++--------- src/wixext/DifxAppExtensionFactory.cs | 18 ++++++ ...ifxAppWindowsInstallerBackendBinderExtension.cs | 26 +++++++++ src/wixext/Tuples/DifxAppTupleDefinitions.cs | 39 +++++++++++++ src/wixext/Tuples/MsiDriverPackagesTuple.cs | 63 +++++++++++++++++++++ src/wixext/WixDifxAppExtension.csproj | 47 --------------- src/wixext/WixToolset.DifxApp.wixext.csproj | 30 ++++++++++ src/wixext/WixToolset.DifxApp.wixext.targets | 11 ++++ src/wixlib/DIFxAppExtension.wixproj | 30 ---------- src/wixlib/DIFxAppExtension.wxs | 21 ------- src/wixlib/DifxAppExtension_Platform.wxi | 23 ++++++++ src/wixlib/DifxAppExtension_x64.wxs | 8 +++ src/wixlib/DifxAppExtension_x86.wxs | 8 +++ src/wixlib/caSuffix.wxi | 28 +++++++++ src/wixlib/difxapp.wixproj | 39 +++++++++++++ src/wixlib/packages.config | 5 ++ version.json | 11 ++++ 33 files changed, 734 insertions(+), 153 deletions(-) create mode 100644 .editorconfig create mode 100644 DifxApp.wixext.sln create mode 100644 appveyor.cmd create mode 100644 appveyor.yml create mode 100644 nuget.config create mode 100644 src/Directory.Build.props create mode 100644 src/Directory.Build.targets create mode 100644 src/FindLocalWix.props create mode 100644 src/test/WixToolsetTest.DifxApp/DifxAppExtensionFixture.cs create mode 100644 src/test/WixToolsetTest.DifxApp/TestData/UsingDriver/Package.en-us.wxl create mode 100644 src/test/WixToolsetTest.DifxApp/TestData/UsingDriver/Package.wxs create mode 100644 src/test/WixToolsetTest.DifxApp/TestData/UsingDriver/PackageComponents.wxs create mode 100644 src/test/WixToolsetTest.DifxApp/TestData/UsingDriver/example.txt create mode 100644 src/test/WixToolsetTest.DifxApp/WixToolsetTest.DifxApp.csproj create mode 100644 src/wixext/DifxAppExtensionFactory.cs create mode 100644 src/wixext/DifxAppWindowsInstallerBackendBinderExtension.cs create mode 100644 src/wixext/Tuples/DifxAppTupleDefinitions.cs create mode 100644 src/wixext/Tuples/MsiDriverPackagesTuple.cs delete mode 100644 src/wixext/WixDifxAppExtension.csproj create mode 100644 src/wixext/WixToolset.DifxApp.wixext.csproj create mode 100644 src/wixext/WixToolset.DifxApp.wixext.targets delete mode 100644 src/wixlib/DIFxAppExtension.wixproj delete mode 100644 src/wixlib/DIFxAppExtension.wxs create mode 100644 src/wixlib/DifxAppExtension_Platform.wxi create mode 100644 src/wixlib/DifxAppExtension_x64.wxs create mode 100644 src/wixlib/DifxAppExtension_x86.wxs create mode 100644 src/wixlib/caSuffix.wxi create mode 100644 src/wixlib/difxapp.wixproj create mode 100644 src/wixlib/packages.config create mode 100644 version.json diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..1d72e683 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,37 @@ +# 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. +# +# Do NOT modify this file. Update the canonical version in Home\repo-template\src\.editorconfig +# then update all of the repos. + +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 4 +trim_trailing_whitespace = true + +[*.{cs,vb}] +dotnet_sort_system_directives_first = true + +[*.cs] +csharp_indent_case_contents = true : error +csharp_indent_switch_labels = true : error +csharp_new_line_before_open_brace = all +csharp_prefer_braces = true : error +csharp_style_expression_bodied_methods = when_on_single_line : suggestion +csharp_style_expression_bodied_constructors = when_on_single_line : suggestion +csharp_style_expression_bodied_operators = when_on_single_line : suggestion +csharp_style_expression_bodied_properties = when_on_single_line : suggestion +csharp_style_expression_bodied_indexers = when_on_single_line : suggestion +csharp_style_expression_bodied_accessors = when_on_single_line : suggestion +csharp_style_var_elsewhere = true : suggestion +csharp_style_var_for_built_in_types = true : suggestion +csharp_style_var_when_type_is_apparent = true : suggestion +dotnet_style_qualification_for_event = true : error +dotnet_style_qualification_for_field = true : error +dotnet_style_qualification_for_method = true : error +dotnet_style_qualification_for_property = true : error + +[*.targets] +indent_size = 2 diff --git a/DifxApp.wixext.sln b/DifxApp.wixext.sln new file mode 100644 index 00000000..2bfddc69 --- /dev/null +++ b/DifxApp.wixext.sln @@ -0,0 +1,63 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.27130.2003 +MinimumVisualStudioVersion = 15.0.26124.0 +Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "difxapp", "src\wixlib\difxapp.wixproj", "{5066EB93-D8F7-4FAE-B687-024D7A81BD95}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolset.DifxApp.wixext", "src\wixext\WixToolset.DifxApp.wixext.csproj", "{2256EFD7-E678-4485-818D-986D590068BE}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolsetTest.DifxApp", "src\test\WixToolsetTest.DifxApp\WixToolsetTest.DifxApp.csproj", "{883D7BA3-1ADC-47AC-95B0-221BB0B7788D}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {5066EB93-D8F7-4FAE-B687-024D7A81BD95}.Debug|Any CPU.ActiveCfg = Debug|x86 + {5066EB93-D8F7-4FAE-B687-024D7A81BD95}.Debug|Any CPU.Build.0 = Debug|x86 + {5066EB93-D8F7-4FAE-B687-024D7A81BD95}.Debug|x64.ActiveCfg = Debug|x86 + {5066EB93-D8F7-4FAE-B687-024D7A81BD95}.Debug|x86.ActiveCfg = Debug|x86 + {5066EB93-D8F7-4FAE-B687-024D7A81BD95}.Debug|x86.Build.0 = Debug|x86 + {5066EB93-D8F7-4FAE-B687-024D7A81BD95}.Release|Any CPU.ActiveCfg = Release|x86 + {5066EB93-D8F7-4FAE-B687-024D7A81BD95}.Release|Any CPU.Build.0 = Release|x86 + {5066EB93-D8F7-4FAE-B687-024D7A81BD95}.Release|x64.ActiveCfg = Release|x86 + {5066EB93-D8F7-4FAE-B687-024D7A81BD95}.Release|x86.ActiveCfg = Release|x86 + {5066EB93-D8F7-4FAE-B687-024D7A81BD95}.Release|x86.Build.0 = Release|x86 + {2256EFD7-E678-4485-818D-986D590068BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2256EFD7-E678-4485-818D-986D590068BE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2256EFD7-E678-4485-818D-986D590068BE}.Debug|x64.ActiveCfg = Debug|Any CPU + {2256EFD7-E678-4485-818D-986D590068BE}.Debug|x64.Build.0 = Debug|Any CPU + {2256EFD7-E678-4485-818D-986D590068BE}.Debug|x86.ActiveCfg = Debug|Any CPU + {2256EFD7-E678-4485-818D-986D590068BE}.Debug|x86.Build.0 = Debug|Any CPU + {2256EFD7-E678-4485-818D-986D590068BE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2256EFD7-E678-4485-818D-986D590068BE}.Release|Any CPU.Build.0 = Release|Any CPU + {2256EFD7-E678-4485-818D-986D590068BE}.Release|x64.ActiveCfg = Release|Any CPU + {2256EFD7-E678-4485-818D-986D590068BE}.Release|x64.Build.0 = Release|Any CPU + {2256EFD7-E678-4485-818D-986D590068BE}.Release|x86.ActiveCfg = Release|Any CPU + {2256EFD7-E678-4485-818D-986D590068BE}.Release|x86.Build.0 = Release|Any CPU + {883D7BA3-1ADC-47AC-95B0-221BB0B7788D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {883D7BA3-1ADC-47AC-95B0-221BB0B7788D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {883D7BA3-1ADC-47AC-95B0-221BB0B7788D}.Debug|x64.ActiveCfg = Debug|Any CPU + {883D7BA3-1ADC-47AC-95B0-221BB0B7788D}.Debug|x64.Build.0 = Debug|Any CPU + {883D7BA3-1ADC-47AC-95B0-221BB0B7788D}.Debug|x86.ActiveCfg = Debug|Any CPU + {883D7BA3-1ADC-47AC-95B0-221BB0B7788D}.Debug|x86.Build.0 = Debug|Any CPU + {883D7BA3-1ADC-47AC-95B0-221BB0B7788D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {883D7BA3-1ADC-47AC-95B0-221BB0B7788D}.Release|Any CPU.Build.0 = Release|Any CPU + {883D7BA3-1ADC-47AC-95B0-221BB0B7788D}.Release|x64.ActiveCfg = Release|Any CPU + {883D7BA3-1ADC-47AC-95B0-221BB0B7788D}.Release|x64.Build.0 = Release|Any CPU + {883D7BA3-1ADC-47AC-95B0-221BB0B7788D}.Release|x86.ActiveCfg = Release|Any CPU + {883D7BA3-1ADC-47AC-95B0-221BB0B7788D}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {60A3EA0F-9313-47F8-BF6B-74478A57B577} + EndGlobalSection +EndGlobal diff --git a/appveyor.cmd b/appveyor.cmd new file mode 100644 index 00000000..dc40e10c --- /dev/null +++ b/appveyor.cmd @@ -0,0 +1,13 @@ +@setlocal +@pushd %~dp0 + +nuget restore + +msbuild -p:Configuration=Release -t:Restore + +msbuild -p:Configuration=Release src\test\WixToolsetTest.DifxApp\WixToolsetTest.DifxApp.csproj + +msbuild -p:Configuration=Release -t:Pack src\wixext\WixToolset.DifxApp.wixext.csproj + +@popd +@endlocal \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 00000000..8d80c6af --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,42 @@ +# 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. +# +# Do NOT modify this file. Update the canonical version in Home\repo-template\src\appveyor.yml +# then update all of the repos. + +branches: + only: + - master + - develop + +image: Visual Studio 2017 + +version: 0.0.0.{build} +configuration: Release + +environment: + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + NUGET_XMLDOC_MODE: skip + +build_script: + - appveyor.cmd + +pull_requests: + do_not_increment_build_number: true + +nuget: + disable_publish_on_pr: true + +skip_branch_with_pr: true +skip_tags: true + +artifacts: +- path: build\Release\**\*.nupkg + name: nuget +- path: build\Release\**\*.msi + name: msi + +notifications: +- provider: Slack + incoming_webhook: + secure: p5xuu+4x2JHfwGDMDe5KcG1k7gZxqYc4jWVwvyNZv5cvkubPD2waJs5yXMAXZNN7Z63/3PWHb7q4KoY/99AjauYa1nZ4c5qYqRPFRBKTHfA= diff --git a/nuget.config b/nuget.config new file mode 100644 index 00000000..aaee3228 --- /dev/null +++ b/nuget.config @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Directory.Build.props b/src/Directory.Build.props new file mode 100644 index 00000000..a22f4470 --- /dev/null +++ b/src/Directory.Build.props @@ -0,0 +1,28 @@ + + + + + + Debug + false + MSB3246 + + $(MSBuildProjectName) + $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\build\)) + $(BaseOutputPath)obj\$(ProjectName)\ + $(BaseOutputPath)$(Configuration)\ + + WiX Toolset Team + WiX Toolset + Copyright (c) .NET Foundation and contributors. All rights reserved. + MS-RL + WiX Toolset + + + + + + diff --git a/src/Directory.Build.targets b/src/Directory.Build.targets new file mode 100644 index 00000000..dac7452a --- /dev/null +++ b/src/Directory.Build.targets @@ -0,0 +1,48 @@ + + + + + + + true + $(SolutionPath) + $(NCrunchOriginalSolutionPath) + + + + + + + $([System.IO.File]::ReadAllText($(TheSolutionPath))) + $([System.IO.Path]::GetDirectoryName( $(TheSolutionPath) )) + (?<="[PackageName]", ")(.*)(?=", ") + + + + + + %(Identity) + $(SolutionFileContent.Contains('\%(Identity).csproj')) + + + + + $(RegexPattern.Replace('[PackageName]','%(PackageName)') ) + $([System.Text.RegularExpressions.Regex]::Match('$(SolutionFileContent)', '%(Pattern)')) + + + + + + + + + + + diff --git a/src/FindLocalWix.props b/src/FindLocalWix.props new file mode 100644 index 00000000..a784e352 --- /dev/null +++ b/src/FindLocalWix.props @@ -0,0 +1,8 @@ + + + + + + $(MSBuildThisFileDirectory)..\..\Tools\build\Debug\net461\wix.targets + + diff --git a/src/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 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolsetTest.DifxApp +{ + using System.Linq; + using WixBuildTools.TestSupport; + using WixToolset.Core.TestPackage; + using WixToolset.DifxApp; + using Xunit; + + public class DifxAppExtensionFixture + { + [Fact] + public void CanBuildUsingDriver() + { + var folder = TestData.Get(@"TestData\UsingDriver"); + var build = new Builder(folder, typeof(DifxAppExtensionFactory), new[] { folder }); + + var results = build.BuildAndQuery(Build, "CustomAction"); + Assert.Equal(new[] + { + "CustomAction:MsiCleanupOnSuccess\t1\tDIFxApp.dll\tCleanupOnSuccess\t0", + "CustomAction:MsiInstallDrivers\t3073\tDIFxAppA.dll\tInstallDriverPackages\t0", + "CustomAction:MsiProcessDrivers\t1\tDIFxApp.dll\tProcessDriverPackages\t0", + "CustomAction:MsiRollbackInstall\t3329\tDIFxAppA.dll\tRollbackInstall\t0", + "CustomAction:MsiUninstallDrivers\t3073\tDIFxAppA.dll\tUninstallDriverPackages\t0", + }, results.OrderBy(s => s).ToArray()); + } + + private static void Build(string[] args) + { + var result = WixRunner.Execute(args) + .AssertSuccess(); + } + } +} 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 @@ + + + + + + A newer version of [ProductName] is already installed. + MsiPackage + + 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 @@ + + + + + + + + + + + + + + + + + + + + + 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 @@ + + + + + + + + + + + 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 @@ + + + + + + netcoreapp2.1 + false + + + + NU1701 + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 @@ // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -namespace WixToolset.Extensions +namespace WixToolset.DifxApp { using System; using System.Collections.Generic; using System.Xml.Linq; using WixToolset.Data; + using WixToolset.DifxApp.Tuples; using WixToolset.Extensibility; /// /// The compiler for the WiX Toolset Driver Install Frameworks for Applications Extension. /// - public sealed class DifxAppCompiler : CompilerExtension + public sealed class DifxAppCompiler : BaseCompilerExtension { private HashSet components; + public override XNamespace Namespace => "http://wixtoolset.org/schemas/v4/wxs/difxapp"; /// /// Instantiate a new DifxAppCompiler. /// public DifxAppCompiler() { - this.Namespace = "http://wixtoolset.org/schemas/v4/wxs/difxapp"; this.components = new HashSet(); } @@ -31,26 +32,27 @@ namespace WixToolset.Extensions /// Parent element of element to process. /// Element to process. /// Extra information about the context in which this element is being parsed. - public override void ParseElement(XElement parentElement, XElement element, IDictionary context) + public override void ParseElement(Intermediate intermediate, IntermediateSection section, XElement parentElement, XElement element, IDictionary context) { switch (parentElement.Name.LocalName) { case "Component": string componentId = context["ComponentId"]; string directoryId = context["DirectoryId"]; + bool componentWin64 = Boolean.Parse(context["Win64"]); switch (element.Name.LocalName) { case "Driver": - this.ParseDriverElement(element, componentId); + this.ParseDriverElement(intermediate, section, element, componentId, componentWin64); break; default: - this.Core.UnexpectedElement(parentElement, element); + this.ParseHelper.UnexpectedElement(parentElement, element); break; } break; default: - this.Core.UnexpectedElement(parentElement, element); + this.ParseHelper.UnexpectedElement(parentElement, element); break; } } @@ -60,9 +62,9 @@ namespace WixToolset.Extensions /// /// Element to parse. /// Identifier for parent component. - private void ParseDriverElement(XElement node, string componentId) + private void ParseDriverElement(Intermediate intermediate, IntermediateSection section, XElement node, string componentId, bool win64) { - SourceLineNumber sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); + SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node); int attributes = 0; int sequence = CompilerConstants.IntegerNotSet; @@ -71,7 +73,7 @@ namespace WixToolset.Extensions { if (this.components.Contains(componentId)) { - this.Core.OnMessage(WixErrors.TooManyElements(sourceLineNumbers, "Component", node.Name.LocalName, 1)); + this.Messaging.Write(ErrorMessages.TooManyElements(sourceLineNumbers, "Component", node.Name.LocalName, 1)); } else { @@ -86,62 +88,74 @@ namespace WixToolset.Extensions switch (attrib.Name.LocalName) { case "AddRemovePrograms": - if (YesNoType.No == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + if (YesNoType.No == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) { attributes |= 0x4; } break; case "DeleteFiles": - if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) { attributes |= 0x10; } break; case "ForceInstall": - if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) { attributes |= 0x1; } break; case "Legacy": - if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) { attributes |= 0x8; } break; case "PlugAndPlayPrompt": - if (YesNoType.No == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + if (YesNoType.No == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) { attributes |= 0x2; } break; case "Sequence": - sequence = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, int.MaxValue); + sequence = this.ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, int.MaxValue); break; default: - this.Core.UnexpectedAttribute(node, attrib); + this.ParseHelper.UnexpectedAttribute(node, attrib); break; } } else { - this.Core.ParseExtensionAttribute(node, attrib); + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, node, attrib); } } - this.Core.ParseForExtensionElements(node); + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, node); - if (!this.Core.EncounteredError) + if (!this.Messaging.EncounteredError) { - Row row = this.Core.CreateRow(sourceLineNumbers, "MsiDriverPackages"); - row[0] = componentId; - row[1] = attributes; - if (CompilerConstants.IntegerNotSet != sequence) + switch (this.Context.Platform) { - row[2] = sequence; + case Platform.X86: + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "MsiProcessDrivers"); + break; + case Platform.X64: + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "MsiProcessDrivers_x64"); + break; + case Platform.IA64: + case Platform.ARM: + this.Messaging.Write(ErrorMessages.UnsupportedPlatformForElement(sourceLineNumbers, this.Context.Platform.ToString(), node.Name.LocalName)); + break; } - this.Core.CreateSimpleReference(sourceLineNumbers, "CustomAction", "MsiProcessDrivers"); + var row = (MsiDriverPackagesTuple)this.ParseHelper.CreateRow(section, sourceLineNumbers, "MsiDriverPackages"); + row.Set(0, componentId); + row.Set(1, attributes); + if (CompilerConstants.IntegerNotSet != sequence) + { + row.Set(2, sequence); + } } } } 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 @@ // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -namespace WixToolset.Extensions +namespace WixToolset.DifxApp { +#if TODO_CONSIDER_DECOMPILER using System; using System.Collections; using System.Globalization; @@ -93,4 +94,5 @@ namespace WixToolset.Extensions } } } +#endif } 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 @@ // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -namespace WixToolset.Extensions +namespace WixToolset.DifxApp { - using System; - using System.Reflection; using WixToolset.Data; using WixToolset.Extensibility; - /// - /// The WiX Toolset Driver Install Frameworks for Applications Extension. - /// - public sealed class DifxAppExtensionData : ExtensionData + public sealed class DifxAppExtensionData : BaseExtensionData { - private static TableDefinitionCollection tableDefinitions; + public override string DefaultCulture => "en-US"; - /// - /// Gets the optional table definitions for this extension. - /// - /// The optional table definitions for this extension. - public override TableDefinitionCollection TableDefinitions + public override bool TryGetTupleDefinitionByName(string name, out IntermediateTupleDefinition tupleDefinition) { - get - { - return DifxAppExtensionData.GetExtensionTableDefinitions(); - } + tupleDefinition = DifxAppTupleDefinitions.ByName(name); + return tupleDefinition != null; } - /// - /// Internal mechanism to access the extension's table definitions. - /// - /// Extension's table definitions. - internal static TableDefinitionCollection GetExtensionTableDefinitions() + public override Intermediate GetLibrary(ITupleDefinitionCreator tupleDefinitions) { - if (null == DifxAppExtensionData.tableDefinitions) - { - DifxAppExtensionData.tableDefinitions = ExtensionData.LoadTableDefinitionHelper(Assembly.GetExecutingAssembly(), "WixToolset.Extensions.Data.tables.xml"); - } - - return DifxAppExtensionData.tableDefinitions; + return Intermediate.Load(typeof(DifxAppExtensionData).Assembly, "WixToolset.DifxApp.difxapp.wixlib", tupleDefinitions); } } } 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 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.DifxApp +{ + using System; + using System.Collections.Generic; + using WixToolset.Extensibility; + + public class DifxAppExtensionFactory : BaseExtensionFactory + { + protected override IEnumerable ExtensionTypes => new[] + { + typeof(DifxAppCompiler), + typeof(DifxAppExtensionData), + typeof(DifxAppWindowsInstallerBackendBinderExtension), + }; + } +} 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 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.DifxApp +{ + using System.Linq; + using System.Xml; + using WixToolset.Data.WindowsInstaller; + using WixToolset.Extensibility; + + public class DifxAppWindowsInstallerBackendBinderExtension : BaseWindowsInstallerBackendBinderExtension + { + private static readonly TableDefinition[] Tables = LoadTables(); + + protected override TableDefinition[] TableDefinitionsForTuples => Tables; + + private static TableDefinition[] LoadTables() + { + using (var resourceStream = typeof(DifxAppWindowsInstallerBackendBinderExtension).Assembly.GetManifestResourceStream("WixToolset.DifxApp.tables.xml")) + using (var reader = XmlReader.Create(resourceStream)) + { + var tables = TableDefinitionCollection.Load(reader); + return tables.ToArray(); + } + } + } +} 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 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.DifxApp +{ + using System; + using WixToolset.Data; + + public enum DifxAppTupleDefinitionType + { + MsiDriverPackages, + } + + public static partial class DifxAppTupleDefinitions + { + public static readonly Version Version = new Version("4.0.0"); + + public static IntermediateTupleDefinition ByName(string name) + { + if (!Enum.TryParse(name, out DifxAppTupleDefinitionType type)) + { + return null; + } + + return ByType(type); + } + + public static IntermediateTupleDefinition ByType(DifxAppTupleDefinitionType type) + { + switch (type) + { + case DifxAppTupleDefinitionType.MsiDriverPackages: + return DifxAppTupleDefinitions.MsiDriverPackages; + + default: + throw new ArgumentOutOfRangeException(nameof(type)); + } + } + } +} 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 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.DifxApp +{ + using WixToolset.Data; + using WixToolset.DifxApp.Tuples; + + public static partial class DifxAppTupleDefinitions + { + public static readonly IntermediateTupleDefinition MsiDriverPackages = new IntermediateTupleDefinition( + DifxAppTupleDefinitionType.MsiDriverPackages.ToString(), + new[] + { + new IntermediateFieldDefinition(nameof(MsiDriverPackagesTupleFields.Component), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(MsiDriverPackagesTupleFields.Flags), IntermediateFieldType.Number), + new IntermediateFieldDefinition(nameof(MsiDriverPackagesTupleFields.Sequence), IntermediateFieldType.Number), + }, + typeof(MsiDriverPackagesTuple)); + } +} + +namespace WixToolset.DifxApp.Tuples +{ + using WixToolset.Data; + + public enum MsiDriverPackagesTupleFields + { + Component, + Flags, + Sequence, + } + + public class MsiDriverPackagesTuple : IntermediateTuple + { + public MsiDriverPackagesTuple() : base(DifxAppTupleDefinitions.MsiDriverPackages, null, null) + { + } + + public MsiDriverPackagesTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(DifxAppTupleDefinitions.MsiDriverPackages, sourceLineNumber, id) + { + } + + public IntermediateField this[MsiDriverPackagesTupleFields index] => this.Fields[(int)index]; + + public string Component + { + get => this.Fields[(int)MsiDriverPackagesTupleFields.Component].AsString(); + set => this.Set((int)MsiDriverPackagesTupleFields.Component, value); + } + + public int Flags + { + get => this.Fields[(int)MsiDriverPackagesTupleFields.Flags].AsNumber(); + set => this.Set((int)MsiDriverPackagesTupleFields.Flags, value); + } + + public int Sequence + { + get => this.Fields[(int)MsiDriverPackagesTupleFields.Sequence].AsNumber(); + set => this.Set((int)MsiDriverPackagesTupleFields.Sequence, value); + } + } +} \ 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 @@ - - - - - - - {2256EFD7-E678-4485-818D-986D590068BE} - WixDifxAppExtension - Library - WixToolset.Extensions - - - - - - - - $(RootNamespace).Data.tables.xml - - - $(RootNamespace).Xsd.difxapp.xsd - PreserveNewest - - - Designer - WixToolset.Data.Serialize - WixToolset.Extensions.Serialize.DifxApp - - - - - - - - - - - Platform=x86 - false - - - Platform=x64 - false - - - - 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 @@ + + + + + + netstandard2.0 + WixToolset.DifxApp + WiX Toolset DIFxApp Extension + WiX Toolset DIFxApp Extension + true + build + + + + + + + + + + + + + + + + + + + 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 @@ + + + + + + $(MSBuildThisFileDirectory)..\tools\WixToolset.DifxApp.wixext.dll + + + + + 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 @@ - - - - - - - {5066EB93-D8F7-4FAE-B687-024D7A81BD95} - difxapp_$(Platform) - Library - true - true - en-us - - - - - - - $(DefineConstants); - DIFxAppDll=$(ProjectDir)$(Platform)\DIFxApp.dll; - DIFxAppADll=$(ProjectDir)$(Platform)\DIFxAppA.dll; - - - - - - - - - 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 @@ - - - - - - - - VersionNT > 400 - VersionNT > 400 - - - - - - - - - - - - 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 @@ + + + + + + + + + + VersionNT > 400 + VersionNT > 400 + + + + + + + + + + + + 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 @@ + + + + + + + + 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 @@ + + + + + + + + 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 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 @@ + + + + + + + {5066EB93-D8F7-4FAE-B687-024D7A81BD95} + difxapp + Library + true + true + en-us + + + + + + + + + + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + diff --git a/src/wixlib/packages.config b/src/wixlib/packages.config new file mode 100644 index 00000000..7964daed --- /dev/null +++ b/src/wixlib/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/version.json b/version.json new file mode 100644 index 00000000..5f857771 --- /dev/null +++ b/version.json @@ -0,0 +1,11 @@ +{ + "version": "4.0", + "publicReleaseRefSpec": [ + "^refs/heads/master$" + ], + "cloudBuild": { + "buildNumber": { + "enabled": true + } + } +} -- cgit v1.2.3-55-g6feb From 7132f1882ebcfeb0113730bd722fa3587bc5e5f4 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Wed, 8 Apr 2020 14:06:02 +1000 Subject: Update dependencies. --- appveyor.yml | 2 +- src/FindLocalWix.props | 2 +- .../WixToolsetTest.DifxApp/WixToolsetTest.DifxApp.csproj | 13 ++++++++----- src/wixext/DifxAppWindowsInstallerBackendBinderExtension.cs | 3 ++- src/wixlib/difxapp.wixproj | 4 ++-- src/wixlib/packages.config | 2 +- 6 files changed, 15 insertions(+), 11 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 8d80c6af..522e5af3 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -8,7 +8,7 @@ branches: - master - develop -image: Visual Studio 2017 +image: Visual Studio 2019 version: 0.0.0.{build} configuration: Release diff --git a/src/FindLocalWix.props b/src/FindLocalWix.props index a784e352..1666e4fe 100644 --- a/src/FindLocalWix.props +++ b/src/FindLocalWix.props @@ -3,6 +3,6 @@ - $(MSBuildThisFileDirectory)..\..\Tools\build\Debug\net461\wix.targets + $(MSBuildThisFileDirectory)..\..\Tools\build\Debug\net461\wix.targets diff --git a/src/test/WixToolsetTest.DifxApp/WixToolsetTest.DifxApp.csproj b/src/test/WixToolsetTest.DifxApp/WixToolsetTest.DifxApp.csproj index d2d0de50..e205d24a 100644 --- a/src/test/WixToolsetTest.DifxApp/WixToolsetTest.DifxApp.csproj +++ b/src/test/WixToolsetTest.DifxApp/WixToolsetTest.DifxApp.csproj @@ -3,7 +3,7 @@ - netcoreapp2.1 + netcoreapp3.1 false @@ -23,7 +23,10 @@ - + + + + @@ -31,8 +34,8 @@ - - - + + + diff --git a/src/wixext/DifxAppWindowsInstallerBackendBinderExtension.cs b/src/wixext/DifxAppWindowsInstallerBackendBinderExtension.cs index 4d81c134..c87a661b 100644 --- a/src/wixext/DifxAppWindowsInstallerBackendBinderExtension.cs +++ b/src/wixext/DifxAppWindowsInstallerBackendBinderExtension.cs @@ -2,6 +2,7 @@ namespace WixToolset.DifxApp { + using System.Collections.Generic; using System.Linq; using System.Xml; using WixToolset.Data.WindowsInstaller; @@ -11,7 +12,7 @@ namespace WixToolset.DifxApp { private static readonly TableDefinition[] Tables = LoadTables(); - protected override TableDefinition[] TableDefinitionsForTuples => Tables; + public override IEnumerable TableDefinitions => Tables; private static TableDefinition[] LoadTables() { diff --git a/src/wixlib/difxapp.wixproj b/src/wixlib/difxapp.wixproj index 9b414afd..a7f60ea5 100644 --- a/src/wixlib/difxapp.wixproj +++ b/src/wixlib/difxapp.wixproj @@ -1,7 +1,7 @@ - + {5066EB93-D8F7-4FAE-B687-024D7A81BD95} @@ -33,7 +33,7 @@ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + diff --git a/src/wixlib/packages.config b/src/wixlib/packages.config index 7964daed..e1b601f6 100644 --- a/src/wixlib/packages.config +++ b/src/wixlib/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file -- cgit v1.2.3-55-g6feb From a10c87c97c270b9c6c923fbb4e61e2fe779d9107 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Wed, 8 Apr 2020 14:19:21 +1000 Subject: Modernize DifxAppCompiler and tuples. --- .../DifxAppExtensionFixture.cs | 10 ++++---- src/wixext/DifxAppCompiler.cs | 27 ++++++++++++---------- src/wixext/DifxAppTableDefinitions.cs | 26 +++++++++++++++++++++ ...ifxAppWindowsInstallerBackendBinderExtension.cs | 18 ++------------- src/wixext/Tuples/MsiDriverPackagesTuple.cs | 10 ++++---- src/wixext/WixToolset.DifxApp.wixext.csproj | 1 - src/wixext/tables.xml | 14 ----------- 7 files changed, 53 insertions(+), 53 deletions(-) create mode 100644 src/wixext/DifxAppTableDefinitions.cs delete mode 100644 src/wixext/tables.xml diff --git a/src/test/WixToolsetTest.DifxApp/DifxAppExtensionFixture.cs b/src/test/WixToolsetTest.DifxApp/DifxAppExtensionFixture.cs index dbe257fa..64acec91 100644 --- a/src/test/WixToolsetTest.DifxApp/DifxAppExtensionFixture.cs +++ b/src/test/WixToolsetTest.DifxApp/DifxAppExtensionFixture.cs @@ -19,11 +19,11 @@ namespace WixToolsetTest.DifxApp var results = build.BuildAndQuery(Build, "CustomAction"); Assert.Equal(new[] { - "CustomAction:MsiCleanupOnSuccess\t1\tDIFxApp.dll\tCleanupOnSuccess\t0", - "CustomAction:MsiInstallDrivers\t3073\tDIFxAppA.dll\tInstallDriverPackages\t0", - "CustomAction:MsiProcessDrivers\t1\tDIFxApp.dll\tProcessDriverPackages\t0", - "CustomAction:MsiRollbackInstall\t3329\tDIFxAppA.dll\tRollbackInstall\t0", - "CustomAction:MsiUninstallDrivers\t3073\tDIFxAppA.dll\tUninstallDriverPackages\t0", + "CustomAction:MsiCleanupOnSuccess\t1\tDIFxApp.dll\tCleanupOnSuccess\t", + "CustomAction:MsiInstallDrivers\t3073\tDIFxAppA.dll\tInstallDriverPackages\t", + "CustomAction:MsiProcessDrivers\t1\tDIFxApp.dll\tProcessDriverPackages\t", + "CustomAction:MsiRollbackInstall\t3329\tDIFxAppA.dll\tRollbackInstall\t", + "CustomAction:MsiUninstallDrivers\t3073\tDIFxAppA.dll\tUninstallDriverPackages\t", }, results.OrderBy(s => s).ToArray()); } diff --git a/src/wixext/DifxAppCompiler.cs b/src/wixext/DifxAppCompiler.cs index 98f36b3f..4d0b8ec9 100644 --- a/src/wixext/DifxAppCompiler.cs +++ b/src/wixext/DifxAppCompiler.cs @@ -37,9 +37,9 @@ namespace WixToolset.DifxApp switch (parentElement.Name.LocalName) { case "Component": - string componentId = context["ComponentId"]; - string directoryId = context["DirectoryId"]; - bool componentWin64 = Boolean.Parse(context["Win64"]); + var componentId = context["ComponentId"]; + var directoryId = context["DirectoryId"]; + var componentWin64 = Boolean.Parse(context["Win64"]); switch (element.Name.LocalName) { @@ -64,9 +64,9 @@ namespace WixToolset.DifxApp /// Identifier for parent component. private void ParseDriverElement(Intermediate intermediate, IntermediateSection section, XElement node, string componentId, bool win64) { - SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node); + var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node); int attributes = 0; - int sequence = CompilerConstants.IntegerNotSet; + var sequence = CompilerConstants.IntegerNotSet; // check the number of times a Driver element has been nested under this Component element if (null != componentId) @@ -81,7 +81,7 @@ namespace WixToolset.DifxApp } } - foreach (XAttribute attrib in node.Attributes()) + foreach (var attrib in node.Attributes()) { if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) { @@ -138,10 +138,10 @@ namespace WixToolset.DifxApp switch (this.Context.Platform) { case Platform.X86: - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "MsiProcessDrivers"); + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, TupleDefinitions.CustomAction, "MsiProcessDrivers"); break; case Platform.X64: - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "MsiProcessDrivers_x64"); + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, TupleDefinitions.CustomAction, "MsiProcessDrivers_x64"); break; case Platform.IA64: case Platform.ARM: @@ -149,12 +149,15 @@ namespace WixToolset.DifxApp break; } - var row = (MsiDriverPackagesTuple)this.ParseHelper.CreateRow(section, sourceLineNumbers, "MsiDriverPackages"); - row.Set(0, componentId); - row.Set(1, attributes); + var tuple = section.AddTuple(new MsiDriverPackagesTuple(sourceLineNumbers) + { + ComponentRef = componentId, + Flags = attributes, + }); + if (CompilerConstants.IntegerNotSet != sequence) { - row.Set(2, sequence); + tuple.Sequence = sequence; } } } diff --git a/src/wixext/DifxAppTableDefinitions.cs b/src/wixext/DifxAppTableDefinitions.cs new file mode 100644 index 00000000..1ee33196 --- /dev/null +++ b/src/wixext/DifxAppTableDefinitions.cs @@ -0,0 +1,26 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.DifxApp +{ + using WixToolset.Data.WindowsInstaller; + + public static class DifxAppTableDefinitions + { + public static readonly TableDefinition MsiDriverPackages = new TableDefinition( + "MsiDriverPackages", + new[] + { + 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), + new ColumnDefinition("Flags", ColumnType.Number, 4, primaryKey: false, nullable: false, ColumnCategory.Unknown, minValue: 0, maxValue: 31, description: "Flags for installing and uninstalling driver packages"), + new ColumnDefinition("Sequence", ColumnType.Number, 4, primaryKey: false, nullable: true, ColumnCategory.Unknown, minValue: 0, description: "Order in which the driver packages are processed"), + }, + tupleDefinitionName: DifxAppTupleDefinitions.MsiDriverPackages.Name, + tupleIdIsPrimaryKey: false + ); + + public static readonly TableDefinition[] All = new[] + { + MsiDriverPackages, + }; + } +} diff --git a/src/wixext/DifxAppWindowsInstallerBackendBinderExtension.cs b/src/wixext/DifxAppWindowsInstallerBackendBinderExtension.cs index c87a661b..d3bbc0eb 100644 --- a/src/wixext/DifxAppWindowsInstallerBackendBinderExtension.cs +++ b/src/wixext/DifxAppWindowsInstallerBackendBinderExtension.cs @@ -1,27 +1,13 @@ -// 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. +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. namespace WixToolset.DifxApp { using System.Collections.Generic; - using System.Linq; - using System.Xml; using WixToolset.Data.WindowsInstaller; using WixToolset.Extensibility; public class DifxAppWindowsInstallerBackendBinderExtension : BaseWindowsInstallerBackendBinderExtension { - private static readonly TableDefinition[] Tables = LoadTables(); - - public override IEnumerable TableDefinitions => Tables; - - private static TableDefinition[] LoadTables() - { - using (var resourceStream = typeof(DifxAppWindowsInstallerBackendBinderExtension).Assembly.GetManifestResourceStream("WixToolset.DifxApp.tables.xml")) - using (var reader = XmlReader.Create(resourceStream)) - { - var tables = TableDefinitionCollection.Load(reader); - return tables.ToArray(); - } - } + public override IEnumerable TableDefinitions => DifxAppTableDefinitions.All; } } diff --git a/src/wixext/Tuples/MsiDriverPackagesTuple.cs b/src/wixext/Tuples/MsiDriverPackagesTuple.cs index aecc7e77..a1063972 100644 --- a/src/wixext/Tuples/MsiDriverPackagesTuple.cs +++ b/src/wixext/Tuples/MsiDriverPackagesTuple.cs @@ -11,7 +11,7 @@ namespace WixToolset.DifxApp DifxAppTupleDefinitionType.MsiDriverPackages.ToString(), new[] { - new IntermediateFieldDefinition(nameof(MsiDriverPackagesTupleFields.Component), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(MsiDriverPackagesTupleFields.ComponentRef), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(MsiDriverPackagesTupleFields.Flags), IntermediateFieldType.Number), new IntermediateFieldDefinition(nameof(MsiDriverPackagesTupleFields.Sequence), IntermediateFieldType.Number), }, @@ -25,7 +25,7 @@ namespace WixToolset.DifxApp.Tuples public enum MsiDriverPackagesTupleFields { - Component, + ComponentRef, Flags, Sequence, } @@ -42,10 +42,10 @@ namespace WixToolset.DifxApp.Tuples public IntermediateField this[MsiDriverPackagesTupleFields index] => this.Fields[(int)index]; - public string Component + public string ComponentRef { - get => this.Fields[(int)MsiDriverPackagesTupleFields.Component].AsString(); - set => this.Set((int)MsiDriverPackagesTupleFields.Component, value); + get => this.Fields[(int)MsiDriverPackagesTupleFields.ComponentRef].AsString(); + set => this.Set((int)MsiDriverPackagesTupleFields.ComponentRef, value); } public int Flags diff --git a/src/wixext/WixToolset.DifxApp.wixext.csproj b/src/wixext/WixToolset.DifxApp.wixext.csproj index 5717b42a..ca27b04e 100644 --- a/src/wixext/WixToolset.DifxApp.wixext.csproj +++ b/src/wixext/WixToolset.DifxApp.wixext.csproj @@ -13,7 +13,6 @@ - diff --git a/src/wixext/tables.xml b/src/wixext/tables.xml deleted file mode 100644 index c328f875..00000000 --- a/src/wixext/tables.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - -- cgit v1.2.3-55-g6feb From 881f9d05042b72ea34382fc0c148a8cfbca06c9c Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Mon, 13 Apr 2020 20:06:13 +1000 Subject: Update dependencies. --- appveyor.yml | 2 -- src/test/WixToolsetTest.DifxApp/DifxAppExtensionFixture.cs | 2 +- src/wixext/DifxAppTableDefinitions.cs | 2 +- src/wixext/Tuples/MsiDriverPackagesTuple.cs | 4 ++-- src/wixlib/difxapp.wixproj | 4 ++-- src/wixlib/packages.config | 2 +- 6 files changed, 7 insertions(+), 9 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 522e5af3..7c686b04 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -33,8 +33,6 @@ skip_tags: true artifacts: - path: build\Release\**\*.nupkg name: nuget -- path: build\Release\**\*.msi - name: msi notifications: - provider: Slack diff --git a/src/test/WixToolsetTest.DifxApp/DifxAppExtensionFixture.cs b/src/test/WixToolsetTest.DifxApp/DifxAppExtensionFixture.cs index 64acec91..f5166453 100644 --- a/src/test/WixToolsetTest.DifxApp/DifxAppExtensionFixture.cs +++ b/src/test/WixToolsetTest.DifxApp/DifxAppExtensionFixture.cs @@ -24,7 +24,7 @@ namespace WixToolsetTest.DifxApp "CustomAction:MsiProcessDrivers\t1\tDIFxApp.dll\tProcessDriverPackages\t", "CustomAction:MsiRollbackInstall\t3329\tDIFxAppA.dll\tRollbackInstall\t", "CustomAction:MsiUninstallDrivers\t3073\tDIFxAppA.dll\tUninstallDriverPackages\t", - }, results.OrderBy(s => s).ToArray()); + }, results); } private static void Build(string[] args) diff --git a/src/wixext/DifxAppTableDefinitions.cs b/src/wixext/DifxAppTableDefinitions.cs index 1ee33196..8c92c94f 100644 --- a/src/wixext/DifxAppTableDefinitions.cs +++ b/src/wixext/DifxAppTableDefinitions.cs @@ -8,13 +8,13 @@ namespace WixToolset.DifxApp { public static readonly TableDefinition MsiDriverPackages = new TableDefinition( "MsiDriverPackages", + DifxAppTupleDefinitions.MsiDriverPackages, new[] { 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), new ColumnDefinition("Flags", ColumnType.Number, 4, primaryKey: false, nullable: false, ColumnCategory.Unknown, minValue: 0, maxValue: 31, description: "Flags for installing and uninstalling driver packages"), new ColumnDefinition("Sequence", ColumnType.Number, 4, primaryKey: false, nullable: true, ColumnCategory.Unknown, minValue: 0, description: "Order in which the driver packages are processed"), }, - tupleDefinitionName: DifxAppTupleDefinitions.MsiDriverPackages.Name, tupleIdIsPrimaryKey: false ); diff --git a/src/wixext/Tuples/MsiDriverPackagesTuple.cs b/src/wixext/Tuples/MsiDriverPackagesTuple.cs index a1063972..9c57e47c 100644 --- a/src/wixext/Tuples/MsiDriverPackagesTuple.cs +++ b/src/wixext/Tuples/MsiDriverPackagesTuple.cs @@ -54,9 +54,9 @@ namespace WixToolset.DifxApp.Tuples set => this.Set((int)MsiDriverPackagesTupleFields.Flags, value); } - public int Sequence + public int? Sequence { - get => this.Fields[(int)MsiDriverPackagesTupleFields.Sequence].AsNumber(); + get => this.Fields[(int)MsiDriverPackagesTupleFields.Sequence].AsNullableNumber(); set => this.Set((int)MsiDriverPackagesTupleFields.Sequence, value); } } diff --git a/src/wixlib/difxapp.wixproj b/src/wixlib/difxapp.wixproj index a7f60ea5..c5c745ae 100644 --- a/src/wixlib/difxapp.wixproj +++ b/src/wixlib/difxapp.wixproj @@ -1,7 +1,7 @@ - + {5066EB93-D8F7-4FAE-B687-024D7A81BD95} @@ -33,7 +33,7 @@ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + diff --git a/src/wixlib/packages.config b/src/wixlib/packages.config index e1b601f6..1e5a9850 100644 --- a/src/wixlib/packages.config +++ b/src/wixlib/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file -- cgit v1.2.3-55-g6feb From 8e0423b251346b66627795b4ae1cbdebcb7c5784 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Sat, 27 Jun 2020 12:07:22 -0700 Subject: The Great Tuple to Symbol Rename (tm) --- src/wixext/DifxAppCompiler.cs | 10 +++---- src/wixext/DifxAppExtensionData.cs | 10 +++---- src/wixext/DifxAppTableDefinitions.cs | 4 +-- src/wixext/Tuples/DifxAppTupleDefinitions.cs | 14 +++++----- src/wixext/Tuples/MsiDriverPackagesTuple.cs | 40 ++++++++++++++-------------- 5 files changed, 39 insertions(+), 39 deletions(-) diff --git a/src/wixext/DifxAppCompiler.cs b/src/wixext/DifxAppCompiler.cs index 4d0b8ec9..e3687a49 100644 --- a/src/wixext/DifxAppCompiler.cs +++ b/src/wixext/DifxAppCompiler.cs @@ -6,7 +6,7 @@ namespace WixToolset.DifxApp using System.Collections.Generic; using System.Xml.Linq; using WixToolset.Data; - using WixToolset.DifxApp.Tuples; + using WixToolset.DifxApp.Symbols; using WixToolset.Extensibility; /// @@ -138,10 +138,10 @@ namespace WixToolset.DifxApp switch (this.Context.Platform) { case Platform.X86: - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, TupleDefinitions.CustomAction, "MsiProcessDrivers"); + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, SymbolDefinitions.CustomAction, "MsiProcessDrivers"); break; case Platform.X64: - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, TupleDefinitions.CustomAction, "MsiProcessDrivers_x64"); + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, SymbolDefinitions.CustomAction, "MsiProcessDrivers_x64"); break; case Platform.IA64: case Platform.ARM: @@ -149,7 +149,7 @@ namespace WixToolset.DifxApp break; } - var tuple = section.AddTuple(new MsiDriverPackagesTuple(sourceLineNumbers) + var symbol = section.AddSymbol(new MsiDriverPackagesSymbol(sourceLineNumbers) { ComponentRef = componentId, Flags = attributes, @@ -157,7 +157,7 @@ namespace WixToolset.DifxApp if (CompilerConstants.IntegerNotSet != sequence) { - tuple.Sequence = sequence; + symbol.Sequence = sequence; } } } diff --git a/src/wixext/DifxAppExtensionData.cs b/src/wixext/DifxAppExtensionData.cs index 49e1354f..31a95b8e 100644 --- a/src/wixext/DifxAppExtensionData.cs +++ b/src/wixext/DifxAppExtensionData.cs @@ -9,15 +9,15 @@ namespace WixToolset.DifxApp { public override string DefaultCulture => "en-US"; - public override bool TryGetTupleDefinitionByName(string name, out IntermediateTupleDefinition tupleDefinition) + public override bool TryGetSymbolDefinitionByName(string name, out IntermediateSymbolDefinition symbolDefinition) { - tupleDefinition = DifxAppTupleDefinitions.ByName(name); - return tupleDefinition != null; + symbolDefinition = DifxAppSymbolDefinitions.ByName(name); + return symbolDefinition != null; } - public override Intermediate GetLibrary(ITupleDefinitionCreator tupleDefinitions) + public override Intermediate GetLibrary(ISymbolDefinitionCreator symbolDefinitions) { - return Intermediate.Load(typeof(DifxAppExtensionData).Assembly, "WixToolset.DifxApp.difxapp.wixlib", tupleDefinitions); + return Intermediate.Load(typeof(DifxAppExtensionData).Assembly, "WixToolset.DifxApp.difxapp.wixlib", symbolDefinitions); } } } diff --git a/src/wixext/DifxAppTableDefinitions.cs b/src/wixext/DifxAppTableDefinitions.cs index 8c92c94f..a6c26444 100644 --- a/src/wixext/DifxAppTableDefinitions.cs +++ b/src/wixext/DifxAppTableDefinitions.cs @@ -8,14 +8,14 @@ namespace WixToolset.DifxApp { public static readonly TableDefinition MsiDriverPackages = new TableDefinition( "MsiDriverPackages", - DifxAppTupleDefinitions.MsiDriverPackages, + DifxAppSymbolDefinitions.MsiDriverPackages, new[] { 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), new ColumnDefinition("Flags", ColumnType.Number, 4, primaryKey: false, nullable: false, ColumnCategory.Unknown, minValue: 0, maxValue: 31, description: "Flags for installing and uninstalling driver packages"), new ColumnDefinition("Sequence", ColumnType.Number, 4, primaryKey: false, nullable: true, ColumnCategory.Unknown, minValue: 0, description: "Order in which the driver packages are processed"), }, - tupleIdIsPrimaryKey: false + symbolIdIsPrimaryKey: false ); public static readonly TableDefinition[] All = new[] diff --git a/src/wixext/Tuples/DifxAppTupleDefinitions.cs b/src/wixext/Tuples/DifxAppTupleDefinitions.cs index 37dabb86..76f4d88f 100644 --- a/src/wixext/Tuples/DifxAppTupleDefinitions.cs +++ b/src/wixext/Tuples/DifxAppTupleDefinitions.cs @@ -5,18 +5,18 @@ namespace WixToolset.DifxApp using System; using WixToolset.Data; - public enum DifxAppTupleDefinitionType + public enum DifxAppSymbolDefinitionType { MsiDriverPackages, } - public static partial class DifxAppTupleDefinitions + public static partial class DifxAppSymbolDefinitions { public static readonly Version Version = new Version("4.0.0"); - public static IntermediateTupleDefinition ByName(string name) + public static IntermediateSymbolDefinition ByName(string name) { - if (!Enum.TryParse(name, out DifxAppTupleDefinitionType type)) + if (!Enum.TryParse(name, out DifxAppSymbolDefinitionType type)) { return null; } @@ -24,12 +24,12 @@ namespace WixToolset.DifxApp return ByType(type); } - public static IntermediateTupleDefinition ByType(DifxAppTupleDefinitionType type) + public static IntermediateSymbolDefinition ByType(DifxAppSymbolDefinitionType type) { switch (type) { - case DifxAppTupleDefinitionType.MsiDriverPackages: - return DifxAppTupleDefinitions.MsiDriverPackages; + case DifxAppSymbolDefinitionType.MsiDriverPackages: + return DifxAppSymbolDefinitions.MsiDriverPackages; default: throw new ArgumentOutOfRangeException(nameof(type)); diff --git a/src/wixext/Tuples/MsiDriverPackagesTuple.cs b/src/wixext/Tuples/MsiDriverPackagesTuple.cs index 9c57e47c..2fd91bc8 100644 --- a/src/wixext/Tuples/MsiDriverPackagesTuple.cs +++ b/src/wixext/Tuples/MsiDriverPackagesTuple.cs @@ -3,61 +3,61 @@ namespace WixToolset.DifxApp { using WixToolset.Data; - using WixToolset.DifxApp.Tuples; + using WixToolset.DifxApp.Symbols; - public static partial class DifxAppTupleDefinitions + public static partial class DifxAppSymbolDefinitions { - public static readonly IntermediateTupleDefinition MsiDriverPackages = new IntermediateTupleDefinition( - DifxAppTupleDefinitionType.MsiDriverPackages.ToString(), + public static readonly IntermediateSymbolDefinition MsiDriverPackages = new IntermediateSymbolDefinition( + DifxAppSymbolDefinitionType.MsiDriverPackages.ToString(), new[] { - new IntermediateFieldDefinition(nameof(MsiDriverPackagesTupleFields.ComponentRef), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(MsiDriverPackagesTupleFields.Flags), IntermediateFieldType.Number), - new IntermediateFieldDefinition(nameof(MsiDriverPackagesTupleFields.Sequence), IntermediateFieldType.Number), + new IntermediateFieldDefinition(nameof(MsiDriverPackagesSymbolFields.ComponentRef), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(MsiDriverPackagesSymbolFields.Flags), IntermediateFieldType.Number), + new IntermediateFieldDefinition(nameof(MsiDriverPackagesSymbolFields.Sequence), IntermediateFieldType.Number), }, - typeof(MsiDriverPackagesTuple)); + typeof(MsiDriverPackagesSymbol)); } } -namespace WixToolset.DifxApp.Tuples +namespace WixToolset.DifxApp.Symbols { using WixToolset.Data; - public enum MsiDriverPackagesTupleFields + public enum MsiDriverPackagesSymbolFields { ComponentRef, Flags, Sequence, } - public class MsiDriverPackagesTuple : IntermediateTuple + public class MsiDriverPackagesSymbol : IntermediateSymbol { - public MsiDriverPackagesTuple() : base(DifxAppTupleDefinitions.MsiDriverPackages, null, null) + public MsiDriverPackagesSymbol() : base(DifxAppSymbolDefinitions.MsiDriverPackages, null, null) { } - public MsiDriverPackagesTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(DifxAppTupleDefinitions.MsiDriverPackages, sourceLineNumber, id) + public MsiDriverPackagesSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(DifxAppSymbolDefinitions.MsiDriverPackages, sourceLineNumber, id) { } - public IntermediateField this[MsiDriverPackagesTupleFields index] => this.Fields[(int)index]; + public IntermediateField this[MsiDriverPackagesSymbolFields index] => this.Fields[(int)index]; public string ComponentRef { - get => this.Fields[(int)MsiDriverPackagesTupleFields.ComponentRef].AsString(); - set => this.Set((int)MsiDriverPackagesTupleFields.ComponentRef, value); + get => this.Fields[(int)MsiDriverPackagesSymbolFields.ComponentRef].AsString(); + set => this.Set((int)MsiDriverPackagesSymbolFields.ComponentRef, value); } public int Flags { - get => this.Fields[(int)MsiDriverPackagesTupleFields.Flags].AsNumber(); - set => this.Set((int)MsiDriverPackagesTupleFields.Flags, value); + get => this.Fields[(int)MsiDriverPackagesSymbolFields.Flags].AsNumber(); + set => this.Set((int)MsiDriverPackagesSymbolFields.Flags, value); } public int? Sequence { - get => this.Fields[(int)MsiDriverPackagesTupleFields.Sequence].AsNullableNumber(); - set => this.Set((int)MsiDriverPackagesTupleFields.Sequence, value); + get => this.Fields[(int)MsiDriverPackagesSymbolFields.Sequence].AsNullableNumber(); + set => this.Set((int)MsiDriverPackagesSymbolFields.Sequence, value); } } } \ No newline at end of file -- cgit v1.2.3-55-g6feb From a790cb2da9600562e2622eb074274b0d69257484 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Sat, 27 Jun 2020 12:08:02 -0700 Subject: The Great Tuple to Symbol File Rename (tm) --- src/wixext/Symbols/DifxAppSymbolDefinitions.cs | 39 ++++++++++++++++ src/wixext/Symbols/MsiDriverPackagesSymbol.cs | 63 ++++++++++++++++++++++++++ src/wixext/Tuples/DifxAppTupleDefinitions.cs | 39 ---------------- src/wixext/Tuples/MsiDriverPackagesTuple.cs | 63 -------------------------- 4 files changed, 102 insertions(+), 102 deletions(-) create mode 100644 src/wixext/Symbols/DifxAppSymbolDefinitions.cs create mode 100644 src/wixext/Symbols/MsiDriverPackagesSymbol.cs delete mode 100644 src/wixext/Tuples/DifxAppTupleDefinitions.cs delete mode 100644 src/wixext/Tuples/MsiDriverPackagesTuple.cs diff --git a/src/wixext/Symbols/DifxAppSymbolDefinitions.cs b/src/wixext/Symbols/DifxAppSymbolDefinitions.cs new file mode 100644 index 00000000..76f4d88f --- /dev/null +++ b/src/wixext/Symbols/DifxAppSymbolDefinitions.cs @@ -0,0 +1,39 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.DifxApp +{ + using System; + using WixToolset.Data; + + public enum DifxAppSymbolDefinitionType + { + MsiDriverPackages, + } + + public static partial class DifxAppSymbolDefinitions + { + public static readonly Version Version = new Version("4.0.0"); + + public static IntermediateSymbolDefinition ByName(string name) + { + if (!Enum.TryParse(name, out DifxAppSymbolDefinitionType type)) + { + return null; + } + + return ByType(type); + } + + public static IntermediateSymbolDefinition ByType(DifxAppSymbolDefinitionType type) + { + switch (type) + { + case DifxAppSymbolDefinitionType.MsiDriverPackages: + return DifxAppSymbolDefinitions.MsiDriverPackages; + + default: + throw new ArgumentOutOfRangeException(nameof(type)); + } + } + } +} diff --git a/src/wixext/Symbols/MsiDriverPackagesSymbol.cs b/src/wixext/Symbols/MsiDriverPackagesSymbol.cs new file mode 100644 index 00000000..2fd91bc8 --- /dev/null +++ b/src/wixext/Symbols/MsiDriverPackagesSymbol.cs @@ -0,0 +1,63 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.DifxApp +{ + using WixToolset.Data; + using WixToolset.DifxApp.Symbols; + + public static partial class DifxAppSymbolDefinitions + { + public static readonly IntermediateSymbolDefinition MsiDriverPackages = new IntermediateSymbolDefinition( + DifxAppSymbolDefinitionType.MsiDriverPackages.ToString(), + new[] + { + new IntermediateFieldDefinition(nameof(MsiDriverPackagesSymbolFields.ComponentRef), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(MsiDriverPackagesSymbolFields.Flags), IntermediateFieldType.Number), + new IntermediateFieldDefinition(nameof(MsiDriverPackagesSymbolFields.Sequence), IntermediateFieldType.Number), + }, + typeof(MsiDriverPackagesSymbol)); + } +} + +namespace WixToolset.DifxApp.Symbols +{ + using WixToolset.Data; + + public enum MsiDriverPackagesSymbolFields + { + ComponentRef, + Flags, + Sequence, + } + + public class MsiDriverPackagesSymbol : IntermediateSymbol + { + public MsiDriverPackagesSymbol() : base(DifxAppSymbolDefinitions.MsiDriverPackages, null, null) + { + } + + public MsiDriverPackagesSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(DifxAppSymbolDefinitions.MsiDriverPackages, sourceLineNumber, id) + { + } + + public IntermediateField this[MsiDriverPackagesSymbolFields index] => this.Fields[(int)index]; + + public string ComponentRef + { + get => this.Fields[(int)MsiDriverPackagesSymbolFields.ComponentRef].AsString(); + set => this.Set((int)MsiDriverPackagesSymbolFields.ComponentRef, value); + } + + public int Flags + { + get => this.Fields[(int)MsiDriverPackagesSymbolFields.Flags].AsNumber(); + set => this.Set((int)MsiDriverPackagesSymbolFields.Flags, value); + } + + public int? Sequence + { + get => this.Fields[(int)MsiDriverPackagesSymbolFields.Sequence].AsNullableNumber(); + set => this.Set((int)MsiDriverPackagesSymbolFields.Sequence, value); + } + } +} \ No newline at end of file diff --git a/src/wixext/Tuples/DifxAppTupleDefinitions.cs b/src/wixext/Tuples/DifxAppTupleDefinitions.cs deleted file mode 100644 index 76f4d88f..00000000 --- a/src/wixext/Tuples/DifxAppTupleDefinitions.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.DifxApp -{ - using System; - using WixToolset.Data; - - public enum DifxAppSymbolDefinitionType - { - MsiDriverPackages, - } - - public static partial class DifxAppSymbolDefinitions - { - public static readonly Version Version = new Version("4.0.0"); - - public static IntermediateSymbolDefinition ByName(string name) - { - if (!Enum.TryParse(name, out DifxAppSymbolDefinitionType type)) - { - return null; - } - - return ByType(type); - } - - public static IntermediateSymbolDefinition ByType(DifxAppSymbolDefinitionType type) - { - switch (type) - { - case DifxAppSymbolDefinitionType.MsiDriverPackages: - return DifxAppSymbolDefinitions.MsiDriverPackages; - - default: - throw new ArgumentOutOfRangeException(nameof(type)); - } - } - } -} diff --git a/src/wixext/Tuples/MsiDriverPackagesTuple.cs b/src/wixext/Tuples/MsiDriverPackagesTuple.cs deleted file mode 100644 index 2fd91bc8..00000000 --- a/src/wixext/Tuples/MsiDriverPackagesTuple.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.DifxApp -{ - using WixToolset.Data; - using WixToolset.DifxApp.Symbols; - - public static partial class DifxAppSymbolDefinitions - { - public static readonly IntermediateSymbolDefinition MsiDriverPackages = new IntermediateSymbolDefinition( - DifxAppSymbolDefinitionType.MsiDriverPackages.ToString(), - new[] - { - new IntermediateFieldDefinition(nameof(MsiDriverPackagesSymbolFields.ComponentRef), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(MsiDriverPackagesSymbolFields.Flags), IntermediateFieldType.Number), - new IntermediateFieldDefinition(nameof(MsiDriverPackagesSymbolFields.Sequence), IntermediateFieldType.Number), - }, - typeof(MsiDriverPackagesSymbol)); - } -} - -namespace WixToolset.DifxApp.Symbols -{ - using WixToolset.Data; - - public enum MsiDriverPackagesSymbolFields - { - ComponentRef, - Flags, - Sequence, - } - - public class MsiDriverPackagesSymbol : IntermediateSymbol - { - public MsiDriverPackagesSymbol() : base(DifxAppSymbolDefinitions.MsiDriverPackages, null, null) - { - } - - public MsiDriverPackagesSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(DifxAppSymbolDefinitions.MsiDriverPackages, sourceLineNumber, id) - { - } - - public IntermediateField this[MsiDriverPackagesSymbolFields index] => this.Fields[(int)index]; - - public string ComponentRef - { - get => this.Fields[(int)MsiDriverPackagesSymbolFields.ComponentRef].AsString(); - set => this.Set((int)MsiDriverPackagesSymbolFields.ComponentRef, value); - } - - public int Flags - { - get => this.Fields[(int)MsiDriverPackagesSymbolFields.Flags].AsNumber(); - set => this.Set((int)MsiDriverPackagesSymbolFields.Flags, value); - } - - public int? Sequence - { - get => this.Fields[(int)MsiDriverPackagesSymbolFields.Sequence].AsNullableNumber(); - set => this.Set((int)MsiDriverPackagesSymbolFields.Sequence, value); - } - } -} \ No newline at end of file -- cgit v1.2.3-55-g6feb From 2e27fae0ba1af2127ff77f5e1fca93c0e6c78a7a Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Sat, 27 Jun 2020 12:08:12 -0700 Subject: Build wixlib with WixToolset.Sdk --- global.json | 5 +++++ src/FindLocalWix.props | 8 -------- src/wixlib/difxapp.wixproj | 31 +++---------------------------- src/wixlib/packages.config | 5 ----- 4 files changed, 8 insertions(+), 41 deletions(-) create mode 100644 global.json delete mode 100644 src/FindLocalWix.props delete mode 100644 src/wixlib/packages.config diff --git a/global.json b/global.json new file mode 100644 index 00000000..7a995d0a --- /dev/null +++ b/global.json @@ -0,0 +1,5 @@ +{ + "msbuild-sdks": { + "WixToolset.Sdk": "4.0.0-build-0143" + } +} diff --git a/src/FindLocalWix.props b/src/FindLocalWix.props deleted file mode 100644 index 1666e4fe..00000000 --- a/src/FindLocalWix.props +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - $(MSBuildThisFileDirectory)..\..\Tools\build\Debug\net461\wix.targets - - diff --git a/src/wixlib/difxapp.wixproj b/src/wixlib/difxapp.wixproj index c5c745ae..4f368c0e 100644 --- a/src/wixlib/difxapp.wixproj +++ b/src/wixlib/difxapp.wixproj @@ -1,39 +1,14 @@ - - - - + + - {5066EB93-D8F7-4FAE-B687-024D7A81BD95} - difxapp Library true - true en-us - - - - - - - - + - - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - diff --git a/src/wixlib/packages.config b/src/wixlib/packages.config deleted file mode 100644 index 1e5a9850..00000000 --- a/src/wixlib/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file -- cgit v1.2.3-55-g6feb From 79bc46ce89435b275888c7914a07f3e47e5af0fb Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Sat, 27 Jun 2020 12:08:21 -0700 Subject: Improve build batch file --- appveyor.cmd | 9 +++++---- nuget.config | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/appveyor.cmd b/appveyor.cmd index dc40e10c..ec37397e 100644 --- a/appveyor.cmd +++ b/appveyor.cmd @@ -1,13 +1,14 @@ @setlocal @pushd %~dp0 -nuget restore +nuget restore || exit /b -msbuild -p:Configuration=Release -t:Restore +msbuild -p:Configuration=Release -t:Restore || exit /b -msbuild -p:Configuration=Release src\test\WixToolsetTest.DifxApp\WixToolsetTest.DifxApp.csproj +msbuild -p:Configuration=Release src\test\WixToolsetTest.DifxApp\WixToolsetTest.DifxApp.csproj || exit /b +dotnet test -c Release --no-build src\test\WixToolsetTest.DifxApp || exit /b -msbuild -p:Configuration=Release -t:Pack src\wixext\WixToolset.DifxApp.wixext.csproj +msbuild -p:Configuration=Release -t:Pack src\wixext\WixToolset.DifxApp.wixext.csproj || exit /b @popd @endlocal \ No newline at end of file diff --git a/nuget.config b/nuget.config index aaee3228..db7aba29 100644 --- a/nuget.config +++ b/nuget.config @@ -2,6 +2,7 @@ + -- cgit v1.2.3-55-g6feb From f33b26a3640011cac36c0a657838ed8760a0928b Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Tue, 27 Oct 2020 17:56:17 -0400 Subject: Update project for Package/SummaryInformation change. --- DifxApp.wixext.sln | 4 ++-- global.json | 2 +- .../TestData/UsingDriver/Package.wxs | 10 +++------- src/wixext/DifxAppCompiler.cs | 4 ---- src/wixlib/DifxAppExtension_Platform.wxi | 23 +++++++++++----------- 5 files changed, 17 insertions(+), 26 deletions(-) diff --git a/DifxApp.wixext.sln b/DifxApp.wixext.sln index 2bfddc69..2b891405 100644 --- a/DifxApp.wixext.sln +++ b/DifxApp.wixext.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27130.2003 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30611.23 MinimumVisualStudioVersion = 15.0.26124.0 Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "difxapp", "src\wixlib\difxapp.wixproj", "{5066EB93-D8F7-4FAE-B687-024D7A81BD95}" EndProject diff --git a/global.json b/global.json index 7a995d0a..f94ab6df 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "msbuild-sdks": { - "WixToolset.Sdk": "4.0.0-build-0143" + "WixToolset.Sdk": "4.0.0-build-0162" } } diff --git a/src/test/WixToolsetTest.DifxApp/TestData/UsingDriver/Package.wxs b/src/test/WixToolsetTest.DifxApp/TestData/UsingDriver/Package.wxs index cdc323ec..082ac4cc 100644 --- a/src/test/WixToolsetTest.DifxApp/TestData/UsingDriver/Package.wxs +++ b/src/test/WixToolsetTest.DifxApp/TestData/UsingDriver/Package.wxs @@ -1,15 +1,11 @@ - - - - - + + - - + diff --git a/src/wixext/DifxAppCompiler.cs b/src/wixext/DifxAppCompiler.cs index e3687a49..e056988f 100644 --- a/src/wixext/DifxAppCompiler.cs +++ b/src/wixext/DifxAppCompiler.cs @@ -143,10 +143,6 @@ namespace WixToolset.DifxApp case Platform.X64: this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, SymbolDefinitions.CustomAction, "MsiProcessDrivers_x64"); break; - case Platform.IA64: - case Platform.ARM: - this.Messaging.Write(ErrorMessages.UnsupportedPlatformForElement(sourceLineNumbers, this.Context.Platform.ToString(), node.Name.LocalName)); - break; } var symbol = section.AddSymbol(new MsiDriverPackagesSymbol(sourceLineNumbers) diff --git a/src/wixlib/DifxAppExtension_Platform.wxi b/src/wixlib/DifxAppExtension_Platform.wxi index 7583f7ea..b8d613c9 100644 --- a/src/wixlib/DifxAppExtension_Platform.wxi +++ b/src/wixlib/DifxAppExtension_Platform.wxi @@ -1,23 +1,22 @@ - - + - + - VersionNT > 400 - VersionNT > 400 + + - - + + - - - - - + + + + + -- cgit v1.2.3-55-g6feb From acad47756e2ccb0a6af06d2ae37cd9ff5961d06c Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Sat, 31 Oct 2020 22:10:02 -0400 Subject: Strong-name sign WiX assemblies. --- global.json | 2 +- src/CSharp.Build.props | 11 +++++++++++ src/Directory.Build.props | 1 + src/wix.snk | Bin 0 -> 596 bytes 4 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 src/CSharp.Build.props create mode 100644 src/wix.snk diff --git a/global.json b/global.json index f94ab6df..10345833 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "msbuild-sdks": { - "WixToolset.Sdk": "4.0.0-build-0162" + "WixToolset.Sdk": "4.0.0-build-0163" } } diff --git a/src/CSharp.Build.props b/src/CSharp.Build.props new file mode 100644 index 00000000..b12f4c6e --- /dev/null +++ b/src/CSharp.Build.props @@ -0,0 +1,11 @@ + + + + + true + $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)wix.snk)) + + diff --git a/src/Directory.Build.props b/src/Directory.Build.props index a22f4470..f83cc154 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -22,6 +22,7 @@ WiX Toolset + diff --git a/src/wix.snk b/src/wix.snk new file mode 100644 index 00000000..3908a66a Binary files /dev/null and b/src/wix.snk differ -- cgit v1.2.3-55-g6feb From bc6cf51b0e617ccaf461ff356ad7309f5f1a8945 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Fri, 4 Dec 2020 17:14:34 -0600 Subject: xsd got moved to doc repo. Update dependencies. --- global.json | 2 +- src/wixext/WixToolset.DifxApp.wixext.csproj | 3 +- src/wixext/difxapp.xsd | 108 ---------------------------- src/wixlib/difxapp.wixproj | 2 +- 4 files changed, 3 insertions(+), 112 deletions(-) delete mode 100644 src/wixext/difxapp.xsd diff --git a/global.json b/global.json index 10345833..77a81322 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "msbuild-sdks": { - "WixToolset.Sdk": "4.0.0-build-0163" + "WixToolset.Sdk": "4.0.0-build-0170" } } diff --git a/src/wixext/WixToolset.DifxApp.wixext.csproj b/src/wixext/WixToolset.DifxApp.wixext.csproj index ca27b04e..50d3debf 100644 --- a/src/wixext/WixToolset.DifxApp.wixext.csproj +++ b/src/wixext/WixToolset.DifxApp.wixext.csproj @@ -12,7 +12,6 @@ - @@ -24,6 +23,6 @@ - + diff --git a/src/wixext/difxapp.xsd b/src/wixext/difxapp.xsd deleted file mode 100644 index e665d034..00000000 --- a/src/wixext/difxapp.xsd +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - The source code schema for the WiX Toolset Driver Install Frameworks for Applications Extension. - - - - - - - - - - - - Installs a driver. To use this element, you need to reference the WixDifxAppExtension extension and add the - .wixlib appropriate for the target platform (difxapp_x86.wixlib or difxapp_x64.wixlib) - to your project. - - - - - - - Specifies that the DIFxApp CustomActions should add an entry in the Add/Remove Programs Control - Panel applet. The default is 'yes'. - - - - - - - If set to "yes", configures DIFxApp to delete binary files that were copied to the system from the driver - store when a driver package was installed. If this attribute is set to "no" or not present, DIFxApp does not - remove these files from a system. Note that configuring DIFxApp to delete these files is controlled by the - Flags entry value of the component that represents the driver package in the MsiDriverPackages custom table. - Setting DeleteFiles to "yes" sets the corresponding bit in the Flags entry value. Setting DeleteFiles to "no" - clears the corresponding bit in the Flags entry value. If this attribute is not present, DIFxApp uses a - default value of "no". - - - - - - - Specifies that the DIFxApp CustomActions should force the installation of a new Plug and Play driver - on a device, even if the currently installed driver on the device is a better match than the new driver. - Specifying 'no' is an excellent way to ensure the DIFxApp CustomActions recognize the Component contains - a driver for installation. The default is null which means the Component does not install a driver via - DIFxApp CustomActions. See http://www.microsoft.com/whdc/driver/install/difxtools.mspx - for more information. - - - - - - - If set to "yes", configures DIFxApp to install unsigned driver packages and driver packages with missing - files. For more information, see "Installing Unsigned Driver Packages in Legacy Mode" earlier in this paper. - If this attribute is set to "no" or not present, DIFxApp will install only signed driver packages. Note - that configuring DIFxApp to install unsigned drivers is controlled by the Flags entry value of the component - that represents the driver package in the MsiDriverPackages custom table. Setting Legacy to "yes" sets - the corresponding bit in the Flags entry value. Setting Legacy to "no" clears the bit in the Flags - entry value that configures DIFxApp to install unsigned driver packages. If this attribute is not present, - DIFxApp uses a default value of "no". - - - - - - - Specifies that the DIFxApp CustomActions should prompt the user to connect the Plug and Play - device if it is not connected. The default is 'yes'. - - - - - - - Specifies an optional installation sequence number. DIFxApp CustomActions install the driver packages in - an installation package in the order of increasing sequence numbers. The same sequence number can be used - for more than one driver; however, the order in which packages with the same sequence number are actually - installed cannot be determined. - - - - - - - - - Values of this type will either be "yes" or "no". - - - - - - - diff --git a/src/wixlib/difxapp.wixproj b/src/wixlib/difxapp.wixproj index 4f368c0e..2ae9a097 100644 --- a/src/wixlib/difxapp.wixproj +++ b/src/wixlib/difxapp.wixproj @@ -8,7 +8,7 @@ - + -- cgit v1.2.3-55-g6feb From 543c9851d7cacbf85f575b1f6f52e41da7a1d66b Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Tue, 20 Apr 2021 12:59:50 -0700 Subject: Integrate latest tooling --- global.json | 2 +- src/test/WixToolsetTest.DifxApp/TestData/UsingDriver/Package.wxs | 8 +++----- src/wixext/DifxAppExtensionFactory.cs | 2 +- src/wixext/DifxAppWindowsInstallerBackendBinderExtension.cs | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/global.json b/global.json index 77a81322..23dd3fa6 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "msbuild-sdks": { - "WixToolset.Sdk": "4.0.0-build-0170" + "WixToolset.Sdk": "4.0.0-build-0211" } } diff --git a/src/test/WixToolsetTest.DifxApp/TestData/UsingDriver/Package.wxs b/src/test/WixToolsetTest.DifxApp/TestData/UsingDriver/Package.wxs index 082ac4cc..411893bc 100644 --- a/src/test/WixToolsetTest.DifxApp/TestData/UsingDriver/Package.wxs +++ b/src/test/WixToolsetTest.DifxApp/TestData/UsingDriver/Package.wxs @@ -8,10 +8,8 @@ - - - - - + + + diff --git a/src/wixext/DifxAppExtensionFactory.cs b/src/wixext/DifxAppExtensionFactory.cs index 4565ce17..3932685d 100644 --- a/src/wixext/DifxAppExtensionFactory.cs +++ b/src/wixext/DifxAppExtensionFactory.cs @@ -8,7 +8,7 @@ namespace WixToolset.DifxApp public class DifxAppExtensionFactory : BaseExtensionFactory { - protected override IEnumerable ExtensionTypes => new[] + protected override IReadOnlyCollection ExtensionTypes => new[] { typeof(DifxAppCompiler), typeof(DifxAppExtensionData), diff --git a/src/wixext/DifxAppWindowsInstallerBackendBinderExtension.cs b/src/wixext/DifxAppWindowsInstallerBackendBinderExtension.cs index d3bbc0eb..41f01175 100644 --- a/src/wixext/DifxAppWindowsInstallerBackendBinderExtension.cs +++ b/src/wixext/DifxAppWindowsInstallerBackendBinderExtension.cs @@ -8,6 +8,6 @@ namespace WixToolset.DifxApp public class DifxAppWindowsInstallerBackendBinderExtension : BaseWindowsInstallerBackendBinderExtension { - public override IEnumerable TableDefinitions => DifxAppTableDefinitions.All; + public override IReadOnlyCollection TableDefinitions => DifxAppTableDefinitions.All; } } -- cgit v1.2.3-55-g6feb From 03db7922de5b7e04300e0ed09e24f7b8890ec2e8 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Tue, 4 May 2021 13:22:13 -0700 Subject: Move DifxApp.wixext into ext --- .editorconfig | 37 ----- DifxApp.wixext.sln | 63 -------- README.md | 2 - appveyor.cmd | 14 -- appveyor.yml | 40 ----- global.json | 5 - nuget.config | 17 --- src/.editorconfig | 37 +++++ src/CSharp.Build.props | 11 -- src/Directory.Build.props | 29 ---- src/Directory.Build.targets | 48 ------ src/ext/DifxApp/CSharp.Build.props | 11 ++ src/ext/DifxApp/DifxApp.wixext.sln | 63 ++++++++ src/ext/DifxApp/Directory.Build.props | 29 ++++ src/ext/DifxApp/Directory.Build.targets | 48 ++++++ src/ext/DifxApp/README.md | 2 + src/ext/DifxApp/appveyor.cmd | 14 ++ src/ext/DifxApp/appveyor.yml | 40 +++++ src/ext/DifxApp/nuget.config | 17 +++ .../DifxAppExtensionFixture.cs | 36 +++++ .../TestData/UsingDriver/Package.en-us.wxl | 11 ++ .../TestData/UsingDriver/Package.wxs | 15 ++ .../TestData/UsingDriver/PackageComponents.wxs | 12 ++ .../TestData/UsingDriver/example.txt | 1 + .../WixToolsetTest.DifxApp.csproj | 41 ++++++ src/ext/DifxApp/wix.snk | Bin 0 -> 596 bytes src/ext/DifxApp/wixext/DifxAppCompiler.cs | 161 +++++++++++++++++++++ src/ext/DifxApp/wixext/DifxAppDecompiler.cs | 98 +++++++++++++ src/ext/DifxApp/wixext/DifxAppExtensionData.cs | 23 +++ src/ext/DifxApp/wixext/DifxAppExtensionFactory.cs | 18 +++ src/ext/DifxApp/wixext/DifxAppTableDefinitions.cs | 26 ++++ ...ifxAppWindowsInstallerBackendBinderExtension.cs | 13 ++ .../wixext/Symbols/DifxAppSymbolDefinitions.cs | 39 +++++ .../wixext/Symbols/MsiDriverPackagesSymbol.cs | 63 ++++++++ .../wixext/WixToolset.DifxApp.wixext.csproj | 28 ++++ .../wixext/WixToolset.DifxApp.wixext.targets | 11 ++ .../DifxApp/wixlib/DifxAppExtension_Platform.wxi | 22 +++ src/ext/DifxApp/wixlib/DifxAppExtension_x64.wxs | 8 + src/ext/DifxApp/wixlib/DifxAppExtension_x86.wxs | 8 + src/ext/DifxApp/wixlib/caSuffix.wxi | 28 ++++ src/ext/DifxApp/wixlib/difxapp.wixproj | 14 ++ src/ext/DifxApp/wixlib/x64/DIFxApp.dll | Bin 0 -> 153080 bytes src/ext/DifxApp/wixlib/x64/DIFxAppA.dll | Bin 0 -> 707464 bytes src/ext/DifxApp/wixlib/x86/DIFxApp.dll | Bin 0 -> 122248 bytes src/ext/DifxApp/wixlib/x86/DIFxAppA.dll | Bin 0 -> 364424 bytes src/ext/global.json | 5 + .../DifxAppExtensionFixture.cs | 36 ----- .../TestData/UsingDriver/Package.en-us.wxl | 11 -- .../TestData/UsingDriver/Package.wxs | 15 -- .../TestData/UsingDriver/PackageComponents.wxs | 12 -- .../TestData/UsingDriver/example.txt | 1 - .../WixToolsetTest.DifxApp.csproj | 41 ------ src/version.json | 11 ++ src/wix.snk | Bin 596 -> 0 bytes src/wixext/DifxAppCompiler.cs | 161 --------------------- src/wixext/DifxAppDecompiler.cs | 98 ------------- src/wixext/DifxAppExtensionData.cs | 23 --- src/wixext/DifxAppExtensionFactory.cs | 18 --- src/wixext/DifxAppTableDefinitions.cs | 26 ---- ...ifxAppWindowsInstallerBackendBinderExtension.cs | 13 -- src/wixext/Symbols/DifxAppSymbolDefinitions.cs | 39 ----- src/wixext/Symbols/MsiDriverPackagesSymbol.cs | 63 -------- src/wixext/WixToolset.DifxApp.wixext.csproj | 28 ---- src/wixext/WixToolset.DifxApp.wixext.targets | 11 -- src/wixlib/DifxAppExtension_Platform.wxi | 22 --- src/wixlib/DifxAppExtension_x64.wxs | 8 - src/wixlib/DifxAppExtension_x86.wxs | 8 - src/wixlib/caSuffix.wxi | 28 ---- src/wixlib/difxapp.wixproj | 14 -- src/wixlib/x64/DIFxApp.dll | Bin 153080 -> 0 bytes src/wixlib/x64/DIFxAppA.dll | Bin 707464 -> 0 bytes src/wixlib/x86/DIFxApp.dll | Bin 122248 -> 0 bytes src/wixlib/x86/DIFxAppA.dll | Bin 364424 -> 0 bytes version.json | 11 -- 74 files changed, 953 insertions(+), 953 deletions(-) delete mode 100644 .editorconfig delete mode 100644 DifxApp.wixext.sln delete mode 100644 README.md delete mode 100644 appveyor.cmd delete mode 100644 appveyor.yml delete mode 100644 global.json delete mode 100644 nuget.config create mode 100644 src/.editorconfig delete mode 100644 src/CSharp.Build.props delete mode 100644 src/Directory.Build.props delete mode 100644 src/Directory.Build.targets create mode 100644 src/ext/DifxApp/CSharp.Build.props create mode 100644 src/ext/DifxApp/DifxApp.wixext.sln create mode 100644 src/ext/DifxApp/Directory.Build.props create mode 100644 src/ext/DifxApp/Directory.Build.targets create mode 100644 src/ext/DifxApp/README.md create mode 100644 src/ext/DifxApp/appveyor.cmd create mode 100644 src/ext/DifxApp/appveyor.yml create mode 100644 src/ext/DifxApp/nuget.config create mode 100644 src/ext/DifxApp/test/WixToolsetTest.DifxApp/DifxAppExtensionFixture.cs create mode 100644 src/ext/DifxApp/test/WixToolsetTest.DifxApp/TestData/UsingDriver/Package.en-us.wxl create mode 100644 src/ext/DifxApp/test/WixToolsetTest.DifxApp/TestData/UsingDriver/Package.wxs create mode 100644 src/ext/DifxApp/test/WixToolsetTest.DifxApp/TestData/UsingDriver/PackageComponents.wxs create mode 100644 src/ext/DifxApp/test/WixToolsetTest.DifxApp/TestData/UsingDriver/example.txt create mode 100644 src/ext/DifxApp/test/WixToolsetTest.DifxApp/WixToolsetTest.DifxApp.csproj create mode 100644 src/ext/DifxApp/wix.snk create mode 100644 src/ext/DifxApp/wixext/DifxAppCompiler.cs create mode 100644 src/ext/DifxApp/wixext/DifxAppDecompiler.cs create mode 100644 src/ext/DifxApp/wixext/DifxAppExtensionData.cs create mode 100644 src/ext/DifxApp/wixext/DifxAppExtensionFactory.cs create mode 100644 src/ext/DifxApp/wixext/DifxAppTableDefinitions.cs create mode 100644 src/ext/DifxApp/wixext/DifxAppWindowsInstallerBackendBinderExtension.cs create mode 100644 src/ext/DifxApp/wixext/Symbols/DifxAppSymbolDefinitions.cs create mode 100644 src/ext/DifxApp/wixext/Symbols/MsiDriverPackagesSymbol.cs create mode 100644 src/ext/DifxApp/wixext/WixToolset.DifxApp.wixext.csproj create mode 100644 src/ext/DifxApp/wixext/WixToolset.DifxApp.wixext.targets create mode 100644 src/ext/DifxApp/wixlib/DifxAppExtension_Platform.wxi create mode 100644 src/ext/DifxApp/wixlib/DifxAppExtension_x64.wxs create mode 100644 src/ext/DifxApp/wixlib/DifxAppExtension_x86.wxs create mode 100644 src/ext/DifxApp/wixlib/caSuffix.wxi create mode 100644 src/ext/DifxApp/wixlib/difxapp.wixproj create mode 100644 src/ext/DifxApp/wixlib/x64/DIFxApp.dll create mode 100644 src/ext/DifxApp/wixlib/x64/DIFxAppA.dll create mode 100644 src/ext/DifxApp/wixlib/x86/DIFxApp.dll create mode 100644 src/ext/DifxApp/wixlib/x86/DIFxAppA.dll create mode 100644 src/ext/global.json delete mode 100644 src/test/WixToolsetTest.DifxApp/DifxAppExtensionFixture.cs delete mode 100644 src/test/WixToolsetTest.DifxApp/TestData/UsingDriver/Package.en-us.wxl delete mode 100644 src/test/WixToolsetTest.DifxApp/TestData/UsingDriver/Package.wxs delete mode 100644 src/test/WixToolsetTest.DifxApp/TestData/UsingDriver/PackageComponents.wxs delete mode 100644 src/test/WixToolsetTest.DifxApp/TestData/UsingDriver/example.txt delete mode 100644 src/test/WixToolsetTest.DifxApp/WixToolsetTest.DifxApp.csproj create mode 100644 src/version.json delete mode 100644 src/wix.snk delete mode 100644 src/wixext/DifxAppCompiler.cs delete mode 100644 src/wixext/DifxAppDecompiler.cs delete mode 100644 src/wixext/DifxAppExtensionData.cs delete mode 100644 src/wixext/DifxAppExtensionFactory.cs delete mode 100644 src/wixext/DifxAppTableDefinitions.cs delete mode 100644 src/wixext/DifxAppWindowsInstallerBackendBinderExtension.cs delete mode 100644 src/wixext/Symbols/DifxAppSymbolDefinitions.cs delete mode 100644 src/wixext/Symbols/MsiDriverPackagesSymbol.cs delete mode 100644 src/wixext/WixToolset.DifxApp.wixext.csproj delete mode 100644 src/wixext/WixToolset.DifxApp.wixext.targets delete mode 100644 src/wixlib/DifxAppExtension_Platform.wxi delete mode 100644 src/wixlib/DifxAppExtension_x64.wxs delete mode 100644 src/wixlib/DifxAppExtension_x86.wxs delete mode 100644 src/wixlib/caSuffix.wxi delete mode 100644 src/wixlib/difxapp.wixproj delete mode 100644 src/wixlib/x64/DIFxApp.dll delete mode 100644 src/wixlib/x64/DIFxAppA.dll delete mode 100644 src/wixlib/x86/DIFxApp.dll delete mode 100644 src/wixlib/x86/DIFxAppA.dll delete mode 100644 version.json diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 1d72e683..00000000 --- a/.editorconfig +++ /dev/null @@ -1,37 +0,0 @@ -# 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. -# -# Do NOT modify this file. Update the canonical version in Home\repo-template\src\.editorconfig -# then update all of the repos. - -root = true - -[*] -charset = utf-8 -indent_style = space -indent_size = 4 -trim_trailing_whitespace = true - -[*.{cs,vb}] -dotnet_sort_system_directives_first = true - -[*.cs] -csharp_indent_case_contents = true : error -csharp_indent_switch_labels = true : error -csharp_new_line_before_open_brace = all -csharp_prefer_braces = true : error -csharp_style_expression_bodied_methods = when_on_single_line : suggestion -csharp_style_expression_bodied_constructors = when_on_single_line : suggestion -csharp_style_expression_bodied_operators = when_on_single_line : suggestion -csharp_style_expression_bodied_properties = when_on_single_line : suggestion -csharp_style_expression_bodied_indexers = when_on_single_line : suggestion -csharp_style_expression_bodied_accessors = when_on_single_line : suggestion -csharp_style_var_elsewhere = true : suggestion -csharp_style_var_for_built_in_types = true : suggestion -csharp_style_var_when_type_is_apparent = true : suggestion -dotnet_style_qualification_for_event = true : error -dotnet_style_qualification_for_field = true : error -dotnet_style_qualification_for_method = true : error -dotnet_style_qualification_for_property = true : error - -[*.targets] -indent_size = 2 diff --git a/DifxApp.wixext.sln b/DifxApp.wixext.sln deleted file mode 100644 index 2b891405..00000000 --- a/DifxApp.wixext.sln +++ /dev/null @@ -1,63 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.30611.23 -MinimumVisualStudioVersion = 15.0.26124.0 -Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "difxapp", "src\wixlib\difxapp.wixproj", "{5066EB93-D8F7-4FAE-B687-024D7A81BD95}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolset.DifxApp.wixext", "src\wixext\WixToolset.DifxApp.wixext.csproj", "{2256EFD7-E678-4485-818D-986D590068BE}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolsetTest.DifxApp", "src\test\WixToolsetTest.DifxApp\WixToolsetTest.DifxApp.csproj", "{883D7BA3-1ADC-47AC-95B0-221BB0B7788D}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {5066EB93-D8F7-4FAE-B687-024D7A81BD95}.Debug|Any CPU.ActiveCfg = Debug|x86 - {5066EB93-D8F7-4FAE-B687-024D7A81BD95}.Debug|Any CPU.Build.0 = Debug|x86 - {5066EB93-D8F7-4FAE-B687-024D7A81BD95}.Debug|x64.ActiveCfg = Debug|x86 - {5066EB93-D8F7-4FAE-B687-024D7A81BD95}.Debug|x86.ActiveCfg = Debug|x86 - {5066EB93-D8F7-4FAE-B687-024D7A81BD95}.Debug|x86.Build.0 = Debug|x86 - {5066EB93-D8F7-4FAE-B687-024D7A81BD95}.Release|Any CPU.ActiveCfg = Release|x86 - {5066EB93-D8F7-4FAE-B687-024D7A81BD95}.Release|Any CPU.Build.0 = Release|x86 - {5066EB93-D8F7-4FAE-B687-024D7A81BD95}.Release|x64.ActiveCfg = Release|x86 - {5066EB93-D8F7-4FAE-B687-024D7A81BD95}.Release|x86.ActiveCfg = Release|x86 - {5066EB93-D8F7-4FAE-B687-024D7A81BD95}.Release|x86.Build.0 = Release|x86 - {2256EFD7-E678-4485-818D-986D590068BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2256EFD7-E678-4485-818D-986D590068BE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2256EFD7-E678-4485-818D-986D590068BE}.Debug|x64.ActiveCfg = Debug|Any CPU - {2256EFD7-E678-4485-818D-986D590068BE}.Debug|x64.Build.0 = Debug|Any CPU - {2256EFD7-E678-4485-818D-986D590068BE}.Debug|x86.ActiveCfg = Debug|Any CPU - {2256EFD7-E678-4485-818D-986D590068BE}.Debug|x86.Build.0 = Debug|Any CPU - {2256EFD7-E678-4485-818D-986D590068BE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2256EFD7-E678-4485-818D-986D590068BE}.Release|Any CPU.Build.0 = Release|Any CPU - {2256EFD7-E678-4485-818D-986D590068BE}.Release|x64.ActiveCfg = Release|Any CPU - {2256EFD7-E678-4485-818D-986D590068BE}.Release|x64.Build.0 = Release|Any CPU - {2256EFD7-E678-4485-818D-986D590068BE}.Release|x86.ActiveCfg = Release|Any CPU - {2256EFD7-E678-4485-818D-986D590068BE}.Release|x86.Build.0 = Release|Any CPU - {883D7BA3-1ADC-47AC-95B0-221BB0B7788D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {883D7BA3-1ADC-47AC-95B0-221BB0B7788D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {883D7BA3-1ADC-47AC-95B0-221BB0B7788D}.Debug|x64.ActiveCfg = Debug|Any CPU - {883D7BA3-1ADC-47AC-95B0-221BB0B7788D}.Debug|x64.Build.0 = Debug|Any CPU - {883D7BA3-1ADC-47AC-95B0-221BB0B7788D}.Debug|x86.ActiveCfg = Debug|Any CPU - {883D7BA3-1ADC-47AC-95B0-221BB0B7788D}.Debug|x86.Build.0 = Debug|Any CPU - {883D7BA3-1ADC-47AC-95B0-221BB0B7788D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {883D7BA3-1ADC-47AC-95B0-221BB0B7788D}.Release|Any CPU.Build.0 = Release|Any CPU - {883D7BA3-1ADC-47AC-95B0-221BB0B7788D}.Release|x64.ActiveCfg = Release|Any CPU - {883D7BA3-1ADC-47AC-95B0-221BB0B7788D}.Release|x64.Build.0 = Release|Any CPU - {883D7BA3-1ADC-47AC-95B0-221BB0B7788D}.Release|x86.ActiveCfg = Release|Any CPU - {883D7BA3-1ADC-47AC-95B0-221BB0B7788D}.Release|x86.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {60A3EA0F-9313-47F8-BF6B-74478A57B577} - EndGlobalSection -EndGlobal diff --git a/README.md b/README.md deleted file mode 100644 index 49f30df8..00000000 --- a/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# DifxApp.wixext -WixToolset.DifxApp.wixext - DIFxApp WiX Toolset Extension diff --git a/appveyor.cmd b/appveyor.cmd deleted file mode 100644 index ec37397e..00000000 --- a/appveyor.cmd +++ /dev/null @@ -1,14 +0,0 @@ -@setlocal -@pushd %~dp0 - -nuget restore || exit /b - -msbuild -p:Configuration=Release -t:Restore || exit /b - -msbuild -p:Configuration=Release src\test\WixToolsetTest.DifxApp\WixToolsetTest.DifxApp.csproj || exit /b -dotnet test -c Release --no-build src\test\WixToolsetTest.DifxApp || exit /b - -msbuild -p:Configuration=Release -t:Pack src\wixext\WixToolset.DifxApp.wixext.csproj || exit /b - -@popd -@endlocal \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 7c686b04..00000000 --- a/appveyor.yml +++ /dev/null @@ -1,40 +0,0 @@ -# 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. -# -# Do NOT modify this file. Update the canonical version in Home\repo-template\src\appveyor.yml -# then update all of the repos. - -branches: - only: - - master - - develop - -image: Visual Studio 2019 - -version: 0.0.0.{build} -configuration: Release - -environment: - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true - DOTNET_CLI_TELEMETRY_OPTOUT: 1 - NUGET_XMLDOC_MODE: skip - -build_script: - - appveyor.cmd - -pull_requests: - do_not_increment_build_number: true - -nuget: - disable_publish_on_pr: true - -skip_branch_with_pr: true -skip_tags: true - -artifacts: -- path: build\Release\**\*.nupkg - name: nuget - -notifications: -- provider: Slack - incoming_webhook: - secure: p5xuu+4x2JHfwGDMDe5KcG1k7gZxqYc4jWVwvyNZv5cvkubPD2waJs5yXMAXZNN7Z63/3PWHb7q4KoY/99AjauYa1nZ4c5qYqRPFRBKTHfA= diff --git a/global.json b/global.json deleted file mode 100644 index 23dd3fa6..00000000 --- a/global.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "msbuild-sdks": { - "WixToolset.Sdk": "4.0.0-build-0211" - } -} diff --git a/nuget.config b/nuget.config deleted file mode 100644 index db7aba29..00000000 --- a/nuget.config +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/.editorconfig b/src/.editorconfig new file mode 100644 index 00000000..1d72e683 --- /dev/null +++ b/src/.editorconfig @@ -0,0 +1,37 @@ +# 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. +# +# Do NOT modify this file. Update the canonical version in Home\repo-template\src\.editorconfig +# then update all of the repos. + +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 4 +trim_trailing_whitespace = true + +[*.{cs,vb}] +dotnet_sort_system_directives_first = true + +[*.cs] +csharp_indent_case_contents = true : error +csharp_indent_switch_labels = true : error +csharp_new_line_before_open_brace = all +csharp_prefer_braces = true : error +csharp_style_expression_bodied_methods = when_on_single_line : suggestion +csharp_style_expression_bodied_constructors = when_on_single_line : suggestion +csharp_style_expression_bodied_operators = when_on_single_line : suggestion +csharp_style_expression_bodied_properties = when_on_single_line : suggestion +csharp_style_expression_bodied_indexers = when_on_single_line : suggestion +csharp_style_expression_bodied_accessors = when_on_single_line : suggestion +csharp_style_var_elsewhere = true : suggestion +csharp_style_var_for_built_in_types = true : suggestion +csharp_style_var_when_type_is_apparent = true : suggestion +dotnet_style_qualification_for_event = true : error +dotnet_style_qualification_for_field = true : error +dotnet_style_qualification_for_method = true : error +dotnet_style_qualification_for_property = true : error + +[*.targets] +indent_size = 2 diff --git a/src/CSharp.Build.props b/src/CSharp.Build.props deleted file mode 100644 index b12f4c6e..00000000 --- a/src/CSharp.Build.props +++ /dev/null @@ -1,11 +0,0 @@ - - - - - true - $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)wix.snk)) - - diff --git a/src/Directory.Build.props b/src/Directory.Build.props deleted file mode 100644 index f83cc154..00000000 --- a/src/Directory.Build.props +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - Debug - false - MSB3246 - - $(MSBuildProjectName) - $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\build\)) - $(BaseOutputPath)obj\$(ProjectName)\ - $(BaseOutputPath)$(Configuration)\ - - WiX Toolset Team - WiX Toolset - Copyright (c) .NET Foundation and contributors. All rights reserved. - MS-RL - WiX Toolset - - - - - - - diff --git a/src/Directory.Build.targets b/src/Directory.Build.targets deleted file mode 100644 index dac7452a..00000000 --- a/src/Directory.Build.targets +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - true - $(SolutionPath) - $(NCrunchOriginalSolutionPath) - - - - - - - $([System.IO.File]::ReadAllText($(TheSolutionPath))) - $([System.IO.Path]::GetDirectoryName( $(TheSolutionPath) )) - (?<="[PackageName]", ")(.*)(?=", ") - - - - - - %(Identity) - $(SolutionFileContent.Contains('\%(Identity).csproj')) - - - - - $(RegexPattern.Replace('[PackageName]','%(PackageName)') ) - $([System.Text.RegularExpressions.Regex]::Match('$(SolutionFileContent)', '%(Pattern)')) - - - - - - - - - - - diff --git a/src/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 @@ + + + + + true + $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)wix.snk)) + + 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 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30611.23 +MinimumVisualStudioVersion = 15.0.26124.0 +Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "difxapp", "src\wixlib\difxapp.wixproj", "{5066EB93-D8F7-4FAE-B687-024D7A81BD95}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolset.DifxApp.wixext", "src\wixext\WixToolset.DifxApp.wixext.csproj", "{2256EFD7-E678-4485-818D-986D590068BE}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolsetTest.DifxApp", "src\test\WixToolsetTest.DifxApp\WixToolsetTest.DifxApp.csproj", "{883D7BA3-1ADC-47AC-95B0-221BB0B7788D}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {5066EB93-D8F7-4FAE-B687-024D7A81BD95}.Debug|Any CPU.ActiveCfg = Debug|x86 + {5066EB93-D8F7-4FAE-B687-024D7A81BD95}.Debug|Any CPU.Build.0 = Debug|x86 + {5066EB93-D8F7-4FAE-B687-024D7A81BD95}.Debug|x64.ActiveCfg = Debug|x86 + {5066EB93-D8F7-4FAE-B687-024D7A81BD95}.Debug|x86.ActiveCfg = Debug|x86 + {5066EB93-D8F7-4FAE-B687-024D7A81BD95}.Debug|x86.Build.0 = Debug|x86 + {5066EB93-D8F7-4FAE-B687-024D7A81BD95}.Release|Any CPU.ActiveCfg = Release|x86 + {5066EB93-D8F7-4FAE-B687-024D7A81BD95}.Release|Any CPU.Build.0 = Release|x86 + {5066EB93-D8F7-4FAE-B687-024D7A81BD95}.Release|x64.ActiveCfg = Release|x86 + {5066EB93-D8F7-4FAE-B687-024D7A81BD95}.Release|x86.ActiveCfg = Release|x86 + {5066EB93-D8F7-4FAE-B687-024D7A81BD95}.Release|x86.Build.0 = Release|x86 + {2256EFD7-E678-4485-818D-986D590068BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2256EFD7-E678-4485-818D-986D590068BE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2256EFD7-E678-4485-818D-986D590068BE}.Debug|x64.ActiveCfg = Debug|Any CPU + {2256EFD7-E678-4485-818D-986D590068BE}.Debug|x64.Build.0 = Debug|Any CPU + {2256EFD7-E678-4485-818D-986D590068BE}.Debug|x86.ActiveCfg = Debug|Any CPU + {2256EFD7-E678-4485-818D-986D590068BE}.Debug|x86.Build.0 = Debug|Any CPU + {2256EFD7-E678-4485-818D-986D590068BE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2256EFD7-E678-4485-818D-986D590068BE}.Release|Any CPU.Build.0 = Release|Any CPU + {2256EFD7-E678-4485-818D-986D590068BE}.Release|x64.ActiveCfg = Release|Any CPU + {2256EFD7-E678-4485-818D-986D590068BE}.Release|x64.Build.0 = Release|Any CPU + {2256EFD7-E678-4485-818D-986D590068BE}.Release|x86.ActiveCfg = Release|Any CPU + {2256EFD7-E678-4485-818D-986D590068BE}.Release|x86.Build.0 = Release|Any CPU + {883D7BA3-1ADC-47AC-95B0-221BB0B7788D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {883D7BA3-1ADC-47AC-95B0-221BB0B7788D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {883D7BA3-1ADC-47AC-95B0-221BB0B7788D}.Debug|x64.ActiveCfg = Debug|Any CPU + {883D7BA3-1ADC-47AC-95B0-221BB0B7788D}.Debug|x64.Build.0 = Debug|Any CPU + {883D7BA3-1ADC-47AC-95B0-221BB0B7788D}.Debug|x86.ActiveCfg = Debug|Any CPU + {883D7BA3-1ADC-47AC-95B0-221BB0B7788D}.Debug|x86.Build.0 = Debug|Any CPU + {883D7BA3-1ADC-47AC-95B0-221BB0B7788D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {883D7BA3-1ADC-47AC-95B0-221BB0B7788D}.Release|Any CPU.Build.0 = Release|Any CPU + {883D7BA3-1ADC-47AC-95B0-221BB0B7788D}.Release|x64.ActiveCfg = Release|Any CPU + {883D7BA3-1ADC-47AC-95B0-221BB0B7788D}.Release|x64.Build.0 = Release|Any CPU + {883D7BA3-1ADC-47AC-95B0-221BB0B7788D}.Release|x86.ActiveCfg = Release|Any CPU + {883D7BA3-1ADC-47AC-95B0-221BB0B7788D}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {60A3EA0F-9313-47F8-BF6B-74478A57B577} + EndGlobalSection +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 @@ + + + + + + Debug + false + MSB3246 + + $(MSBuildProjectName) + $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\build\)) + $(BaseOutputPath)obj\$(ProjectName)\ + $(BaseOutputPath)$(Configuration)\ + + WiX Toolset Team + WiX Toolset + Copyright (c) .NET Foundation and contributors. All rights reserved. + MS-RL + WiX Toolset + + + + + + + diff --git a/src/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 @@ + + + + + + + true + $(SolutionPath) + $(NCrunchOriginalSolutionPath) + + + + + + + $([System.IO.File]::ReadAllText($(TheSolutionPath))) + $([System.IO.Path]::GetDirectoryName( $(TheSolutionPath) )) + (?<="[PackageName]", ")(.*)(?=", ") + + + + + + %(Identity) + $(SolutionFileContent.Contains('\%(Identity).csproj')) + + + + + $(RegexPattern.Replace('[PackageName]','%(PackageName)') ) + $([System.Text.RegularExpressions.Regex]::Match('$(SolutionFileContent)', '%(Pattern)')) + + + + + + + + + + + diff --git a/src/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 @@ +# DifxApp.wixext +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 @@ +@setlocal +@pushd %~dp0 + +nuget restore || exit /b + +msbuild -p:Configuration=Release -t:Restore || exit /b + +msbuild -p:Configuration=Release src\test\WixToolsetTest.DifxApp\WixToolsetTest.DifxApp.csproj || exit /b +dotnet test -c Release --no-build src\test\WixToolsetTest.DifxApp || exit /b + +msbuild -p:Configuration=Release -t:Pack src\wixext\WixToolset.DifxApp.wixext.csproj || exit /b + +@popd +@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 @@ +# 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. +# +# Do NOT modify this file. Update the canonical version in Home\repo-template\src\appveyor.yml +# then update all of the repos. + +branches: + only: + - master + - develop + +image: Visual Studio 2019 + +version: 0.0.0.{build} +configuration: Release + +environment: + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + NUGET_XMLDOC_MODE: skip + +build_script: + - appveyor.cmd + +pull_requests: + do_not_increment_build_number: true + +nuget: + disable_publish_on_pr: true + +skip_branch_with_pr: true +skip_tags: true + +artifacts: +- path: build\Release\**\*.nupkg + name: nuget + +notifications: +- provider: Slack + incoming_webhook: + 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 @@ + + + + + + + + + + + + + + + + + \ 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 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolsetTest.DifxApp +{ + using System.Linq; + using WixBuildTools.TestSupport; + using WixToolset.Core.TestPackage; + using WixToolset.DifxApp; + using Xunit; + + public class DifxAppExtensionFixture + { + [Fact] + public void CanBuildUsingDriver() + { + var folder = TestData.Get(@"TestData\UsingDriver"); + var build = new Builder(folder, typeof(DifxAppExtensionFactory), new[] { folder }); + + var results = build.BuildAndQuery(Build, "CustomAction"); + Assert.Equal(new[] + { + "CustomAction:MsiCleanupOnSuccess\t1\tDIFxApp.dll\tCleanupOnSuccess\t", + "CustomAction:MsiInstallDrivers\t3073\tDIFxAppA.dll\tInstallDriverPackages\t", + "CustomAction:MsiProcessDrivers\t1\tDIFxApp.dll\tProcessDriverPackages\t", + "CustomAction:MsiRollbackInstall\t3329\tDIFxAppA.dll\tRollbackInstall\t", + "CustomAction:MsiUninstallDrivers\t3073\tDIFxAppA.dll\tUninstallDriverPackages\t", + }, results); + } + + private static void Build(string[] args) + { + var result = WixRunner.Execute(args) + .AssertSuccess(); + } + } +} 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 @@ + + + + + + A newer version of [ProductName] is already installed. + MsiPackage + + 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 @@ + + + + + + + + + + + + + + + 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 @@ + + + + + + + + + + + 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 @@ + + + + + + netcoreapp3.1 + false + + + + NU1701 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/ext/DifxApp/wix.snk b/src/ext/DifxApp/wix.snk new file mode 100644 index 00000000..3908a66a Binary files /dev/null and b/src/ext/DifxApp/wix.snk 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 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.DifxApp +{ + using System; + using System.Collections.Generic; + using System.Xml.Linq; + using WixToolset.Data; + using WixToolset.DifxApp.Symbols; + using WixToolset.Extensibility; + + /// + /// The compiler for the WiX Toolset Driver Install Frameworks for Applications Extension. + /// + public sealed class DifxAppCompiler : BaseCompilerExtension + { + private HashSet components; + + public override XNamespace Namespace => "http://wixtoolset.org/schemas/v4/wxs/difxapp"; + /// + /// Instantiate a new DifxAppCompiler. + /// + public DifxAppCompiler() + { + this.components = new HashSet(); + } + + /// + /// Processes an element for the Compiler. + /// + /// Source line number for the parent element. + /// Parent element of element to process. + /// Element to process. + /// Extra information about the context in which this element is being parsed. + public override void ParseElement(Intermediate intermediate, IntermediateSection section, XElement parentElement, XElement element, IDictionary context) + { + switch (parentElement.Name.LocalName) + { + case "Component": + var componentId = context["ComponentId"]; + var directoryId = context["DirectoryId"]; + var componentWin64 = Boolean.Parse(context["Win64"]); + + switch (element.Name.LocalName) + { + case "Driver": + this.ParseDriverElement(intermediate, section, element, componentId, componentWin64); + break; + default: + this.ParseHelper.UnexpectedElement(parentElement, element); + break; + } + break; + default: + this.ParseHelper.UnexpectedElement(parentElement, element); + break; + } + } + + /// + /// Parses a Driver element. + /// + /// Element to parse. + /// Identifier for parent component. + private void ParseDriverElement(Intermediate intermediate, IntermediateSection section, XElement node, string componentId, bool win64) + { + var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node); + int attributes = 0; + var sequence = CompilerConstants.IntegerNotSet; + + // check the number of times a Driver element has been nested under this Component element + if (null != componentId) + { + if (this.components.Contains(componentId)) + { + this.Messaging.Write(ErrorMessages.TooManyElements(sourceLineNumbers, "Component", node.Name.LocalName, 1)); + } + else + { + this.components.Add(componentId); + } + } + + foreach (var attrib in node.Attributes()) + { + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) + { + switch (attrib.Name.LocalName) + { + case "AddRemovePrograms": + if (YesNoType.No == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + { + attributes |= 0x4; + } + break; + case "DeleteFiles": + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + { + attributes |= 0x10; + } + break; + case "ForceInstall": + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + { + attributes |= 0x1; + } + break; + case "Legacy": + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + { + attributes |= 0x8; + } + break; + case "PlugAndPlayPrompt": + if (YesNoType.No == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + { + attributes |= 0x2; + } + break; + case "Sequence": + sequence = this.ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, int.MaxValue); + break; + default: + this.ParseHelper.UnexpectedAttribute(node, attrib); + break; + } + } + else + { + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, node, attrib); + } + } + + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, node); + + if (!this.Messaging.EncounteredError) + { + switch (this.Context.Platform) + { + case Platform.X86: + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, SymbolDefinitions.CustomAction, "MsiProcessDrivers"); + break; + case Platform.X64: + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, SymbolDefinitions.CustomAction, "MsiProcessDrivers_x64"); + break; + } + + var symbol = section.AddSymbol(new MsiDriverPackagesSymbol(sourceLineNumbers) + { + ComponentRef = componentId, + Flags = attributes, + }); + + if (CompilerConstants.IntegerNotSet != sequence) + { + symbol.Sequence = sequence; + } + } + } + } +} 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 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.DifxApp +{ +#if TODO_CONSIDER_DECOMPILER + using System; + using System.Collections; + using System.Globalization; + using WixToolset.Data; + using WixToolset.Extensibility; + using DifxApp = WixToolset.Extensions.Serialize.DifxApp; + using Wix = WixToolset.Data.Serialize; + + /// + /// The decompiler for the WiX Toolset Driver Install Frameworks for Applications Extension. + /// + public sealed class DifxAppDecompiler : DecompilerExtension + { + /// + /// Creates a decompiler for Gaming Extension. + /// + public DifxAppDecompiler() + { + this.TableDefinitions = DifxAppExtensionData.GetExtensionTableDefinitions(); + } + + /// + /// Decompiles an extension table. + /// + /// The table to decompile. + public override void DecompileTable(Table table) + { + switch (table.Name) + { + case "MsiDriverPackages": + this.DecompileMsiDriverPackagesTable(table); + break; + default: + base.DecompileTable(table); + break; + } + } + + /// + /// Decompile the MsiDriverPackages table. + /// + /// The table to decompile. + private void DecompileMsiDriverPackagesTable(Table table) + { + foreach (Row row in table.Rows) + { + DifxApp.Driver driver = new DifxApp.Driver(); + + int attributes = (int)row[1]; + if (0x1 == (attributes & 0x1)) + { + driver.ForceInstall = DifxApp.YesNoType.yes; + } + + if (0x2 == (attributes & 0x2)) + { + driver.PlugAndPlayPrompt = DifxApp.YesNoType.no; + } + + if (0x4 == (attributes & 0x4)) + { + driver.AddRemovePrograms = DifxApp.YesNoType.no; + } + + if (0x8 == (attributes & 0x8)) + { + driver.Legacy = DifxApp.YesNoType.yes; + } + + if (0x10 == (attributes & 0x10)) + { + driver.DeleteFiles = DifxApp.YesNoType.yes; + } + + if (null != row[2]) + { + driver.Sequence = (int)row[2]; + } + + Wix.Component component = (Wix.Component)this.Core.GetIndexedElement("Component", (string)row[0]); + if (null != component) + { + component.AddChild(driver); + } + else + { + this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "Component", (string)row[0], "Component")); + } + } + } + } +#endif +} 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 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.DifxApp +{ + using WixToolset.Data; + using WixToolset.Extensibility; + + public sealed class DifxAppExtensionData : BaseExtensionData + { + public override string DefaultCulture => "en-US"; + + public override bool TryGetSymbolDefinitionByName(string name, out IntermediateSymbolDefinition symbolDefinition) + { + symbolDefinition = DifxAppSymbolDefinitions.ByName(name); + return symbolDefinition != null; + } + + public override Intermediate GetLibrary(ISymbolDefinitionCreator symbolDefinitions) + { + return Intermediate.Load(typeof(DifxAppExtensionData).Assembly, "WixToolset.DifxApp.difxapp.wixlib", symbolDefinitions); + } + } +} 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 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.DifxApp +{ + using System; + using System.Collections.Generic; + using WixToolset.Extensibility; + + public class DifxAppExtensionFactory : BaseExtensionFactory + { + protected override IReadOnlyCollection ExtensionTypes => new[] + { + typeof(DifxAppCompiler), + typeof(DifxAppExtensionData), + typeof(DifxAppWindowsInstallerBackendBinderExtension), + }; + } +} 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 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.DifxApp +{ + using WixToolset.Data.WindowsInstaller; + + public static class DifxAppTableDefinitions + { + public static readonly TableDefinition MsiDriverPackages = new TableDefinition( + "MsiDriverPackages", + DifxAppSymbolDefinitions.MsiDriverPackages, + new[] + { + 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), + new ColumnDefinition("Flags", ColumnType.Number, 4, primaryKey: false, nullable: false, ColumnCategory.Unknown, minValue: 0, maxValue: 31, description: "Flags for installing and uninstalling driver packages"), + new ColumnDefinition("Sequence", ColumnType.Number, 4, primaryKey: false, nullable: true, ColumnCategory.Unknown, minValue: 0, description: "Order in which the driver packages are processed"), + }, + symbolIdIsPrimaryKey: false + ); + + public static readonly TableDefinition[] All = new[] + { + MsiDriverPackages, + }; + } +} 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 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.DifxApp +{ + using System.Collections.Generic; + using WixToolset.Data.WindowsInstaller; + using WixToolset.Extensibility; + + public class DifxAppWindowsInstallerBackendBinderExtension : BaseWindowsInstallerBackendBinderExtension + { + public override IReadOnlyCollection TableDefinitions => DifxAppTableDefinitions.All; + } +} 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 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.DifxApp +{ + using System; + using WixToolset.Data; + + public enum DifxAppSymbolDefinitionType + { + MsiDriverPackages, + } + + public static partial class DifxAppSymbolDefinitions + { + public static readonly Version Version = new Version("4.0.0"); + + public static IntermediateSymbolDefinition ByName(string name) + { + if (!Enum.TryParse(name, out DifxAppSymbolDefinitionType type)) + { + return null; + } + + return ByType(type); + } + + public static IntermediateSymbolDefinition ByType(DifxAppSymbolDefinitionType type) + { + switch (type) + { + case DifxAppSymbolDefinitionType.MsiDriverPackages: + return DifxAppSymbolDefinitions.MsiDriverPackages; + + default: + throw new ArgumentOutOfRangeException(nameof(type)); + } + } + } +} 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 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.DifxApp +{ + using WixToolset.Data; + using WixToolset.DifxApp.Symbols; + + public static partial class DifxAppSymbolDefinitions + { + public static readonly IntermediateSymbolDefinition MsiDriverPackages = new IntermediateSymbolDefinition( + DifxAppSymbolDefinitionType.MsiDriverPackages.ToString(), + new[] + { + new IntermediateFieldDefinition(nameof(MsiDriverPackagesSymbolFields.ComponentRef), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(MsiDriverPackagesSymbolFields.Flags), IntermediateFieldType.Number), + new IntermediateFieldDefinition(nameof(MsiDriverPackagesSymbolFields.Sequence), IntermediateFieldType.Number), + }, + typeof(MsiDriverPackagesSymbol)); + } +} + +namespace WixToolset.DifxApp.Symbols +{ + using WixToolset.Data; + + public enum MsiDriverPackagesSymbolFields + { + ComponentRef, + Flags, + Sequence, + } + + public class MsiDriverPackagesSymbol : IntermediateSymbol + { + public MsiDriverPackagesSymbol() : base(DifxAppSymbolDefinitions.MsiDriverPackages, null, null) + { + } + + public MsiDriverPackagesSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(DifxAppSymbolDefinitions.MsiDriverPackages, sourceLineNumber, id) + { + } + + public IntermediateField this[MsiDriverPackagesSymbolFields index] => this.Fields[(int)index]; + + public string ComponentRef + { + get => this.Fields[(int)MsiDriverPackagesSymbolFields.ComponentRef].AsString(); + set => this.Set((int)MsiDriverPackagesSymbolFields.ComponentRef, value); + } + + public int Flags + { + get => this.Fields[(int)MsiDriverPackagesSymbolFields.Flags].AsNumber(); + set => this.Set((int)MsiDriverPackagesSymbolFields.Flags, value); + } + + public int? Sequence + { + get => this.Fields[(int)MsiDriverPackagesSymbolFields.Sequence].AsNullableNumber(); + set => this.Set((int)MsiDriverPackagesSymbolFields.Sequence, value); + } + } +} \ 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 @@ + + + + + + netstandard2.0 + WixToolset.DifxApp + WiX Toolset DIFxApp Extension + WiX Toolset DIFxApp Extension + true + build + + + + + + + + + + + + + + + + + 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 @@ + + + + + + $(MSBuildThisFileDirectory)..\tools\WixToolset.DifxApp.wixext.dll + + + + + 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 @@ + + + + + + + + + + + + + + + + + + + + + + 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 @@ + + + + + + + + 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 @@ + + + + + + + + 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 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 @@ + + + + + Library + true + en-us + + + + + + + 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 Binary files /dev/null and b/src/ext/DifxApp/wixlib/x64/DIFxApp.dll 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 Binary files /dev/null and b/src/ext/DifxApp/wixlib/x64/DIFxAppA.dll 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 Binary files /dev/null and b/src/ext/DifxApp/wixlib/x86/DIFxApp.dll 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 Binary files /dev/null and b/src/ext/DifxApp/wixlib/x86/DIFxAppA.dll differ diff --git a/src/ext/global.json b/src/ext/global.json new file mode 100644 index 00000000..23dd3fa6 --- /dev/null +++ b/src/ext/global.json @@ -0,0 +1,5 @@ +{ + "msbuild-sdks": { + "WixToolset.Sdk": "4.0.0-build-0211" + } +} diff --git a/src/test/WixToolsetTest.DifxApp/DifxAppExtensionFixture.cs b/src/test/WixToolsetTest.DifxApp/DifxAppExtensionFixture.cs deleted file mode 100644 index f5166453..00000000 --- a/src/test/WixToolsetTest.DifxApp/DifxAppExtensionFixture.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolsetTest.DifxApp -{ - using System.Linq; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; - using WixToolset.DifxApp; - using Xunit; - - public class DifxAppExtensionFixture - { - [Fact] - public void CanBuildUsingDriver() - { - var folder = TestData.Get(@"TestData\UsingDriver"); - var build = new Builder(folder, typeof(DifxAppExtensionFactory), new[] { folder }); - - var results = build.BuildAndQuery(Build, "CustomAction"); - Assert.Equal(new[] - { - "CustomAction:MsiCleanupOnSuccess\t1\tDIFxApp.dll\tCleanupOnSuccess\t", - "CustomAction:MsiInstallDrivers\t3073\tDIFxAppA.dll\tInstallDriverPackages\t", - "CustomAction:MsiProcessDrivers\t1\tDIFxApp.dll\tProcessDriverPackages\t", - "CustomAction:MsiRollbackInstall\t3329\tDIFxAppA.dll\tRollbackInstall\t", - "CustomAction:MsiUninstallDrivers\t3073\tDIFxAppA.dll\tUninstallDriverPackages\t", - }, results); - } - - private static void Build(string[] args) - { - var result = WixRunner.Execute(args) - .AssertSuccess(); - } - } -} diff --git a/src/test/WixToolsetTest.DifxApp/TestData/UsingDriver/Package.en-us.wxl b/src/test/WixToolsetTest.DifxApp/TestData/UsingDriver/Package.en-us.wxl deleted file mode 100644 index 38c12ac1..00000000 --- a/src/test/WixToolsetTest.DifxApp/TestData/UsingDriver/Package.en-us.wxl +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - A newer version of [ProductName] is already installed. - MsiPackage - - diff --git a/src/test/WixToolsetTest.DifxApp/TestData/UsingDriver/Package.wxs b/src/test/WixToolsetTest.DifxApp/TestData/UsingDriver/Package.wxs deleted file mode 100644 index 411893bc..00000000 --- a/src/test/WixToolsetTest.DifxApp/TestData/UsingDriver/Package.wxs +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/src/test/WixToolsetTest.DifxApp/TestData/UsingDriver/PackageComponents.wxs b/src/test/WixToolsetTest.DifxApp/TestData/UsingDriver/PackageComponents.wxs deleted file mode 100644 index 9609771a..00000000 --- a/src/test/WixToolsetTest.DifxApp/TestData/UsingDriver/PackageComponents.wxs +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - diff --git a/src/test/WixToolsetTest.DifxApp/TestData/UsingDriver/example.txt b/src/test/WixToolsetTest.DifxApp/TestData/UsingDriver/example.txt deleted file mode 100644 index 1b4ffe8a..00000000 --- a/src/test/WixToolsetTest.DifxApp/TestData/UsingDriver/example.txt +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index e205d24a..00000000 --- a/src/test/WixToolsetTest.DifxApp/WixToolsetTest.DifxApp.csproj +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - netcoreapp3.1 - false - - - - NU1701 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/version.json b/src/version.json new file mode 100644 index 00000000..5f857771 --- /dev/null +++ b/src/version.json @@ -0,0 +1,11 @@ +{ + "version": "4.0", + "publicReleaseRefSpec": [ + "^refs/heads/master$" + ], + "cloudBuild": { + "buildNumber": { + "enabled": true + } + } +} diff --git a/src/wix.snk b/src/wix.snk deleted file mode 100644 index 3908a66a..00000000 Binary files a/src/wix.snk and /dev/null differ diff --git a/src/wixext/DifxAppCompiler.cs b/src/wixext/DifxAppCompiler.cs deleted file mode 100644 index e056988f..00000000 --- a/src/wixext/DifxAppCompiler.cs +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.DifxApp -{ - using System; - using System.Collections.Generic; - using System.Xml.Linq; - using WixToolset.Data; - using WixToolset.DifxApp.Symbols; - using WixToolset.Extensibility; - - /// - /// The compiler for the WiX Toolset Driver Install Frameworks for Applications Extension. - /// - public sealed class DifxAppCompiler : BaseCompilerExtension - { - private HashSet components; - - public override XNamespace Namespace => "http://wixtoolset.org/schemas/v4/wxs/difxapp"; - /// - /// Instantiate a new DifxAppCompiler. - /// - public DifxAppCompiler() - { - this.components = new HashSet(); - } - - /// - /// Processes an element for the Compiler. - /// - /// Source line number for the parent element. - /// Parent element of element to process. - /// Element to process. - /// Extra information about the context in which this element is being parsed. - public override void ParseElement(Intermediate intermediate, IntermediateSection section, XElement parentElement, XElement element, IDictionary context) - { - switch (parentElement.Name.LocalName) - { - case "Component": - var componentId = context["ComponentId"]; - var directoryId = context["DirectoryId"]; - var componentWin64 = Boolean.Parse(context["Win64"]); - - switch (element.Name.LocalName) - { - case "Driver": - this.ParseDriverElement(intermediate, section, element, componentId, componentWin64); - break; - default: - this.ParseHelper.UnexpectedElement(parentElement, element); - break; - } - break; - default: - this.ParseHelper.UnexpectedElement(parentElement, element); - break; - } - } - - /// - /// Parses a Driver element. - /// - /// Element to parse. - /// Identifier for parent component. - private void ParseDriverElement(Intermediate intermediate, IntermediateSection section, XElement node, string componentId, bool win64) - { - var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node); - int attributes = 0; - var sequence = CompilerConstants.IntegerNotSet; - - // check the number of times a Driver element has been nested under this Component element - if (null != componentId) - { - if (this.components.Contains(componentId)) - { - this.Messaging.Write(ErrorMessages.TooManyElements(sourceLineNumbers, "Component", node.Name.LocalName, 1)); - } - else - { - this.components.Add(componentId); - } - } - - foreach (var attrib in node.Attributes()) - { - if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) - { - switch (attrib.Name.LocalName) - { - case "AddRemovePrograms": - if (YesNoType.No == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) - { - attributes |= 0x4; - } - break; - case "DeleteFiles": - if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) - { - attributes |= 0x10; - } - break; - case "ForceInstall": - if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) - { - attributes |= 0x1; - } - break; - case "Legacy": - if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) - { - attributes |= 0x8; - } - break; - case "PlugAndPlayPrompt": - if (YesNoType.No == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib)) - { - attributes |= 0x2; - } - break; - case "Sequence": - sequence = this.ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, int.MaxValue); - break; - default: - this.ParseHelper.UnexpectedAttribute(node, attrib); - break; - } - } - else - { - this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, node, attrib); - } - } - - this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, node); - - if (!this.Messaging.EncounteredError) - { - switch (this.Context.Platform) - { - case Platform.X86: - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, SymbolDefinitions.CustomAction, "MsiProcessDrivers"); - break; - case Platform.X64: - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, SymbolDefinitions.CustomAction, "MsiProcessDrivers_x64"); - break; - } - - var symbol = section.AddSymbol(new MsiDriverPackagesSymbol(sourceLineNumbers) - { - ComponentRef = componentId, - Flags = attributes, - }); - - if (CompilerConstants.IntegerNotSet != sequence) - { - symbol.Sequence = sequence; - } - } - } - } -} diff --git a/src/wixext/DifxAppDecompiler.cs b/src/wixext/DifxAppDecompiler.cs deleted file mode 100644 index e41d8b98..00000000 --- a/src/wixext/DifxAppDecompiler.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.DifxApp -{ -#if TODO_CONSIDER_DECOMPILER - using System; - using System.Collections; - using System.Globalization; - using WixToolset.Data; - using WixToolset.Extensibility; - using DifxApp = WixToolset.Extensions.Serialize.DifxApp; - using Wix = WixToolset.Data.Serialize; - - /// - /// The decompiler for the WiX Toolset Driver Install Frameworks for Applications Extension. - /// - public sealed class DifxAppDecompiler : DecompilerExtension - { - /// - /// Creates a decompiler for Gaming Extension. - /// - public DifxAppDecompiler() - { - this.TableDefinitions = DifxAppExtensionData.GetExtensionTableDefinitions(); - } - - /// - /// Decompiles an extension table. - /// - /// The table to decompile. - public override void DecompileTable(Table table) - { - switch (table.Name) - { - case "MsiDriverPackages": - this.DecompileMsiDriverPackagesTable(table); - break; - default: - base.DecompileTable(table); - break; - } - } - - /// - /// Decompile the MsiDriverPackages table. - /// - /// The table to decompile. - private void DecompileMsiDriverPackagesTable(Table table) - { - foreach (Row row in table.Rows) - { - DifxApp.Driver driver = new DifxApp.Driver(); - - int attributes = (int)row[1]; - if (0x1 == (attributes & 0x1)) - { - driver.ForceInstall = DifxApp.YesNoType.yes; - } - - if (0x2 == (attributes & 0x2)) - { - driver.PlugAndPlayPrompt = DifxApp.YesNoType.no; - } - - if (0x4 == (attributes & 0x4)) - { - driver.AddRemovePrograms = DifxApp.YesNoType.no; - } - - if (0x8 == (attributes & 0x8)) - { - driver.Legacy = DifxApp.YesNoType.yes; - } - - if (0x10 == (attributes & 0x10)) - { - driver.DeleteFiles = DifxApp.YesNoType.yes; - } - - if (null != row[2]) - { - driver.Sequence = (int)row[2]; - } - - Wix.Component component = (Wix.Component)this.Core.GetIndexedElement("Component", (string)row[0]); - if (null != component) - { - component.AddChild(driver); - } - else - { - this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "Component", (string)row[0], "Component")); - } - } - } - } -#endif -} diff --git a/src/wixext/DifxAppExtensionData.cs b/src/wixext/DifxAppExtensionData.cs deleted file mode 100644 index 31a95b8e..00000000 --- a/src/wixext/DifxAppExtensionData.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.DifxApp -{ - using WixToolset.Data; - using WixToolset.Extensibility; - - public sealed class DifxAppExtensionData : BaseExtensionData - { - public override string DefaultCulture => "en-US"; - - public override bool TryGetSymbolDefinitionByName(string name, out IntermediateSymbolDefinition symbolDefinition) - { - symbolDefinition = DifxAppSymbolDefinitions.ByName(name); - return symbolDefinition != null; - } - - public override Intermediate GetLibrary(ISymbolDefinitionCreator symbolDefinitions) - { - return Intermediate.Load(typeof(DifxAppExtensionData).Assembly, "WixToolset.DifxApp.difxapp.wixlib", symbolDefinitions); - } - } -} diff --git a/src/wixext/DifxAppExtensionFactory.cs b/src/wixext/DifxAppExtensionFactory.cs deleted file mode 100644 index 3932685d..00000000 --- a/src/wixext/DifxAppExtensionFactory.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.DifxApp -{ - using System; - using System.Collections.Generic; - using WixToolset.Extensibility; - - public class DifxAppExtensionFactory : BaseExtensionFactory - { - protected override IReadOnlyCollection ExtensionTypes => new[] - { - typeof(DifxAppCompiler), - typeof(DifxAppExtensionData), - typeof(DifxAppWindowsInstallerBackendBinderExtension), - }; - } -} diff --git a/src/wixext/DifxAppTableDefinitions.cs b/src/wixext/DifxAppTableDefinitions.cs deleted file mode 100644 index a6c26444..00000000 --- a/src/wixext/DifxAppTableDefinitions.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.DifxApp -{ - using WixToolset.Data.WindowsInstaller; - - public static class DifxAppTableDefinitions - { - public static readonly TableDefinition MsiDriverPackages = new TableDefinition( - "MsiDriverPackages", - DifxAppSymbolDefinitions.MsiDriverPackages, - new[] - { - 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), - new ColumnDefinition("Flags", ColumnType.Number, 4, primaryKey: false, nullable: false, ColumnCategory.Unknown, minValue: 0, maxValue: 31, description: "Flags for installing and uninstalling driver packages"), - new ColumnDefinition("Sequence", ColumnType.Number, 4, primaryKey: false, nullable: true, ColumnCategory.Unknown, minValue: 0, description: "Order in which the driver packages are processed"), - }, - symbolIdIsPrimaryKey: false - ); - - public static readonly TableDefinition[] All = new[] - { - MsiDriverPackages, - }; - } -} diff --git a/src/wixext/DifxAppWindowsInstallerBackendBinderExtension.cs b/src/wixext/DifxAppWindowsInstallerBackendBinderExtension.cs deleted file mode 100644 index 41f01175..00000000 --- a/src/wixext/DifxAppWindowsInstallerBackendBinderExtension.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.DifxApp -{ - using System.Collections.Generic; - using WixToolset.Data.WindowsInstaller; - using WixToolset.Extensibility; - - public class DifxAppWindowsInstallerBackendBinderExtension : BaseWindowsInstallerBackendBinderExtension - { - public override IReadOnlyCollection TableDefinitions => DifxAppTableDefinitions.All; - } -} diff --git a/src/wixext/Symbols/DifxAppSymbolDefinitions.cs b/src/wixext/Symbols/DifxAppSymbolDefinitions.cs deleted file mode 100644 index 76f4d88f..00000000 --- a/src/wixext/Symbols/DifxAppSymbolDefinitions.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.DifxApp -{ - using System; - using WixToolset.Data; - - public enum DifxAppSymbolDefinitionType - { - MsiDriverPackages, - } - - public static partial class DifxAppSymbolDefinitions - { - public static readonly Version Version = new Version("4.0.0"); - - public static IntermediateSymbolDefinition ByName(string name) - { - if (!Enum.TryParse(name, out DifxAppSymbolDefinitionType type)) - { - return null; - } - - return ByType(type); - } - - public static IntermediateSymbolDefinition ByType(DifxAppSymbolDefinitionType type) - { - switch (type) - { - case DifxAppSymbolDefinitionType.MsiDriverPackages: - return DifxAppSymbolDefinitions.MsiDriverPackages; - - default: - throw new ArgumentOutOfRangeException(nameof(type)); - } - } - } -} diff --git a/src/wixext/Symbols/MsiDriverPackagesSymbol.cs b/src/wixext/Symbols/MsiDriverPackagesSymbol.cs deleted file mode 100644 index 2fd91bc8..00000000 --- a/src/wixext/Symbols/MsiDriverPackagesSymbol.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.DifxApp -{ - using WixToolset.Data; - using WixToolset.DifxApp.Symbols; - - public static partial class DifxAppSymbolDefinitions - { - public static readonly IntermediateSymbolDefinition MsiDriverPackages = new IntermediateSymbolDefinition( - DifxAppSymbolDefinitionType.MsiDriverPackages.ToString(), - new[] - { - new IntermediateFieldDefinition(nameof(MsiDriverPackagesSymbolFields.ComponentRef), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(MsiDriverPackagesSymbolFields.Flags), IntermediateFieldType.Number), - new IntermediateFieldDefinition(nameof(MsiDriverPackagesSymbolFields.Sequence), IntermediateFieldType.Number), - }, - typeof(MsiDriverPackagesSymbol)); - } -} - -namespace WixToolset.DifxApp.Symbols -{ - using WixToolset.Data; - - public enum MsiDriverPackagesSymbolFields - { - ComponentRef, - Flags, - Sequence, - } - - public class MsiDriverPackagesSymbol : IntermediateSymbol - { - public MsiDriverPackagesSymbol() : base(DifxAppSymbolDefinitions.MsiDriverPackages, null, null) - { - } - - public MsiDriverPackagesSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(DifxAppSymbolDefinitions.MsiDriverPackages, sourceLineNumber, id) - { - } - - public IntermediateField this[MsiDriverPackagesSymbolFields index] => this.Fields[(int)index]; - - public string ComponentRef - { - get => this.Fields[(int)MsiDriverPackagesSymbolFields.ComponentRef].AsString(); - set => this.Set((int)MsiDriverPackagesSymbolFields.ComponentRef, value); - } - - public int Flags - { - get => this.Fields[(int)MsiDriverPackagesSymbolFields.Flags].AsNumber(); - set => this.Set((int)MsiDriverPackagesSymbolFields.Flags, value); - } - - public int? Sequence - { - get => this.Fields[(int)MsiDriverPackagesSymbolFields.Sequence].AsNullableNumber(); - set => this.Set((int)MsiDriverPackagesSymbolFields.Sequence, value); - } - } -} \ No newline at end of file diff --git a/src/wixext/WixToolset.DifxApp.wixext.csproj b/src/wixext/WixToolset.DifxApp.wixext.csproj deleted file mode 100644 index 50d3debf..00000000 --- a/src/wixext/WixToolset.DifxApp.wixext.csproj +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - netstandard2.0 - WixToolset.DifxApp - WiX Toolset DIFxApp Extension - WiX Toolset DIFxApp Extension - true - build - - - - - - - - - - - - - - - - - diff --git a/src/wixext/WixToolset.DifxApp.wixext.targets b/src/wixext/WixToolset.DifxApp.wixext.targets deleted file mode 100644 index b01d4116..00000000 --- a/src/wixext/WixToolset.DifxApp.wixext.targets +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - $(MSBuildThisFileDirectory)..\tools\WixToolset.DifxApp.wixext.dll - - - - - diff --git a/src/wixlib/DifxAppExtension_Platform.wxi b/src/wixlib/DifxAppExtension_Platform.wxi deleted file mode 100644 index b8d613c9..00000000 --- a/src/wixlib/DifxAppExtension_Platform.wxi +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/wixlib/DifxAppExtension_x64.wxs b/src/wixlib/DifxAppExtension_x64.wxs deleted file mode 100644 index 3c534363..00000000 --- a/src/wixlib/DifxAppExtension_x64.wxs +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/src/wixlib/DifxAppExtension_x86.wxs b/src/wixlib/DifxAppExtension_x86.wxs deleted file mode 100644 index d352a272..00000000 --- a/src/wixlib/DifxAppExtension_x86.wxs +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/src/wixlib/caSuffix.wxi b/src/wixlib/caSuffix.wxi deleted file mode 100644 index a56a2393..00000000 --- a/src/wixlib/caSuffix.wxi +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/wixlib/difxapp.wixproj b/src/wixlib/difxapp.wixproj deleted file mode 100644 index 2ae9a097..00000000 --- a/src/wixlib/difxapp.wixproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - - Library - true - en-us - - - - - - - diff --git a/src/wixlib/x64/DIFxApp.dll b/src/wixlib/x64/DIFxApp.dll deleted file mode 100644 index 69a44cc8..00000000 Binary files a/src/wixlib/x64/DIFxApp.dll and /dev/null differ diff --git a/src/wixlib/x64/DIFxAppA.dll b/src/wixlib/x64/DIFxAppA.dll deleted file mode 100644 index 99458040..00000000 Binary files a/src/wixlib/x64/DIFxAppA.dll and /dev/null differ diff --git a/src/wixlib/x86/DIFxApp.dll b/src/wixlib/x86/DIFxApp.dll deleted file mode 100644 index 678a9d95..00000000 Binary files a/src/wixlib/x86/DIFxApp.dll and /dev/null differ diff --git a/src/wixlib/x86/DIFxAppA.dll b/src/wixlib/x86/DIFxAppA.dll deleted file mode 100644 index 3ac0838d..00000000 Binary files a/src/wixlib/x86/DIFxAppA.dll and /dev/null differ diff --git a/version.json b/version.json deleted file mode 100644 index 5f857771..00000000 --- a/version.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "version": "4.0", - "publicReleaseRefSpec": [ - "^refs/heads/master$" - ], - "cloudBuild": { - "buildNumber": { - "enabled": true - } - } -} -- cgit v1.2.3-55-g6feb