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:
Build using CMake + Ninja:
mkdir build && cd build # Ninja generator is the default cmake -DENABLE_CCACHE=On -DFETCH_lua=Yes .. 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 NSIS installer target.
ninja wireshark_nsis_prep ninja wireshark_nsis
If successful the installer can be found in
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: