This guide uses Visual Studio 2022 to build Strawberry Music Player as well as required dependencies.
These instructions are provided as-is, they are primarily intended for developers working on Strawberry on Windows.
We do not offer support to users for building Strawberry on Windows.
Build tools (Git, CMake, Meson, Perl, Python, etc) versions are not regulary updated, so make sure you bump the versions in versions.bat before you run install.bat.
- 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
Download and install manually:
- Git
- Default settings can be used
- Visual Studio 2022 Community
- Select
Desktop development with C++
- Select
Open a Command Prompt
and type:
mkdir C:\data\projects\strawberry
cd C:\data\projects\strawberry
git clone https://github.com/strawberrymusicplayer/strawberry.git
git clone https://github.com/strawberrymusicplayer/strawberry-msvc.git
cd strawberry-msvc
.\download.bat
Install manually from C:\data\projects\strawberry\msvc_\downloads
:
- Required:
- Install
7z<VERSION>-x64.exe
- Install
cmake-<VERSION>-windows-x86_64.msi
- Install
python-<VERSION>-amd64.exe
- In first dialog:
- Check:
Add python.exe to PATH
- Click
Install Now
(to use defaults)
- Check:
- In dialog
Setup was successful
:- Click:
Disable path length limit
- Click:
- In first dialog:
- Install
strawberry-perl-<VERSION>-64bit.msi
- Extract
win_flex_bison-<VERSION>.zip
toC:\win_flex_bison
- Install
- Recommended: When building dependencies from source:
- Install
nasm-<VERSION>-installer-x64.exe
- Run as
Administrator
and install intoC:\Program Files\NASM
.
- Run as
- Install
- Recommended: When creating NSIS Windows installer:
- Install NSIS:
nsis-<NSIS_VERSION>-setup.exe
- Extract NSIS
LockedList.zip
plugin:- Copy
LockedList\Plugins\LockedList64.dll
toC:\Program Files (x86)\NSIS\Plugins\LockedList64.dll
- Copy
LockedList\Plugins\x86-unicode\LockedList.dll
toC:\Program Files (x86)\NSIS\Plugins\x86-unicode\LockedList.dll
- Copy
- Extract NSIS
Inetc.zip
plugin:- Copy
Inetc\Plugins\x86-unicode\INetC.dll
toC:\Program Files (x86)\NSIS\Plugins\x86-unicode\INetC.dll
- Copy
- Extract NSIS
Registry.zip
plugin:- Copy
Registry\Desktop\Plugin\registry.dll
toC:\Program Files (x86)\NSIS\Plugins\registry.dll
- Copy
Registry\Desktop\Plugin\registry.dll
toC:\Program Files (x86)\NSIS\Plugins\x86-unicode\registry.dll
- Copy
- Install NSIS:
Delete pkg-config
files to prevent conflicts with Strawberry's own pkg-config
:
- Delete
C:\strawberry\perl\bin\pkg-config
- Delete
C:\strawberry\perl\bin\pkg-config.bat
Windows Settings | System | About | Advanced system settings | Tab Advanced | Environment Variables:
- System variables | Path | Edit:
- Delete:
C:\Strawberry\c\bin
(To prevent conflicts with other utilities) - Add:
C:\Program Files\Git\bin
(This is forsed
andpatch
utilities) - Add:
C:\Program Files (x86)\NSIS
- 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.
- Delete:
Building with Meson 1.6.0 installation results in build issues meson: error: unrecognized arguments:.
A temporary solution is to remove Meson via Windows Settings | Apps or remove programs
.
Then install Meson via Python PIP system wide. Start | x64 Native Tools Command Prompt for VS 2022
and type:
pip install meson
Prebuilt MSVC binaries can be optionally used to speed-up the build process. When this step is skipped, all libraries and dependencies are build from source.
To use prebuilds, download the following tar.xz
files from Github strawberry-msvc-dependencies/releases:
- For debug, extract
strawberry-msvc-x86_64-debug.tar.xz
toC:\strawberry_msvc_x86_64_debug
- For release, extract
strawberry-msvc-x86_64-release.tar.xz
toC:\strawberry_msvc_x86_64_release
- Set one debug or release in
PATH
environment variable:- For debug:
C:\strawberry_msvc_x86_64_debug\bin
, or: - For release:
C:\strawberry_msvc_x86_64_release\bin
- For debug:
- Start |
x64 Native Tools Command Prompt for VS 2022
:
cd C:\data\projects\strawberry\strawberry-msvc
For debug build:
.\build.bat
For release build:
.\build.bat release
Strawberry and Windows installer executables are generated in:
- For debug:
C:\data\projects\strawberry\msvc_\build_debug\strawberry\build\
- For release:
C:\data\projects\strawberry\msvc_\build_release\strawberry\build\
Optional Qt Visual Studio Tools
can be installed via the toolbar Extensions | Manage Extensions
and search for Qt Visual Studio Tools
. Then click Install
.
Debug build:
- Make sure the path
C:\strawberry_msvc_x86_64_debug\bin
is added to thePATH
environment variable before starting Visual Studio 2022. - Start | Visual Studio 2022
- Open a local folder
C:\data\projects\strawberry\strawberry
- Toolbar Project | CMake Settings:
- Select Configurations
x64-Debug
- Add
CMake command arguments
:-DARCH=x86_64 -DICU_ROOT=c:\\strawberry_msvc_x86_64_debug
- Select Configurations
- Select in the toolbar
x64-Debug
- Toolbar: Build | Build All
Release build:
- Make sure the path
C:\strawberry_msvc_x86_64_release\bin
is added to thePATH
environment variable before starting Visual Studio 2022. - Start | Visual Studio 2022
- Open a local folder
C:\data\projects\strawberry\strawberry
- Toolbar Project | CMake Settings:
- Create new
x64-Release
- Select Configurations
x64-Release
- Add
CMake command arguments
:-DARCH=x86_64 -DICU_ROOT=c:\\strawberry_msvc_x86_64_release -DENABLE_WIN32_CONSOLE=OFF
- Save the changes
- In the toolbar select
x64-Release
- Project | Delete Cache and Reconfigure
- Create new
- Toolbar: Build | Build All
Set breakpoint and press F5 to start debugging and use F10 to step into and F11 to step over.