Set up Build Environment on Windows
Note: This is only a one-time setup guide. For actually building KeePassXC, please refer to our build guide.
We recommend building KeePassXC using Visual Studio to maximize feature availability. Visual Studio is free to use and dependencies are provided from trusted sources or self-built using Vcpkg.
-
Download and install Visual Studio Community 2022: https://visualstudio.microsoft.com/downloads/
-
At a minimum, ensure the following options are selected. We require at least Windows SDK version 10.0.22000.0. You can also import this installation configuration to auto-select these options: vsconfig.zip
- (Optional) Instead of the entire IDE, you may install Visual Studio Build Tools and use VSCode as an IDE.
Recommended Option:
KeePassXC provides a pre-built dependency bundle to save time building them yourself. Simply download and unzip the pre-built dependency package to a folder of your choice. Download here: https://keepassxc.dmapps.us/vcpkg-export.zip
Alternative Option:
-
Download and install vcpkg: https://vcpkg.io/en/getting-started.html
-
Open a command prompt to the vcpkg directory and run the following command. This will take up to an hour to complete the build process.
.\vcpkg.exe install argon2 botan minizip qt5 qt5-svg qt5-tools qt5-imageformats qt5-translations readline zlib libqrencode --triplet=x64-windows
-
Download and install Ruby without devkit: https://rubyinstaller.org/downloads/
a. Make sure to uncheck install MSYS2/MINGW on the final install screen.
-
Open a command prompt and run:
gem install asciidoctor
-
In the same command prompt, test the install by running:
asciidoctor
Building using MSYS is deprecated, we no longer recommend this method.
- Download MSYS2 64bit: http://msys2.github.io/
- Start MSYS2 shell
- Update the system packages:
pacman --needed -Sy bash pacman pacman-mirrors msys2-runtime
- Restart MSYS2 shell
- Update all packages:
pacman -Syu
If prompted, restart the shell and re-run this command until done
This command will install the MinGW-W GCC compiler, CMake, Binutils, and Asciidoctor:
Open an MSYS2 shell:
pacman -S git make mingw-w64-$(uname -m)-gcc mingw-w64-$(uname -m)-toolchain \
mingw-w64-$(uname -m)-binutils mingw-w64-$(uname -m)-cmake \
mingw-w64-$(uname -m)-asciidoctor
Open an MSYS2 shell:
pacman -S mingw-w64-$(uname -m)-qt5 \
mingw-w64-$(uname -m)-libbotan mingw-w64-$(uname -m)-zlib \
mingw-w64-$(uname -m)-argon2 mingw-w64-$(uname -m)-qrencode
To build an installation package when running make package
you need to have the WiX toolset installed. You can obtain it from https://github.com/wixtoolset/wix3/releases
Once installed you will need to add the toolset folder to your MSYS PATH environment: export PATH="${PATH}:/c/Program Files (x86)/WiX Toolset v3.11/bin"
Open a MSYS2 shell:
pacman -Syu
Copyright (C) 2016-2023 KeePassXC Team