From 8d75f11a67d620727b87ef3a00d61a6f92418817 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Tue, 30 Apr 2013 00:29:47 +0200 Subject: [PATCH] MDEV-4458 - Windows installer does not launch upgrade wizard anymore, even if there are upgradable instances (i.e windows service of lower MariaDB/MySQL version) The main reason for he error is misplaced ADD_DIRECTORY in top-level CMakeLists.txt. ADD_DIRECTORY(win/packaging) was places before win/upgrade_wizard, and MSI was not able to detect that upgrade wizard was built, and thus excluded upgrade wizard entirely. --- CMakeLists.txt | 2 +- win/packaging/ca/CustomAction.cpp | 2 +- win/packaging/extra.wxs.in | 11 +++++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9b8d52feedb..1bae7e81f5a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -329,8 +329,8 @@ INCLUDE(cmake/abi_check.cmake) INCLUDE(cmake/tags.cmake) IF(WIN32) - ADD_SUBDIRECTORY(win/packaging) ADD_SUBDIRECTORY(win/upgrade_wizard) + ADD_SUBDIRECTORY(win/packaging) ENDIF() CONFIGURE_FILE(config.h.cmake ${CMAKE_BINARY_DIR}/include/my_config.h) diff --git a/win/packaging/ca/CustomAction.cpp b/win/packaging/ca/CustomAction.cpp index 50b39adc0b1..67a17c2cc19 100644 --- a/win/packaging/ca/CustomAction.cpp +++ b/win/packaging/ca/CustomAction.cpp @@ -895,7 +895,7 @@ extern "C" UINT __stdcall CheckServiceUpgrades(MSIHANDLE hInstall) Only look for services that have mysqld.exe outside of the current installation directory. */ - if(strstr(props.mysqld_exe,installDir) == 0) + if(installDir[0] == 0 || strstr(props.mysqld_exe,installDir) == 0) { WcaLog(LOGMSG_STANDARD, "found service %S, major=%d, minor=%d", info[i].lpServiceName, props.version_major, props.version_minor); diff --git a/win/packaging/extra.wxs.in b/win/packaging/extra.wxs.in index ff1a529a2ee..e0a36ef2e41 100644 --- a/win/packaging/extra.wxs.in +++ b/win/packaging/extra.wxs.in @@ -151,6 +151,9 @@ CreateOrUpgradeChoice = "Upgrade" CreateOrUpgradeChoice = "Create" + CreateOrUpgradeChoice = "Create" + CreateOrUpgradeChoice = "Create" + CreateOrUpgradeChoice = "Upgrade" 1 @@ -823,7 +826,7 @@ - + - $C.bin.mysql_upgrade_wizard.exe = 3 AND NOT Installed + $C.bin.mysql_upgrade_wizard.exe = 3 AND NOT Installed AND NOT OLDERVERSIONBEINGUPGRADED - 3) AND NOT Installed]]> + 3) AND NOT Installed OR OLDERVERSIONBEINGUPGRADED]]> - 3) AND NOT Installed]]> + 3) AND NOT Installed OR OLDERVERSIONBEINGUPGRADED]]>