Wix4JsonFileExtension 4.0.0.18

There is a newer version of this package available.
See the version list below for details.
dotnet add package Wix4JsonFileExtension --version 4.0.0.18
                    
NuGet\Install-Package Wix4JsonFileExtension -Version 4.0.0.18
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Wix4JsonFileExtension" Version="4.0.0.18" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Wix4JsonFileExtension" Version="4.0.0.18" />
                    
Directory.Packages.props
<PackageReference Include="Wix4JsonFileExtension" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Wix4JsonFileExtension --version 4.0.0.18
                    
#r "nuget: Wix4JsonFileExtension, 4.0.0.18"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Wix4JsonFileExtension@4.0.0.18
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Wix4JsonFileExtension&version=4.0.0.18
                    
Install as a Cake Addin
#tool nuget:?package=Wix4JsonFileExtension&version=4.0.0.18
                    
Install as a Cake Tool

Wix4JsonFileExtension

An extension to Windows® installer XML (WiX) to create or modify JSON-formatted files during an installation.

Status: JSONPath supported for install only applications

To Use this Wix Extension

  1. Add a package reference to your project with dotnet add package Wix4JsonFileExtension
  2. Add a schema reference inside your wxs file to
xmlns:Json="http://schemas.hegsie.com/wix/JsonExtension"
  1. Use the JsonFile XML element inside your wxs to update your target jaon file:
<Json:JsonFile Id="appSettingsSetBooks" File="[#JsonConfig]" ElementPath="$.store.book" Value="[MY_BOOKS]" Action="addArrayValue" />

Possible Actions include

  • deleteValue
  • setValue (this is the default if one isn't specified)
  • addArrayValue
  • createJsonPointerValue

All actions use JSONPaths in their ElementPaths unless specified in their action i.e. createJsonPointerValue

  1. Refer to the product.wxs inside the TestJsonConfigInstaller project here for examples on how to manipulate your JSON file inside of an MSI

NB: There are a lot of complex scenarios when using JSONPath (like multi-select inside arrays etc, which don't currently work) try to keep use cases simple where possible or report the issue here and I'll try and see if it can be implemented.

Windows® installer XML is an open-source set of tools to create Windows® software installation setups (*.msi), using XML files to define the content and behavior of the setup. One important step in most setups is to modify configuration files to reflect either settings specified during the setup by the user, or other settings specific to the individual installation. Windows® installer has built-in actions to modify the classic ini-files (*.ini), and WiX provides extensions (and the required custom actions) to modify XML files, and in particular the Application Configuration files (*.exe.config or *.dll.config) used by Microsoft® .NET applications. Today, a third format has become popular, especially in web applications: JSON - JavaScript Object Notation. Often used in networking scenarios (REST services, JQuery, etc.), it is also used as a local data store format, including configuration files. Especially .NET Core relies heavily on JSON-formatted configuration files, both during development and runtime.

This extension for WiX provides methods to modify JSON files (*.json) during a software installation. The new XML elements provided by this extension, JsonFile and JsonConfig, work very similar to the existing extensions for XML files, XmlFile and XmlConfig

Acknowledgements

WixJsonExtension uses jsoncons by Daniel Parker to read and manipulate JSON files.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.0.26 238 7/24/2024
4.0.0.25 1,384 2/7/2024
4.0.0.24 942 1/21/2024
4.0.0.23 876 1/19/2024
4.0.0.22 1,007 1/17/2024
4.0.0.21 835 1/17/2024
4.0.0.20 905 1/17/2024
4.0.0.19 733 1/16/2024
4.0.0.18 1,116 1/16/2024
4.0.0.17 1,004 1/16/2024
4.0.0.16 1,230 8/23/2023
4.0.0.15 1,292 8/23/2023
4.0.0.14 1,084 8/6/2023
4.0.0.13 1,156 8/6/2023
4.0.0.12 1,169 8/6/2023
4.0.0.11 1,219 8/4/2023
4.0.0.10 1,197 8/4/2023
4.0.0.9 487 8/4/2023