Skip to content

Commit 5729d89

Browse files
committed
MDEV-36938 Fix MSI install failure when ADDLOCAL omits required runtime
Since 10.11.12 (commit 8363d05), 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.
1 parent 5a67329 commit 5729d89

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

win/packaging/create_msi.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,11 @@ SET(CPACK_WIX_INCLUDES
357357
)
358358
ENDFOREACH()
359359

360+
LIST(LENGTH WIX_FEATURE_AlwaysInstall_COMPONENTS len)
361+
IF (len LESS_EQUAL 0)
362+
MESSAGE(FATAL_ERROR "AlwaysInstall_COMPONENTS is empty")
363+
ENDIF()
364+
LIST(JOIN WIX_FEATURE_AlwaysInstall_COMPONENTS "," MANDATORY_FEATURES)
360365

361366
CONFIGURE_FILE(${SRCDIR}/mysql_server.wxs.in
362367
${CMAKE_CURRENT_BINARY_DIR}/mysql_server.wxs)

win/packaging/extra.wxs.in

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,21 @@
6363
<CustomAction Id="LaunchUrl" BinaryKey="WixCA" DllEntry="WixShellExec" Execute="immediate" Return="check" Impersonate="yes" />
6464

6565

66+
<!--
67+
When msiexec /i ADDLOCAL=<feature_list> is used, usually only features in
68+
the <feature_list> are installed. owever there are things we always want to
69+
be there, there is ALWAYSINSTALL feature id, hidden in UI for that.
70+
Modify ADDLOCAL list by adding mandatory features.
71+
-->
72+
<CustomAction Id="ForceAddMandatoryFeatures"
73+
Property="ADDLOCAL"
74+
Value="[ADDLOCAL],@MANDATORY_FEATURES@"/>
75+
<InstallUISequence>
76+
<Custom Action="ForceAddMandatoryFeatures" Before="CostFinalize">ADDLOCAL</Custom>
77+
</InstallUISequence>
78+
<InstallExecuteSequence>
79+
<Custom Action="ForceAddMandatoryFeatures" Before="CostFinalize">ADDLOCAL</Custom>
80+
</InstallExecuteSequence>
6681

6782
<!--
6883
User interface dialogs

0 commit comments

Comments
 (0)