Set up WiX to create Windows Installer for program distribution

Page updated :

Environment

Visual Studio
  • Visual Studio Community 2017
  • Visual Studio Community 2019
WiX Toolset
3.11.2

※ Works in other versions, but is unconfirmed

At first

There are a variety of ways to distribute applications that you create for Windows. In some cases, you might distribute the program ".exe" directly, but in this case the program may be placed anywhere in the user and will not work properly, or you may not be able to do what you want to do at the time of setup.

Therefore, if you want to deploy large programs that are large or complex, such as commercial applications, you usually have installers available for users to install.

This article provides step-by-step instructions on how to create an installer that is commonly used in installation in the Windows Installer "MSI" format. You can also create an MSI installer with standard Visual Studio features, but we're using WiX. WiX allows you to create installers that are more granular than the standard visual studio features.

I can't introduce all the features here, but if you want to understand the flow of the installer creation first and add other features, it's a good idea to check on the official site.

Pre-preparation

  • You have Visual Studio installed.
  • Sign in to Windows with administrative rights.
  • You have installed the .NET Framework 3.5.1 on Windows.

Installing wix toolset

Open the official site below and download WiX Toolset build tools.

image

Download wix311.exe on the previous page you opened. (Versions may vary depending on the update))

image

Press Save to run it. By default, it is saved to the downloads folder. (If you run it directly, it will be saved in a separate folder.)

image

image

After running WiX Toolset build tools, you get the following error:

image

You must install the .NET Framework 3.5.1 runtime. It is not installed as standard in modern Windows 10, and will not be installed unless you install the LATEST Visual Studio unless you explicitly install the SDK during installation.

If you want to install, download and install the runtime from the following link:

By the way, the downloaded file is build tools and has not been installed yet. Click Install to install it.

image

image

When the installation is complete, the message on the top left is "Successfully installed". Click Exit to exit.

image

You can see that a folder has been added to the Start menu.

image

Installing WiX Toolset Visual Studio Extension

Then install wix toolset Visual Studio Extension. Download and install the file from the following page. This is where the Visual Studio 2019 version is included.

image

image

Run the downloaded file.

image

image

Click the Install button.

image

Click the Close button to complete the installation.

image

This completes setup.

Download Wix Edit

It's not required, but it's a little useful when editing Wix settings. Please download it from the following site. There is also either an installer or a single exe version. Tips describes using Wix Edit.

image

Summary

WiX is now set up. Next time, I'd like to create a simple installer.