WiX Toolset is used to build .msi
installers for Node.js.
The usual way to install WiX is to download and run the installer. This requires .NET Framework 3.5.1.
Attempting to install without that results in:
WiX Toolset requires the .NET Framework 3.5.1 Windows feature to be enabled.
Enabling the feature can fail if the computer has been configured to get updates from a WSUS server instead of Windows Update.
The WiX project provides instructions on integrating WiX into a build process without preinstalling it. WiX releases also provide a zip file containing the WiX binaries and SDK. After unzipping the instructions detail modifying the WiX project files -- the rest of this document details how to set up your environment to avoid having to modify the Node.js WiX project files.
Assuming WiX was unzipped into c:\Program Files (x86)\WiX Toolset v3.11\
(requires admininstrator privileges):
Set these variables -- either as system/user environment variables or in the VS Dev command prompt session.
Name | Value |
---|---|
WIX |
c:\Program Files (x86)\WiX Toolset v3.11 -- Point to the unzipped directory |
WixTargetsPath |
c:\Program Files (x86)\WiX Toolset v3.11\Wix.targets |
WixTasksPath |
c:\Program Files (x86)\WiX Toolset v3.11\WixTasks.dll |
WixToolPath |
c:\Program Files (x86)\WiX Toolset v3.11\ -- Must end in a \ |
You will need to create the include directory so that the custom actions in the Node.js project can find the WiX SDK headers.
Either copy or symlink an inc
directory
under the SDK directory
,
e.g. C:\Program Files (x86)\WiX Toolset v3.11\SDK\VS2017\inc
(WiX doesn't have a SDK directory for VS2019 -- Node.js uses
the one for VS2017).
mklink /j "C:\Program Files (x86)\WiX Toolset v3.11\SDK\VS2017\inc" "c:\Program Files (x86)\WiX Toolset v3.11\sdk\inc"
In addition to the WiX toolset you also need to install the extension into Visual Studio. This is a seperate installer,
available on the Visual Studio Marketplace
, and does not need .NET Framework 3.5.1.