This guide uses Visual Studio 2022 to compile Strawberry as well all required libraries.
There is an install.bat batch file to install most of these automatically.
- Git for Windows
- Visual Studio 2022
- Qt Visual Studio Tools
- CMake
- Meson
- NASM
- Strawberry Perl
- Python
- 7-Zip
- Win Flex/Bison
- NSIS
- NSIS LockedList Plugin
- NSIS Inetc Plugin
- NSIS Registry Plugin
- Remove "C:\Strawberry\c\bin" from PATH.
- Make sure no pkg-config utility is in PATH, this will cause conflicts with Strawberry's own pkg-config. del c:\strawberry\perl\bin\pkg-config.bat
- Make sure no MinGW-W64 (gcc, g++, etc) installation is in PATH, as this can cause those to be picked up as compiler instead of MSVC.
- You need the sed and patch utility, add C:\Program Files\Git\usr\bin to PATH.
To create the Strawberry installer, you need 3 NSIS plugins (LockedList, Inetc and Registry).
Those need to be manually extracted, and copied to C:\Program Files (x86)\NSIS\Plugins
Specifically, the following files need to exist:
C:\Program Files (x86)\NSIS\Plugins\LockedList64.dll
C:\Program Files (x86)\NSIS\Plugins\Registry.dll
C:\Program Files (x86)\NSIS\Plugins\x86-unicode\LockedList.dll
C:\Program Files (x86)\NSIS\Plugins\x86-unicode\Registry.dll
C:\Program Files (x86)\NSIS\Plugins\x86-unicode\INetC.dll
Download the latest dependencies from https://github.com/strawberrymusicplayer/strawberry-msvc-dependencies/releases
Extract them to ie.: "c:\strawberry_msvc_x86_64_debug" for the debug version, or "c:\strawberry_msvc_x86_64_release" for the release version.
This guide provides a "download.bat" and "build.bat" file to automatically build all dependencies.
Start "x64 Native Tools Command Prompt for VS 2022"
Run download.bat
This should download all necessary sources.
build.bat "debug"
build.bat "release"
Add "c:\strawberry_msvc_x86_64_debug\bin" for the debug version, or "c:\strawberry_msvc_x86_64_release\bin" for the release version to PATH.
Open the strawberry git source directory in Visual Studio 2022.
Add the following extra CMake arguments:
For debug:
-DARCH=x86_64 -DICU_ROOT=c:\\strawberry_msvc_x86_64_debug
For release:
-DARCH=x86_64 -DICU_ROOT=c:\\strawberry_msvc_x86_64_release
Run the "copy-deps-msvc-x64-debug-qt6.bat" or "copy-deps-msvc-x64-release-qt6.bat" batch file first to copy all plugins to the build directory. After that, you can use the copydlldeps.sh shell script to copy all the dependencies to the build directory.
Install MSYS (https://www.msys2.org/)
pacman -Syu binutils
cd /c/Data/Projects/strawberry/strawberry/out/build/x64-Debug/Debug
wget https://raw.githubusercontent.com/strawberrymusicplayer/strawberry-mxe/master/tools/copydlldeps.sh
chmod u+x copydlldeps.sh
./copydlldeps.sh -c -d . -F . -F ./platforms -F ./styles -F ./tls -F ./sqldrivers -F ./imageformats -F ./gio-modules -F ./gstreamer-plugins -R /c/strawberry_msvc_x86_64_debug/bin -R /c/strawberry_msvc_x86_64_debug
To create the NSIS installer open MakeNSIS and drag strawberry.nsi over in the MakeNSIS window.