From 5729d89cd511b1a894661518137ee714cf7aecf2 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Wed, 4 Jun 2025 09:46:06 +0200 Subject: [PATCH] MDEV-36938 Fix MSI install failure when ADDLOCAL omits required runtime Since 10.11.12 (commit 8363d05f4df8b5c787), executables are built with the dynamic C runtime (/MD), introducing a dependency on vcruntime140.dll. VC++ runtime is typically installed via the VCCRT feature, which is included by default as part of the hidden/default ALWAYSINSTALL feature set. However, when users specify the ADDLOCAL property, it overrides the default selection and may omit critical features like VCCRT. This leads to installation failures. Fix: Add a custom action that ensures mandatory features (e.g., VCCRT) are appended to the ADDLOCAL property at install time. This guarantees essential runtime components are always installed, even when a custom feature set is selected. --- win/packaging/create_msi.cmake | 5 +++++ win/packaging/extra.wxs.in | 15 +++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/win/packaging/create_msi.cmake b/win/packaging/create_msi.cmake index 57262e10d7d..20b139cf5d1 100644 --- a/win/packaging/create_msi.cmake +++ b/win/packaging/create_msi.cmake @@ -357,6 +357,11 @@ SET(CPACK_WIX_INCLUDES ) ENDFOREACH() +LIST(LENGTH WIX_FEATURE_AlwaysInstall_COMPONENTS len) +IF (len LESS_EQUAL 0) + MESSAGE(FATAL_ERROR "AlwaysInstall_COMPONENTS is empty") +ENDIF() +LIST(JOIN WIX_FEATURE_AlwaysInstall_COMPONENTS "," MANDATORY_FEATURES) CONFIGURE_FILE(${SRCDIR}/mysql_server.wxs.in ${CMAKE_CURRENT_BINARY_DIR}/mysql_server.wxs) diff --git a/win/packaging/extra.wxs.in b/win/packaging/extra.wxs.in index 056a7ec43ab..584f1e6921b 100644 --- a/win/packaging/extra.wxs.in +++ b/win/packaging/extra.wxs.in @@ -63,6 +63,21 @@ + + + + ADDLOCAL + + + ADDLOCAL +