### Install Windows Qt Configuration Source: https://github.com/keepassxreboot/keepassxc/blob/develop/share/CMakeLists.txt Installs the qt.conf file to the binary installation directory for Windows systems. ```cmake install(FILES windows/qt.conf DESTINATION ${BIN_INSTALL_DIR}) ``` -------------------------------- ### Install Main Executable Target Source: https://github.com/keepassxreboot/keepassxc/blob/develop/src/CMakeLists.txt Installs the main executable target. For macOS, it's installed as a bundle; for other platforms, it's installed to the runtime directory. ```cmake install(TARGETS ${PROGNAME} BUNDLE DESTINATION . COMPONENT Runtime RUNTIME DESTINATION ${BIN_INSTALL_DIR} COMPONENT Runtime) ``` -------------------------------- ### Install pkg-config and vcpkg stub with Homebrew Source: https://github.com/keepassxreboot/keepassxc/wiki/Set-up-Build-Environment-on-macOS Install pkg-config and optionally the vcpkg stub package using Homebrew. ```bash brew install pkg-config vcpkg ``` -------------------------------- ### Install Application Icon Source: https://github.com/keepassxreboot/keepassxc/blob/develop/share/CMakeLists.txt Installs a specific application icon file to the data installation directory. ```cmake install(FILES icons/application/256x256/apps/keepassxc.png DESTINATION ${DATA_INSTALL_DIR}/icons/application/256x256/apps) ``` -------------------------------- ### Install Xcode Command Line Tools Source: https://github.com/keepassxreboot/keepassxc/wiki/Set-up-Build-Environment-on-macOS Install the Xcode Command Line Tools by running this command in the terminal. ```bash xcode-select --install ``` -------------------------------- ### Install KeePassXC Binary Source: https://github.com/keepassxreboot/keepassxc/blob/develop/INSTALL.md Install the built KeePassXC application using the 'make install' command. This command typically requires superuser privileges. ```bash sudo make install ``` -------------------------------- ### Install Build Tools with Homebrew Source: https://github.com/keepassxreboot/keepassxc/wiki/Set-up-Build-Environment-on-macOS Use Homebrew to install essential build tools like cmake and asciidoctor. ```bash brew install cmake asciidoctor ``` -------------------------------- ### Install Proxy Executable Source: https://github.com/keepassxreboot/keepassxc/blob/develop/src/proxy/CMakeLists.txt Installs the built proxy executable to a specified directory, categorized under the 'Runtime' component. ```cmake install(TARGETS keepassxc-proxy BUNDLE DESTINATION . COMPONENT Runtime RUNTIME DESTINATION ${PROXY_INSTALL_DIR} COMPONENT Runtime) ``` -------------------------------- ### Install Homebrew Source: https://github.com/keepassxreboot/keepassxc/wiki/Set-up-Build-Environment-on-macOS Install Homebrew, a package manager for macOS, using the provided script. Alternatively, use the pkg installer if preferred. ```bash /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ``` -------------------------------- ### Install Wordlists Source: https://github.com/keepassxreboot/keepassxc/blob/develop/share/CMakeLists.txt This command finds all files with the .wordlist extension in the 'wordlists' directory and installs them to the specified destination directory. ```cmake file(GLOB wordlists_files "wordlists/*.wordlist") install(FILES ${wordlists_files} DESTINATION ${DATA_INSTALL_DIR}/wordlists) ``` -------------------------------- ### Install Flatpak Icons Source: https://github.com/keepassxreboot/keepassxc/blob/develop/share/CMakeLists.txt Recursively finds icon files and installs them, prefixing their names with the application ID for Flatpak compatibility. ```cmake file(GLOB_RECURSE ICON_FILES LIST_DIRECTORIES false "icons/application/*/keepassxc*.png" "icons/application/*/*keepassxc.svg") foreach(icon_match ${ICON_FILES}) get_filename_component(icon_name ${icon_match} NAME) get_filename_component(icon_dir ${icon_match} DIRECTORY) # Prefix all icons with application id: "org.keepassxc.KeePassXC" string(REGEX REPLACE "^keepassxc(.*)?(\\.png|\\.svg)$" "${APP_ID}\1\2" icon_name ${icon_name}) string(REGEX REPLACE "^(application-x-keepassxc\\.svg)$" "${APP_ID}-\1" icon_name ${icon_name}) # Find icon sub dir ex. "scalable/mimetypes/" file(RELATIVE_PATH icon_subdir ${CMAKE_CURRENT_SOURCE_DIR}/icons/application ${icon_dir}) install(FILES ${icon_match} DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/${icon_subdir} RENAME ${icon_name}) endforeach() ``` -------------------------------- ### Install Standard Icons Source: https://github.com/keepassxreboot/keepassxc/blob/develop/share/CMakeLists.txt Installs application icons for standard Linux installations, matching specific file patterns and excluding certain subdirectories. ```cmake install(DIRECTORY icons/application/ DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor FILES_MATCHING PATTERN "keepassx*.png" PATTERN "keepassx*.svg" PATTERN "status" EXCLUDE PATTERN "actions" EXCLUDE PATTERN "categories" EXCLUDE) install(DIRECTORY icons/application/ DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor FILES_MATCHING PATTERN "application-x-keepassxc.svg" PATTERN "status" EXCLUDE PATTERN "actions" EXCLUDE PATTERN "categories" EXCLUDE) ``` -------------------------------- ### Install Build Toolchain on Fedora/RHEL/CentOS Source: https://github.com/keepassxreboot/keepassxc/wiki/Set-up-Build-Environment-on-Linux Installs necessary build components including make, automake, gcc-c++, and cmake on Fedora, RHEL, or CentOS. ```bash sudo dnf install make automake gcc-c++ cmake rubygem-asciidoctor ``` -------------------------------- ### Test Asciidoctor Installation Source: https://github.com/keepassxreboot/keepassxc/wiki/Set-up-Build-Environment-on-Windows Verifies the Asciidoctor installation by running the command. This should be executed in the same command prompt where Asciidoctor was installed. ```bash asciidoctor ``` -------------------------------- ### Configure Linux Desktop and Policy Files Source: https://github.com/keepassxreboot/keepassxc/blob/develop/share/CMakeLists.txt Configures and installs the .desktop and .policy files for Linux systems. ```cmake configure_file(linux/${APP_ID}.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/linux/${APP_ID}.desktop @ONLY) configure_file(linux/${APP_ID}.policy.in ${CMAKE_CURRENT_BINARY_DIR}/linux/${APP_ID}.policy @ONLY) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/linux/${APP_ID}.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications) if("${CMAKE_SYSTEM}" MATCHES "Linux") install(FILES ${CMAKE_CURRENT_BINARY_DIR}/linux/${APP_ID}.policy DESTINATION ${CMAKE_INSTALL_DATADIR}/polkit-1/actions) endif() install(FILES linux/${APP_ID}.appdata.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo) ``` -------------------------------- ### Install Dependencies on Debian/Ubuntu Source: https://github.com/keepassxreboot/keepassxc/wiki/Set-up-Build-Environment-on-Linux Installs Qt6 base, SVG, tools, Botan, zlib, minizip, PCSC, keyutils, Xi, Xtst, and Qrencode development libraries. ```bash sudo apt install qt6-base-dev qt6-svg-dev qt6-tools-dev libusb-1.0-0-dev \ libbotan-3-dev zlib1g-dev libminizip-dev libpcsclite-dev libkeyutils-dev \ libxi-dev libxtst-dev libqrencode-dev ``` -------------------------------- ### Install LLVM on macOS Source: https://github.com/keepassxreboot/keepassxc/wiki/Generating-Test-Coverage-Statistics Installs LLVM on macOS. This command should already be executed if clang is installed, as it's a prerequisite for using clang. ```bash xcode-select --install ``` -------------------------------- ### Install Build Dependencies via Homebrew Source: https://github.com/keepassxreboot/keepassxc/wiki/Set-up-Build-Environment-on-macOS Install the necessary build dependencies for local builds using Homebrew. ```bash brew install qt argon2 botan qrencode readline minizip ``` -------------------------------- ### Wix Installer Specific Settings Source: https://github.com/keepassxreboot/keepassxc/blob/develop/src/CMakeLists.txt Configures WiX installer properties, including the upgrade GUID, product icon, UI banner and dialog bitmaps, UI reference, template file, patch file, and extra source files. ```cmake set(CPACK_WIX_UPGRADE_GUID 88785A72-3EAE-4F29-89E3-BC6B19BA9A5B) set(CPACK_WIX_PRODUCT_ICON "${CMAKE_SOURCE_DIR}/share/windows/keepassxc.ico") set(CPACK_WIX_UI_BANNER "${CMAKE_SOURCE_DIR}/share/windows/installer-banner.png") set(CPACK_WIX_UI_DIALOG "${CMAKE_SOURCE_DIR}/share/windows/installer-wizard.png") set(CPACK_WIX_UI_REF "KPXC_InstallDir") set(CPACK_WIX_TEMPLATE "${CMAKE_SOURCE_DIR}/share/windows/wix-template.xml") set(CPACK_WIX_PATCH_FILE "${CMAKE_SOURCE_DIR}/share/windows/wix-patch.xml") set(CPACK_WIX_EXTRA_SOURCES "${CMAKE_SOURCE_DIR}/share/windows/KPXC_InstallDir.wxs" "${CMAKE_SOURCE_DIR}/share/windows/KPXC_InstallDirDlg.wxs" "${CMAKE_SOURCE_DIR}/share/windows/KPXC_ExitDlg.wxs") ``` -------------------------------- ### Install Dependencies on Fedora/RHEL/CentOS Source: https://github.com/keepassxreboot/keepassxc/wiki/Set-up-Build-Environment-on-Linux Installs Qt6 base, SVG, tools, Botan3, minizip, PCSC, libusb, keyutils, Xi, Xtst, and Qrencode development packages. ```bash sudo dnf install qt6-qtbase-devel qt6-qtsvg-devel qt6-qttools-devel botan3-devel \ minizip-compat-devel pcsc-lite-devel libusb1-devel keyutils-libs-devel libXi-devel \ libXtst-devel qrencode-devel ``` -------------------------------- ### Define installation paths for Windows Source: https://github.com/keepassxreboot/keepassxc/blob/develop/CMakeLists.txt Sets installation directory variables for Windows builds. The program name is set to 'KeePassXC' and all installation directories are set to the current directory or 'share'. ```cmake set(PROGNAME KeePassXC) set(CLI_INSTALL_DIR ".") set(PROXY_INSTALL_DIR ".") set(BIN_INSTALL_DIR ".") set(PLUGIN_INSTALL_DIR ".") set(DATA_INSTALL_DIR "share") ``` -------------------------------- ### Install gcovr on Ubuntu Linux Source: https://github.com/keepassxreboot/keepassxc/wiki/Generating-Test-Coverage-Statistics Installs the gcovr tool on Ubuntu Linux for generating coverage profiles. This is a prerequisite for coverage reporting. ```bash sudo apt install gcovr ``` -------------------------------- ### NSIS Installer UI and Display Settings Source: https://github.com/keepassxreboot/keepassxc/blob/develop/src/CMakeLists.txt Sets the URL for 'About' information, the display name, and the package name for the NSIS installer. ```cmake set(CPACK_NSIS_URL_INFO_ABOUT "https://keepassxc.org") set(CPACK_NSIS_DISPLAY_NAME ${PROGNAME}) set(CPACK_NSIS_PACKAGE_NAME "${PROGNAME} v${KEEPASSXC_VERSION}") set(CPACK_NSIS_MUI_FINISHPAGE_RUN "../${PROGNAME}.exe") ``` -------------------------------- ### Install Dependencies on Ubuntu 22 LTS (Jammy) Source: https://github.com/keepassxreboot/keepassxc/wiki/Set-up-Build-Environment-on-Linux Ensures specific versions of Botan, Qt6, and readline development libraries are installed for Ubuntu 22 LTS. ```bash sudo apt install libbotan-2-dev qt6-base-dev qt6-base-private-dev qt6-tools-dev \ qt6-base-dev-tools qt6-tools-dev-tools qt6-l10n-tools libqt6svg6-dev \ libreadline-dev ``` -------------------------------- ### Copy License File for Installer Source: https://github.com/keepassxreboot/keepassxc/blob/develop/src/CMakeLists.txt Copies the LICENSE.GPL-2 file from the source directory to the build directory, renaming it to INSTALLER_LICENSE.txt. This is required by WiX for the installer. ```cmake execute_process(COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/LICENSE.GPL-2" "${CMAKE_CURRENT_BINARY_DIR}/INSTALLER_LICENSE.txt") ``` -------------------------------- ### Define installation paths for other platforms Source: https://github.com/keepassxreboot/keepassxc/blob/develop/CMakeLists.txt Includes standard GNU installation directories and sets installation paths for executables, libraries, and data files for non-Windows and non-macOS bundle builds. The program name is set to 'keepassxc'. ```cmake include(GNUInstallDirs) set(PROGNAME keepassxc) set(CLI_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}") set(PROXY_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}") set(BIN_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}") set(PLUGIN_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/keepassxc") set(DATA_INSTALL_DIR "${CMAKE_INSTALL_DATADIR}/keepassxc") ``` -------------------------------- ### Install LLVM on Ubuntu Linux Source: https://github.com/keepassxreboot/keepassxc/wiki/Generating-Test-Coverage-Statistics Installs the LLVM compiler infrastructure on Ubuntu Linux. This is required when using clang as the compiler. ```bash sudo apt install llvm ``` -------------------------------- ### Install Dependencies on Arch Linux Source: https://github.com/keepassxreboot/keepassxc/wiki/Set-up-Build-Environment-on-Linux Installs Qt6 base, tools, SVG, Argon2, Botan, Qrencode, zlib, readline, keyutils, PCSC, libusb, libXi, libXtst, and minizip packages. ```bash sudo pacman -S qt6-base qt6-tools qt6-svg argon2 botan qrencode zlib readline \ keyutils pcsclite libusb libxi libxtst minizip ``` -------------------------------- ### Prepare and Set Post-Install Script Source: https://github.com/keepassxreboot/keepassxc/blob/develop/src/CMakeLists.txt Configures a Windows codesigning script and sets it to run before and after the CPack installers are built. ```cmake configure_file("${CMAKE_SOURCE_DIR}/cmake/WindowsCodesign.cmake.in" "${CMAKE_BINARY_DIR}/WindowsCodesign.cmake" @ONLY) set(CPACK_PRE_BUILD_SCRIPTS "${CMAKE_BINARY_DIR}/WindowsCodesign.cmake") set(CPACK_POST_BUILD_SCRIPTS "${CMAKE_BINARY_DIR}/WindowsCodesign.cmake") ``` -------------------------------- ### Install Build Toolchain on Debian/Ubuntu Source: https://github.com/keepassxreboot/keepassxc/wiki/Set-up-Build-Environment-on-Linux Installs essential build tools like g++, cmake, and make on Debian or Ubuntu systems. ```bash sudo apt install build-essential cmake g++ asciidoctor ``` -------------------------------- ### NSIS Installer Specific Settings Source: https://github.com/keepassxreboot/keepassxc/blob/develop/src/CMakeLists.txt Configures NSIS installer options such as enabling uninstall before install, setting icons, welcome/finish page bitmaps, and creating/deleting shortcuts. ```cmake set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON) set(CPACK_NSIS_MUI_ICON "${CMAKE_SOURCE_DIR}/share/windows/keepassxc.ico") set(CPACK_NSIS_MUI_UNIICON "${CPACK_NSIS_MUI_ICON}") set(CPACK_NSIS_INSTALLED_ICON_NAME "\\${PROGNAME}.exe") set(CPACK_NSIS_MUI_WELCOMEFINISHPAGE_BITMAP "${CMAKE_SOURCE_DIR}/share/windows/installer-wizard.png") set(CPACK_NSIS_MUI_UNWELCOMEFINISHPAGE_BITMAP "${CMAKE_SOURCE_DIR}/share/windows/installer-wizard.png") set(CPACK_NSIS_CREATE_ICONS_EXTRA "CreateShortCut '$SMPROGRAMS\\$STARTMENU_FOLDER\\${PROGNAME}.lnk' '$INSTDIR\\${PROGNAME}.exe'") set(CPACK_NSIS_DELETE_ICONS_EXTRA "Delete '$SMPROGRAMS\\$START_MENU\\${PROGNAME}.lnk'") ``` -------------------------------- ### Install MSYS2 C++ Toolchain and Utilities Source: https://github.com/keepassxreboot/keepassxc/wiki/Set-up-Build-Environment-on-Windows Installs the MinGW-W64 GCC compiler, CMake, Binutils, and Asciidoctor within the MSYS2 environment. This command uses pacman to install the specified toolchain components for the current architecture. ```bash 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 ``` -------------------------------- ### Build and Install KeePassXC on Linux Source: https://github.com/keepassxreboot/keepassxc/wiki/Building-KeePassXC Commands to build and install KeePassXC after setting up the environment and downloading sources. Includes options for running tests. ```bash mkdir build cd build cmake -DWITH_XC_ALL=ON -DCMAKE_BUILD_TYPE=Release .. make -j8 sudo make install ``` -------------------------------- ### Install gcovr on macOS Source: https://github.com/keepassxreboot/keepassxc/wiki/Generating-Test-Coverage-Statistics Installs the gcovr tool on macOS using Homebrew. This is a prerequisite for generating coverage reports. ```bash brew install gcovr ``` -------------------------------- ### Install Build Toolchain on Arch Linux Source: https://github.com/keepassxreboot/keepassxc/wiki/Set-up-Build-Environment-on-Linux Installs cmake, make, gcc, and asciidoctor on Arch Linux. Use gcc-multilib for 32-bit compatibility if needed. ```bash sudo pacman -S cmake make gcc asciidoctor ``` ```bash sudo pacman -S cmake make gcc-multilib asciidoctor ``` -------------------------------- ### macOS Cocoa and Menu Nib Installation Source: https://github.com/keepassxreboot/keepassxc/blob/develop/src/CMakeLists.txt Installs the qt_menu.nib file if Cocoa is used on macOS and the file exists. This is part of the macOS bundle configuration. ```cmake if(QT_MAC_USE_COCOA AND EXISTS "${QT_LIBRARY_DIR}/Resources/qt_menu.nib") install(DIRECTORY "${QT_LIBRARY_DIR}/Resources/qt_menu.nib" DESTINATION "${DATA_INSTALL_DIR}") endif() ``` -------------------------------- ### Example CMake Build Command Source: https://github.com/keepassxreboot/keepassxc/wiki/Building-KeePassXC Use this command to configure the build with specific options like enabling Auto-Type and disabling networking. Adjust options as needed for your build. ```cmake cmake -DWITH_XC_AUTOTYPE=ON -DWITH_XC_NETWORKING=OFF -DWITH_XC_KEESHARE=ON .. ``` -------------------------------- ### Get help for release-tool.py Source: https://github.com/keepassxreboot/keepassxc/wiki/Building-KeePassXC Display help information for the KeePassXC Python release tool. ```python python release-tool.py ``` -------------------------------- ### Install CA Certificate Bundle Source: https://github.com/keepassxreboot/keepassxc/blob/develop/src/CMakeLists.txt Installs a local CA certificate bundle or downloads one if not found. Ensures secure network connections. ```cmake find_file(SSL_CA_BUNDLE ca-bundle.crt PATHS "${Qt6_PREFIX}/ssl/certs") if(SSL_CA_BUNDLE) install(FILES ${SSL_CA_BUNDLE} DESTINATION "ssl/certs") else() file(DOWNLOAD "https://curl.se/ca/cacert.pem" "${CMAKE_BINARY_DIR}/ca-bundle.crt" TLS_VERIFY ON) install(FILES "${CMAKE_BINARY_DIR}/ca-bundle.crt" DESTINATION "ssl/certs") endif() ``` -------------------------------- ### Configure Standard Desktop Entry Source: https://github.com/keepassxreboot/keepassxc/blob/develop/share/CMakeLists.txt Configures the standard desktop entry file for non-Flatpak Linux installations. ```cmake set(APP_ICON_NAME "keepassxc") set(MIME_ICON "application-x-keepassxc") configure_file(linux/keepassxc.xml.in ${CMAKE_CURRENT_BINARY_DIR}/linux/keepassxc.xml @ONLY) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/linux/keepassxc.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/mime/packages) ``` -------------------------------- ### Backup Path Example Source: https://github.com/keepassxreboot/keepassxc/blob/develop/docs/topics/Reference.adoc Illustrates how backup path placeholders can be used to create uniquely named backup files with date and time stamps. ```plaintext `{DB_FILENAME}-{TIME}.bak.kdbx` ``` ```plaintext `backups\{DB_FILENAME}.bak.kdbx` ``` ```plaintext `C:\Backups\{TIME:dd.MM.yyyy}\\{DB_FILENAME}.kdbx` ``` -------------------------------- ### Install LLVM on MSYS2 Source: https://github.com/keepassxreboot/keepassxc/wiki/Generating-Test-Coverage-Statistics Installs the LLVM package for MSYS2. This is necessary for using clang as the compiler on Windows via MSYS2. ```bash pacman -Su mingw-w64-x86_64-llvm ``` -------------------------------- ### Find and Install OpenSSL DLLs Source: https://github.com/keepassxreboot/keepassxc/blob/develop/src/CMakeLists.txt Locates and installs OpenSSL DLLs if the network feature is enabled. Fails the build if DLLs are not found. ```cmake if(KPXC_FEATURE_NETWORK) find_file(OPENSSL_DLL NAMES libssl-3.dll libssl-3-x64.dll HINTS "${OPENSSL_ROOT_DIR}/bin" ) if (NOT OPENSSL_DLL) message(FATAL_ERROR "Cannot find libssl dll, ensure openssl is properly installed.") endif() find_file(CRYPTO_DLL NAMES libcrypto-3.dll libcrypto-3-x64.dll HINTS "${OPENSSL_ROOT_DIR}/bin" ) if (NOT CRYPTO_DLL) message(FATAL_ERROR "Cannot find libcrypto dll, ensure openssl is properly installed.") endif() install(FILES ${OPENSSL_DLL} ${CRYPTO_DLL} DESTINATION ".") endif() ``` -------------------------------- ### Install Qt Dependencies using windeployqt Source: https://github.com/keepassxreboot/keepassxc/blob/develop/src/CMakeLists.txt Installs Qt runtime dependencies for the KeePassXC executable using windeployqt. This is done as a Runtime component and checks for the success of the windeployqt execution. ```cmake install(CODE " if(\"\ ${CMAKE_INSTALL_CONFIG_NAME}\" STREQUAL \"Debug\") set(_wdqt_mode --debug) else() set(_wdqt_mode --release) endif() execute_process( COMMAND ${WINDEPLOYQT_EXE} ${PROGNAME}.exe ${_wdqt_mode} WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX} OUTPUT_QUIET RESULT_VARIABLE _wdqt_result ) if(NOT ${_wdqt_result} EQUAL 0) message(FATAL_ERROR \"windeployqt failed with exit code ${_wdqt_result}\") endif()") COMPONENT Runtime) ``` -------------------------------- ### Wildcard URL Examples for Browser Integration Source: https://github.com/keepassxreboot/keepassxc/blob/develop/docs/topics/BrowserIntegration.adoc Demonstrates how to use wildcards in URLs for advanced browser integration settings in KeePassXC. Supports patterns for domain, path, and subdomains. ```plaintext https://*.example.com https://example.com/*/path https://sub.*.example.com/path/* ``` -------------------------------- ### Install CLI Executable Source: https://github.com/keepassxreboot/keepassxc/blob/develop/src/cli/CMakeLists.txt Installs the 'keepassxc-cli' executable to a specified directory. This command is used to deploy the CLI application to the user's system. ```cmake install(TARGETS keepassxc-cli BUNDLE DESTINATION . COMPONENT Runtime RUNTIME DESTINATION ${CLI_INSTALL_DIR} COMPONENT Runtime) ``` -------------------------------- ### Install AFL Fuzzer Source: https://github.com/keepassxreboot/keepassxc/blob/develop/utils/fuzz-testing/README.md Installs the American Fuzzy Lop (AFL) fuzz testing tool using apt. Alternatively, AFL can be built from source. ```bash sudo apt install afl ``` ```bash git clone https://github.com/google/AFL cd AFL make make install ``` -------------------------------- ### Get help for release-tool.py subcommand Source: https://github.com/keepassxreboot/keepassxc/wiki/Building-KeePassXC Display help for a specific subcommand of the KeePassXC Python release tool. ```python python release-tool.py -h ``` -------------------------------- ### NSIS Extra Pre/Uninstallation Commands Source: https://github.com/keepassxreboot/keepassxc/blob/develop/src/CMakeLists.txt Defines commands to be executed before installation (taskkill) and during uninstallation (taskkill). This ensures the application is not running during these operations. ```cmake set(CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS "ExecWait 'Taskkill /IM KeePassXC.exe'") set(CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS "${CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS}\nExecWait 'Taskkill /IM keepassxc-proxy.exe /F'") set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "ExecWait 'Taskkill /IM KeePassXC.exe'") set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS}\nExecWait 'Taskkill /IM keepassxc-proxy.exe /F'") ``` -------------------------------- ### Wix Installer Properties and Extensions Source: https://github.com/keepassxreboot/keepassxc/blob/develop/src/CMakeLists.txt Sets WiX installer properties, specifically ARPURLINFOABOUT for the Add/Remove Programs entry, and specifies the WiXUtilExtension for additional utilities. ```cmake set(CPACK_WIX_PROPERTY_ARPURLINFOABOUT "https://keepassxc.org") set(CPACK_WIX_EXTENSIONS "WixUtilExtension.dll") ``` -------------------------------- ### Start SSH Agent Service on Windows Source: https://github.com/keepassxreboot/keepassxc/blob/develop/docs/topics/SSHAgent.adoc Use this command to start the ssh-agent service on Windows. This allows KeePassXC and other compatible tools to use the Windows OpenSSH agent. ```powershell Start-Service ssh-agent ``` -------------------------------- ### Find and Link QREncode Library Source: https://github.com/keepassxreboot/keepassxc/blob/develop/src/qrcode/CMakeLists.txt Finds the QREncode library and makes it available for the qrcode target. Ensure QREncode is installed on the system. ```cmake find_package(QREncode REQUIRED) ``` -------------------------------- ### Define installation paths for macOS App Bundle Source: https://github.com/keepassxreboot/keepassxc/blob/develop/CMakeLists.txt Configures installation paths for macOS builds when creating an application bundle. It sets the program name, bundle contents directories, and defines locations for man pages, executables, plugins, and data. ```cmake set(PROGNAME KeePassXC) set(BUNDLE_INSTALL_DIR "${PROGNAME}.app/Contents") set(CMAKE_INSTALL_MANDIR "${BUNDLE_INSTALL_DIR}/Resources/man") set(CLI_INSTALL_DIR "${BUNDLE_INSTALL_DIR}/MacOS") set(PROXY_INSTALL_DIR "${BUNDLE_INSTALL_DIR}/MacOS") set(BIN_INSTALL_DIR "${BUNDLE_INSTALL_DIR}/MacOS") set(PLUGIN_INSTALL_DIR "${BUNDLE_INSTALL_DIR}/PlugIns") set(DATA_INSTALL_DIR "${BUNDLE_INSTALL_DIR}/Resources") add_definitions(-DWITH_APP_BUNDLE) ``` -------------------------------- ### Install MSYS2 Required Dependencies Source: https://github.com/keepassxreboot/keepassxc/wiki/Set-up-Build-Environment-on-Windows Installs essential libraries for building KeePassXC within the MSYS2 environment, including Qt6, libbotan, zlib, argon2, and qrencode. ```bash pacman -S mingw-w64-$(uname -m)-qt6 \ mingw-w64-$(uname -m)-libbotan mingw-w64-$(uname -m)-zlib \ mingw-w64-$(uname -m)-argon2 mingw-w64-$(uname -m)-qrencode ``` -------------------------------- ### Build KeePassXC CR Recovery Tool Source: https://github.com/keepassxreboot/keepassxc/blob/develop/utils/keepassxc-cr-recovery/README.md Build the tool using Go 1.13. Ensure Go is installed and then run the build command. ```shell go build ``` -------------------------------- ### Set up vcpkg Source: https://github.com/keepassxreboot/keepassxc/wiki/Set-up-Build-Environment-on-macOS Clone the vcpkg repository and run the bootstrap script to set up the vcpkg dependency manager. ```bash git clone https://github.com/Microsoft/vcpkg.git && ./vcpkg/bootstrap-vcpkg.sh ``` -------------------------------- ### Show build subcommand help Source: https://github.com/keepassxreboot/keepassxc/wiki/Building-KeePassXC Displays detailed help information for the 'build' subcommand, outlining all available options and arguments. ```bash $ python release-tool.py build -h KeePassXC Release Preparation Tool Copyright (C) 2016-2025 KeePassXC Team usage: release-tool.py build [-h] [-s SRC_DIR] [-t TAG_NAME] [-o OUTPUT_DIR] [-g CMAKE_GENERATOR] [-i INSTALL_PREFIX] [--snapshot] [--use-system-deps] [-j PARALLELISM] [-y] [--with-tests] [-p {amd64,arm64}] [--sign] [--sign-cert SIGN_CERT] [-c ...] version positional arguments: version Release version number or name. options: -h, --help show this help message and exit -s, --src-dir SRC_DIR Source directory. -t, --tag-name TAG_NAME Name of the tag to check out (default: same as version). -o, --output-dir OUTPUT_DIR Build output directory (default: release. -g, --cmake-generator CMAKE_GENERATOR Override default CMake generator. -i, --install-prefix INSTALL_PREFIX Build install prefix (default: /usr/local). --snapshot Build snapshot from current HEAD. --use-system-deps Use system dependencies instead of vcpkg. -j, --parallelism PARALLELISM Build parallelism (default: 22). -y, --yes Bypass confirmation prompts. --with-tests Build and run tests. -p, --platform-target {amd64,arm64} Build target platform (default: amd64). --sign Sign binaries prior to packaging. --sign-cert SIGN_CERT SHA1 fingerprint of the signing certificate (optional). -c, --cmake-opts ... Additional CMake options (no other arguments can be specified after this). ``` -------------------------------- ### Configure Flatpak Desktop Entry Source: https://github.com/keepassxreboot/keepassxc/blob/develop/share/CMakeLists.txt Configures the desktop entry file for Flatpak installations, ensuring the application ID is used for naming icons and other resources. ```cmake set(APP_ICON_NAME "${APP_ID}") set(MIME_ICON "${APP_ID}-application-x-keepassxc") configure_file(linux/keepassxc.xml.in ${CMAKE_CURRENT_BINARY_DIR}/linux/${APP_ID}.xml @ONLY) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/linux/${APP_ID}.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/mime/packages) ``` -------------------------------- ### CPack Installer Configuration Source: https://github.com/keepassxreboot/keepassxc/blob/develop/src/CMakeLists.txt Sets various CPack generator and package properties, including the generator type, stripping files, package name, vendor, and license file. ```cmake set(CPACK_GENERATOR "ZIP;WIX") set(CPACK_COMPONENTS_ALL "") set(CPACK_STRIP_FILES OFF) set(CPACK_PACKAGE_FILE_NAME "${PROGNAME}-${KEEPASSXC_VERSION}-${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}") set(CPACK_PACKAGE_INSTALL_DIRECTORY ${PROGNAME}) set(CPACK_PACKAGE_VERSION ${KEEPASSXC_VERSION_CLEAN}) set(CPACK_PACKAGE_VENDOR "${PROGNAME} Team") set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_BINARY_DIR}/INSTALLER_LICENSE.txt") ``` -------------------------------- ### Add Post-Installation Subdirectory Source: https://github.com/keepassxreboot/keepassxc/blob/develop/src/CMakeLists.txt Includes a subdirectory for post-installation commands, essential for macdeployqt compatibility. ```cmake add_subdirectory(post_install) ``` -------------------------------- ### Install Asciidoctor using Ruby Gem Source: https://github.com/keepassxreboot/keepassxc/wiki/Set-up-Build-Environment-on-Windows Installs the Asciidoctor tool using Ruby's gem package manager. This command is run in a command prompt after Ruby is installed. ```bash gem install asciidoctor ``` -------------------------------- ### Build Windows Binaries Source: https://github.com/keepassxreboot/keepassxc/wiki/Release-Checklist Build signed amd64 and arm64 binaries for Windows. Replace {ID} with your signing identity. ```shell ./release-tool build {VERSION} --sign --sign-identity {ID} --platform-target [arm64|amd64] ``` -------------------------------- ### Build Source Bundle Source: https://github.com/keepassxreboot/keepassxc/wiki/Release-Checklist Build the source code bundle for the release. ```shell ./release-tool build-src {VERSION} ``` -------------------------------- ### Build AppImage for Linux Source: https://github.com/keepassxreboot/keepassxc/wiki/Release-Checklist Build an amd64 AppImage binary for Linux using a specified Docker image. Ensure the Docker image is pulled before building. ```shell docker pull ghcr.io/keepassxreboot/keepassxc-ci-docker:focal-qt5.12 ./release-tool build {VERSION} --appimage \ --docker-image ghcr.io/keepassxreboot/keepassxc-ci-docker:focal-qt5.12 ``` -------------------------------- ### GPG Sign Release Files Source: https://github.com/keepassxreboot/keepassxc/wiki/Release-Checklist Sign the built binaries and source bundle using GPG. Replace {FILES...} with the actual file paths. ```shell ./release-tool gpgsign {FILES...} ``` -------------------------------- ### Open KeePassXC Database (With Password and Key File) Source: https://github.com/keepassxreboot/keepassxc/wiki/Using-DBus-with-KeePassXC Opens a KeePassXC database using both a password and a key file. Specify the correct paths for both. ```bash qdbus org.keepassxc.KeePassXC.MainWindow /keepassxc org.keepassxc.KeePassXC.MainWindow.openDatabase /path/to/database.kdbx passwd /path/to/key ``` -------------------------------- ### Enable and Start OpenSSH Authentication Agent (Windows) Source: https://github.com/keepassxreboot/keepassxc/blob/develop/docs/topics/SSHAgent.adoc This PowerShell command enables and starts the OpenSSH Authentication Agent service on Windows. Ensure you are running PowerShell as an Administrator. ```powershell Get-Service ssh-agent | Set-Service -StartupType Automatic ``` -------------------------------- ### Create Static qrcode Library Source: https://github.com/keepassxreboot/keepassxc/blob/develop/src/qrcode/CMakeLists.txt Creates a static library named 'qrcode' using the defined source files. This library can then be linked by other targets. ```cmake add_library(qrcode STATIC ${qrcode_SOURCES}) ``` -------------------------------- ### Install gcovr and Python 3 pip on MSYS2 Source: https://github.com/keepassxreboot/keepassxc/wiki/Generating-Test-Coverage-Statistics Installs Python 3 pip and the gcovr tool on MSYS2. This is required for coverage profile generation on Windows using MSYS2. ```bash pacman -Su python3-pip && pip3 install gcovr ``` -------------------------------- ### Unattended Windows Installation of KeePassXC Source: https://github.com/keepassxreboot/keepassxc/blob/develop/docs/topics/DownloadInstall.adoc Use this command to perform an unattended installation of KeePassXC on Windows, disabling the auto-start on login feature. Ensure the MSI file name and path are correct. ```bash msiexec.exe /q /i KeePassXC-Y.Y.Y-WinZZ.msi AUTOSTARTPROGRAM=0 ``` -------------------------------- ### Conditional macdeployqt Execution for macOS Bundling Source: https://github.com/keepassxreboot/keepassxc/blob/develop/src/post_install/CMakeLists.txt This CMake script snippet conditionally executes the macdeployqt tool during the installation phase on macOS. It ensures that macdeployqt is run after all install commands have completed, which is necessary for correct functioning of the tool. It utilizes custom CMake functions to manage the process. ```cmake if(APPLE AND WITH_APP_BUNDLE) # Run macdeloyqt on the main app and any extra binaries and plugins as specified by the # _MACDEPLOYQT_EXTRA_BINARIES global property. # All install(TARGETS) calls should have already been called. get_property(MACDEPLOYQT_EXTRA_BINARIES GLOBAL PROPERTY _MACDEPLOYQT_EXTRA_BINARIES) kpxc_run_macdeployqt_at_install_time( APP_NAME "${PROGNAME}" EXTRA_BINARIES ${MACDEPLOYQT_EXTRA_BINARIES} ) endif() ``` -------------------------------- ### Checkout Latest Tag and Build Source: https://github.com/keepassxreboot/keepassxc/blob/develop/INSTALL.md Checkout the latest stable tag and then configure and build KeePassXC using CMake. ```bash git checkout latest cmake -B ./build cmake --build ./build ``` -------------------------------- ### Define Proxy Executable and Link Libraries Source: https://github.com/keepassxreboot/keepassxc/blob/develop/src/proxy/CMakeLists.txt Defines the main proxy executable and links it against necessary libraries like Qt Core and Network, as well as a custom static library for memory allocation. ```cmake set(proxy_SOURCES ../browser/BrowserShared.cpp keepassxc-proxy.cpp NativeMessagingProxy.cpp) # Alloc must be defined in a static library to prevent clashing with clang ASAN definitions add_library(proxy_alloc STATIC ../core/Alloc.cpp) target_link_libraries(proxy_alloc PRIVATE Qt6::Core ${BOTAN_LIBRARIES}) add_executable(keepassxc-proxy ${proxy_SOURCES}) target_link_libraries(keepassxc-proxy proxy_alloc Qt6::Core Qt6::Network) ``` -------------------------------- ### Update System on Arch Linux Source: https://github.com/keepassxreboot/keepassxc/wiki/Set-up-Build-Environment-on-Linux Synchronizes package databases and upgrades all installed packages on Arch Linux. ```bash sudo pacman -Syyuu ``` -------------------------------- ### Prepare Fuzzer Input Files Source: https://github.com/keepassxreboot/keepassxc/blob/develop/utils/fuzz-testing/README.md Copies empty database files to the fuzzer's input directory. These files will be mutated by the fuzzer to find crashes. ```bash cd buildafl mkdir -p findings/testcases cp ../utils/fuzz-testing/empty*.kdbx findings/testcases ``` -------------------------------- ### Update System on Debian/Ubuntu Source: https://github.com/keepassxreboot/keepassxc/wiki/Set-up-Build-Environment-on-Linux Updates package lists and upgrades installed packages on Debian or Ubuntu systems. ```bash sudo apt-get update && sudo apt-get upgrade ``` -------------------------------- ### Create KeeShare Static Library Source: https://github.com/keepassxreboot/keepassxc/blob/develop/src/keeshare/CMakeLists.txt Creates a static library named 'keeshare' using the defined source files. ```cmake add_library(keeshare STATIC ${keeshare_SOURCES}) ``` -------------------------------- ### Define qrcode Source Files Source: https://github.com/keepassxreboot/keepassxc/blob/develop/src/qrcode/CMakeLists.txt Lists the C++ source files for the qrcode library. ```cmake set(qrcode_SOURCES QrCode.cpp ) ``` -------------------------------- ### Include CPACK Module Source: https://github.com/keepassxreboot/keepassxc/blob/develop/src/CMakeLists.txt Includes the CPACK module, which processes all the defined CPack variables and generates the installer packages. ```cmake include(CPack) ``` -------------------------------- ### Use KeePassXC CR Recovery Tool Source: https://github.com/keepassxreboot/keepassxc/blob/develop/utils/keepassxc-cr-recovery/README.md Run the recovery tool with the path to your password database and the desired path for the new keyfile. You will be prompted for your challenge-response secret. ```shell keepass-cr-recovery path-to-your-password-database path-of-the-new-keyfile ``` -------------------------------- ### Open KeePassXC Database (With Password) Source: https://github.com/keepassxreboot/keepassxc/wiki/Using-DBus-with-KeePassXC Opens a KeePassXC database using a password but no key file. Provide the correct database path and password. ```bash qdbus org.keepassxc.KeePassXC.MainWindow /keepassxc org.keepassxc.KeePassXC.MainWindow.openDatabase /path/to/database.kdbx passwd ``` -------------------------------- ### Specify Qt5 path on macOS Source: https://github.com/keepassxreboot/keepassxc/wiki/Building-KeePassXC If CMake cannot find your Qt5 installation on macOS, add this parameter to the cmake command. ```bash -DCMAKE_PREFIX_PATH=$(brew --prefix qt5)/lib/cmake ``` -------------------------------- ### Run KeePassXC from Build Directory Source: https://github.com/keepassxreboot/keepassxc/wiki/Building-KeePassXC Execute KeePassXC directly from the build directory without performing a system-wide installation. ```bash ./src/keepassxc ```