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.
Install needed dependencies:
$ tools/msys2-setup.sh --install-all
Build using CMake + Ninja:
$ mkdir build && cd build $ cmake -DENABLE_WERROR=Off .. $ ninja $ 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.
Build the Wireshark User Guide.
$ ninja user_guide_html
Build the installer
$ 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.
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: