2.3. Windows: Using MinGW-w64 with MSYS2

MSYS2 comes with different environments/subsystems and the first thing you have to decide is which one to use. The differences among the environments are mainly environment variables, default compilers/linkers, architecture, system libraries used etc. If you are unsure, go with UCRT64.

2.3.1. Building from source

  1. Open the shell for the selected 64-bit environment.
  2. Download the Wireshark source code using Git, if you haven’t done so already, and cd into that directory.
  3. Install needed dependencies:

    tools/msys2-setup.sh --install-all
  4. Build using CMake + Ninja:

    mkdir build && cd build
    # Ninja generator is the default
    cmake -DENABLE_CCACHE=On -DFETCH_lua=Yes ..
    ninja test        # optional, to run the test suite
    ninja install     # optional, install to the MSYS2 shell path

The application should be launched using the same shell.

2.3.2. Building an .exe installer

  1. Follow the instructions above to compile Wireshark from source.
  2. Build the NSIS installer target.

    ninja wireshark_nsis_prep
    ninja wireshark_nsis

If successful the installer can be found in $CMAKE_BINARY_DIR/packaging/nsis.

Alternatively you can also use the PKGBUILD included in the Wireshark source distribution to compile Wireshark into a binary package that can be installed using pacman.

2.3.3. Comparison with MSVC toolchain

The official Wireshark Windows installer is compiled using Microsoft Visual Studio (MSVC). Currently the MSYS2 build has the following limitations compared to the build using MSVC:

  • Lua does not have custom UTF-8 patches.
  • The Event Tracing for Windows (ETW) extcap cannot be compiled using MinGW-w64.
  • Enhanced Kerberos dissection with decryption is not available.
  • AirPcap is not supported.