summaryrefslogtreecommitdiff
path: root/win
diff options
context:
space:
mode:
Diffstat (limited to 'win')
-rw-r--r--win/create_def_file.js5
-rw-r--r--win/packaging/CMakeLists.txt75
-rw-r--r--win/packaging/ca/CustomAction.cpp78
-rw-r--r--win/packaging/create_msi.cmake (renamed from win/packaging/create_msi.cmake.in)55
-rw-r--r--win/packaging/extra.wxs.in20
-rw-r--r--win/packaging/heidisql.cmake10
-rw-r--r--win/upgrade_wizard/CMakeLists.txt10
-rw-r--r--win/upgrade_wizard/stdafx.h2
-rw-r--r--win/upgrade_wizard/upgradeDlg.cpp27
9 files changed, 154 insertions, 128 deletions
diff --git a/win/create_def_file.js b/win/create_def_file.js
index 25bbbb4eb3d..9a178510ca8 100644
--- a/win/create_def_file.js
+++ b/win/create_def_file.js
@@ -257,4 +257,9 @@ function addToResponseFile(filename, responseFile)
responseFile.WriteLine("\""+fso.GetFile(filename).Path+"\"");
}
}
+ else
+ {
+ echo("file " + filename + " not found. Can't generate symbols file");
+ WScript.Quit (1);
+ }
}
diff --git a/win/packaging/CMakeLists.txt b/win/packaging/CMakeLists.txt
index 4bd34c86a40..683abc64ef3 100644
--- a/win/packaging/CMakeLists.txt
+++ b/win/packaging/CMakeLists.txt
@@ -123,14 +123,12 @@ ELSE()
FILE(APPEND "${CMAKE_CURRENT_BINARY_DIR}/COPYING.rtf" "\n}\n")
SET(COPYING_RTF "${CMAKE_CURRENT_BINARY_DIR}/COPYING.rtf")
ENDIF()
-GET_TARGET_PROPERTY(WIXCA_LOCATION wixca LOCATION)
SET(CPACK_WIX_CONFIG ${CMAKE_CURRENT_SOURCE_DIR}/CPackWixConfig.cmake)
-GET_TARGET_PROPERTY(upgrade_wizard_location mysql_upgrade_wizard LOCATION)
-IF(NOT upgrade_wizard_location)
+IF(NOT TARGET mysql_upgrade_wizard)
SET(EXTRA_WIX_PREPROCESSOR_FLAGS "-dHaveUpgradeWizard=0")
ENDIF()
-IF(WITH_INNOBASE_STORAGE_ENGINE OR WITH_INNODB_STORAGE_ENGINE OR WITH_XTRADB_STORAGE_ENGINE)
+IF(WITH_INNOBASE_STORAGE_ENGINE)
SET(EXTRA_WIX_PREPROCESSOR_FLAGS ${EXTRA_WIX_PREPROCESSOR_FLAGS} "-dHaveInnodb=1")
ENDIF()
@@ -145,7 +143,6 @@ IF(WITH_THIRD_PARTY)
ENDIF()
ENDIF()
-GET_TARGET_PROPERTY(LIBMYSQL_LOCATION libmysql LOCATION)
FOREACH(third_party ${WITH_THIRD_PARTY})
SET(third_party_install_plugin ${CMAKE_CURRENT_SOURCE_DIR}/${third_party}.cmake)
IF(NOT EXISTS ${third_party_install_plugin})
@@ -169,10 +166,6 @@ ENDIF()
IF(NOT CPACK_WIX_UI)
SET(CPACK_WIX_UI "MyWixUI_Mondo")
ENDIF()
-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/create_msi.cmake.in
- ${CMAKE_CURRENT_BINARY_DIR}/create_msi.cmake
- @ONLY)
-
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
SET(WixWin64 " Win64='yes'")
@@ -188,17 +181,69 @@ ENDIF()
ADD_CUSTOM_TARGET(
MSI
- COMMAND ${CMAKE_COMMAND}
- ${CONFIG_PARAM}
- -P ${CMAKE_CURRENT_BINARY_DIR}/create_msi.cmake
+ COMMAND ${CMAKE_COMMAND} ${CONFIG_PARAM}
+ -DCANDLE_EXECUTABLE="${CANDLE_EXECUTABLE}"
+ -DCMAKE_CFG_INTDIR="${CMAKE_CFG_INTDIR}"
+ -DCMAKE_FULL_VER="${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}"
+ -DCMAKE_SIZEOF_VOID_P=${CMAKE_SIZEOF_VOID_P}
+ -DCOPYING_RTF="${COPYING_RTF}"
+ -DCPACK_WIX_CONFIG="${CPACK_WIX_CONFIG}"
+ -DCPACK_WIX_INCLUDE="${CPACK_WIX_INCLUDE}"
+ -DCPACK_WIX_PACKAGE_BASE_NAME="${CPACK_WIX_PACKAGE_BASE_NAME}"
+ -DCPACK_WIX_PACKAGE_NAME="${CPACK_WIX_PACKAGE_NAME}"
+ -DCPACK_WIX_UPGRADE_CODE="${CPACK_WIX_UPGRADE_CODE}"
+ -DEXTRA_WIX_PREPROCESSOR_FLAGS="${EXTRA_WIX_PREPROCESSOR_FLAGS}"
+ -DLIGHT_EXECUTABLE="${LIGHT_EXECUTABLE}"
+ -DMAJOR_VERSION="${MAJOR_VERSION}"
+ -DMANUFACTURER="${MANUFACTURER}"
+ -DMINOR_VERSION="${MINOR_VERSION}"
+ -DPATCH_VERSION="${PATCH_VERSION}"
+ -DSIGNCODE="${SIGNCODE}"
+ -DSIGNTOOL_EXECUTABLE="${SIGNTOOL_EXECUTABLE}"
+ -DSIGNTOOL_PARAMETERS="${SIGNTOOL_PARAMETERS}"
+ -DSRCDIR="${CMAKE_CURRENT_SOURCE_DIR}"
+ -DTHIRD_PARTY_DOWNLOAD_LOCATION="${THIRD_PARTY_DOWNLOAD_LOCATION}"
+ -DTHIRD_PARTY_FEATURE_CONDITION="${THIRD_PARTY_FEATURE_CONDITION}"
+ -DTINY_VERSION="${TINY_VERSION}"
+ -DTOP_BINDIR="${CMAKE_BINARY_DIR}"
+ -DVERSION="${VERSION}"
+ -DWITH_THIRD_PARTY="${WITH_THIRD_PARTY}"
+ -DWIXCA_LOCATION="$<TARGET_FILE:wixca>"
+ -P ${CMAKE_CURRENT_SOURCE_DIR}/create_msi.cmake
)
ADD_DEPENDENCIES(MSI wixca)
ADD_CUSTOM_TARGET(
MSI_ESSENTIALS
- COMMAND ${CMAKE_COMMAND} -DESSENTIALS=1
- ${CONFIG_PARAM}
- -P ${CMAKE_CURRENT_BINARY_DIR}/create_msi.cmake
+ COMMAND ${CMAKE_COMMAND} ${CONFIG_PARAM} -DESSENTIALS=1
+ -DCANDLE_EXECUTABLE="${CANDLE_EXECUTABLE}"
+ -DCMAKE_CFG_INTDIR="${CMAKE_CFG_INTDIR}"
+ -DCMAKE_FULL_VER="${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}"
+ -DCMAKE_SIZEOF_VOID_P=${CMAKE_SIZEOF_VOID_P}
+ -DCOPYING_RTF="${COPYING_RTF}"
+ -DCPACK_WIX_CONFIG="${CPACK_WIX_CONFIG}"
+ -DCPACK_WIX_INCLUDE="${CPACK_WIX_INCLUDE}"
+ -DCPACK_WIX_PACKAGE_BASE_NAME="${CPACK_WIX_PACKAGE_BASE_NAME}"
+ -DCPACK_WIX_PACKAGE_NAME="${CPACK_WIX_PACKAGE_NAME}"
+ -DCPACK_WIX_UPGRADE_CODE="${CPACK_WIX_UPGRADE_CODE}"
+ -DEXTRA_WIX_PREPROCESSOR_FLAGS="${EXTRA_WIX_PREPROCESSOR_FLAGS}"
+ -DLIGHT_EXECUTABLE="${LIGHT_EXECUTABLE}"
+ -DMAJOR_VERSION="${MAJOR_VERSION}"
+ -DMANUFACTURER="${MANUFACTURER}"
+ -DMINOR_VERSION="${MINOR_VERSION}"
+ -DPATCH_VERSION="${PATCH_VERSION}"
+ -DSIGNCODE="${SIGNCODE}"
+ -DSIGNTOOL_EXECUTABLE="${SIGNTOOL_EXECUTABLE}"
+ -DSIGNTOOL_PARAMETERS="${SIGNTOOL_PARAMETERS}"
+ -DSRCDIR="${CMAKE_CURRENT_SOURCE_DIR}"
+ -DTHIRD_PARTY_DOWNLOAD_LOCATION="${THIRD_PARTY_DOWNLOAD_LOCATION}"
+ -DTHIRD_PARTY_FEATURE_CONDITION="${THIRD_PARTY_FEATURE_CONDITION}"
+ -DTINY_VERSION="${TINY_VERSION}"
+ -DTOP_BINDIR="${CMAKE_BINARY_DIR}"
+ -DVERSION="${VERSION}"
+ -DWITH_THIRD_PARTY="${WITH_THIRD_PARTY}"
+ -DWIXCA_LOCATION="$<TARGET_FILE:wixca>"
+ -P ${CMAKE_CURRENT_SOURCE_DIR}/create_msi.cmake
)
ADD_DEPENDENCIES(MSI_ESSENTIALS wixca)
diff --git a/win/packaging/ca/CustomAction.cpp b/win/packaging/ca/CustomAction.cpp
index c0062ddcdd1..71c24e96f92 100644
--- a/win/packaging/ca/CustomAction.cpp
+++ b/win/packaging/ca/CustomAction.cpp
@@ -60,13 +60,13 @@ extern "C" UINT __stdcall RemoveDataDirectory(MSIHANDLE hInstall)
{
HRESULT hr = S_OK;
UINT er = ERROR_SUCCESS;
+ wchar_t dir[MAX_PATH];
+ DWORD len = MAX_PATH;
hr = WcaInitialize(hInstall, __FUNCTION__);
ExitOnFailure(hr, "Failed to initialize");
WcaLog(LOGMSG_STANDARD, "Initialized.");
- wchar_t dir[MAX_PATH];
- DWORD len = MAX_PATH;
MsiGetPropertyW(hInstall, L"CustomActionData", dir, &len);
er= ExecRemoveDataDirectory(dir);
@@ -90,7 +90,7 @@ static void EscapeCommandLine(const wchar_t *in, wchar_t *out, size_t buflen)
bool needs_escaping= false;
size_t pos;
- for(int i=0; i< sizeof(special_chars) -1; i++)
+ for(size_t i=0; i< sizeof(special_chars) -1; i++)
{
if (wcschr(in, special_chars[i]))
{
@@ -160,20 +160,21 @@ extern "C" UINT __stdcall CheckDirectoryEmpty(MSIHANDLE hInstall,
{
HRESULT hr = S_OK;
UINT er = ERROR_SUCCESS;
+ wchar_t buf[MAX_PATH];
+ DWORD len = MAX_PATH;
+ WIN32_FIND_DATAW data;
+ HANDLE h;
+ bool empty;
+
hr = WcaInitialize(hInstall, __FUNCTION__);
ExitOnFailure(hr, "Failed to initialize");
WcaLog(LOGMSG_STANDARD, "Initialized.");
-
- wchar_t buf[MAX_PATH];
- DWORD len = MAX_PATH;
MsiGetPropertyW(hInstall, PropertyName, buf, &len);
wcscat_s(buf, MAX_PATH, L"*.*");
WcaLog(LOGMSG_STANDARD, "Checking files in %S", buf);
- WIN32_FIND_DATAW data;
- HANDLE h;
- bool empty;
+
h= FindFirstFile(buf, &data);
if (h != INVALID_HANDLE_VALUE)
{
@@ -270,7 +271,7 @@ bool IsPortFree(short port)
struct sockaddr_in sin;
SOCKET sock;
sock = socket(AF_INET, SOCK_STREAM, 0);
- if(sock == -1)
+ if(sock == INVALID_SOCKET)
{
return false;
}
@@ -342,6 +343,12 @@ void CheckServiceConfig(
wchar_t * commandline= config->lpBinaryPathName;
int numargs;
wchar_t **argv= CommandLineToArgvW(commandline, &numargs);
+ wchar_t current_datadir_buf[MAX_PATH]={0};
+ wchar_t normalized_current_datadir[MAX_PATH+1];
+ wchar_t *current_datadir;
+ wchar_t *defaults_file;
+ bool is_my_service;
+
WcaLog(LOGMSG_VERBOSE, "CommandLine= %S", commandline);
if(!argv || !argv[0] || ! wcsstr(argv[0], L"mysqld"))
{
@@ -356,7 +363,7 @@ void CheckServiceConfig(
same_bindir = true;
}
- bool is_my_service = (_wcsicmp(my_servicename, other_servicename) == 0);
+ is_my_service = (_wcsicmp(my_servicename, other_servicename) == 0);
if(!is_my_service)
{
WcaLog(LOGMSG_STANDARD, "service does not match current service");
@@ -379,10 +386,8 @@ void CheckServiceConfig(
goto end;
}
- wchar_t current_datadir_buf[MAX_PATH]={0};
- wchar_t normalized_current_datadir[MAX_PATH+1];
- wchar_t *current_datadir= current_datadir_buf;
- wchar_t *defaults_file= argv[1]+16;
+ current_datadir= current_datadir_buf;
+ defaults_file= argv[1]+16;
defaults_file= strip_quotes(defaults_file);
WcaLog(LOGMSG_STANDARD, "parsed defaults file is %S", defaults_file);
@@ -453,6 +458,7 @@ extern "C" UINT CheckDBInUse(MSIHANDLE hInstall)
ULONG bufneed = 0x00;
ULONG num_services = 0x00;
LPENUM_SERVICE_STATUS_PROCESS info = NULL;
+ BOOL ok;
hr = WcaInitialize(hInstall, __FUNCTION__);
ExitOnFailure(hr, "Failed to initialize");
@@ -471,7 +477,7 @@ extern "C" UINT CheckDBInUse(MSIHANDLE hInstall)
ExitOnFailure(E_FAIL, "OpenSCManager failed");
}
- BOOL ok= EnumServicesStatusExW( scm,
+ ok = EnumServicesStatusExW( scm,
SC_ENUM_PROCESS_INFO,
SERVICE_WIN32,
SERVICE_STATE_ALL,
@@ -524,7 +530,7 @@ LExit:
or 4GB(x64 OS).
Fragmentation due to loaded modules, heap and stack
- limit maximum size of continous memory block further,
+ limit maximum size of continuous memory block further,
so that limit for 32 bit process is about 1200 on 32 bit OS
or 2000 MB on 64 bit OS(found experimentally).
*/
@@ -559,13 +565,16 @@ extern "C" UINT __stdcall CheckDatabaseProperties (MSIHANDLE hInstall)
const wchar_t *ErrorMsg=0;
HRESULT hr= S_OK;
UINT er= ERROR_SUCCESS;
-
+ DWORD ServiceNameLen = MAX_PATH;
+ DWORD QuickConfigLen = MAX_PATH;
+ DWORD PasswordLen= MAX_PATH;
+ DWORD SkipNetworkingLen= MAX_PATH;
hr = WcaInitialize(hInstall, __FUNCTION__);
ExitOnFailure(hr, "Failed to initialize");
WcaLog(LOGMSG_STANDARD, "Initialized.");
- DWORD ServiceNameLen = MAX_PATH;
+
MsiGetPropertyW (hInstall, L"SERVICENAME", ServiceName, &ServiceNameLen);
if(ServiceName[0])
{
@@ -594,13 +603,11 @@ extern "C" UINT __stdcall CheckDatabaseProperties (MSIHANDLE hInstall)
}
}
- DWORD PasswordLen= MAX_PATH;
MsiGetPropertyW (hInstall, L"PASSWORD", Password, &PasswordLen);
EscapeCommandLine(Password, EscapedPassword,
sizeof(EscapedPassword)/sizeof(EscapedPassword[0]));
MsiSetPropertyW(hInstall,L"ESCAPEDPASSWORD",EscapedPassword);
- DWORD SkipNetworkingLen= MAX_PATH;
MsiGetPropertyW(hInstall, L"SKIPNETWORKING", SkipNetworking,
&SkipNetworkingLen);
MsiGetPropertyW(hInstall, L"PORT", Port, &PortLen);
@@ -644,8 +651,6 @@ extern "C" UINT __stdcall CheckDatabaseProperties (MSIHANDLE hInstall)
}
}
-
- DWORD QuickConfigLen = MAX_PATH;
MsiGetPropertyW (hInstall, L"STDCONFIG", QuickConfig, &QuickConfigLen);
if(QuickConfig[0] !=0)
{
@@ -722,12 +727,12 @@ extern "C" UINT __stdcall PresetDatabaseProperties(MSIHANDLE hInstall)
UINT er = ERROR_SUCCESS;
HRESULT hr= S_OK;
MEMORYSTATUSEX memstatus;
+ DWORD BufferPoolsizeParamLen = MAX_PATH;
hr = WcaInitialize(hInstall, __FUNCTION__);
ExitOnFailure(hr, "Failed to initialize");
WcaLog(LOGMSG_STANDARD, "Initialized.");
/* Check if bufferpoolsize parameter was given on the command line*/
- DWORD BufferPoolsizeParamLen = MAX_PATH;
MsiGetPropertyW(hInstall, L"BUFFERPOOLSIZE", buff, &BufferPoolsizeParamLen);
if (BufferPoolsizeParamLen && buff[0])
@@ -817,11 +822,13 @@ extern "C" UINT __stdcall CreateDatabaseRollback(MSIHANDLE hInstall)
UINT er = ERROR_SUCCESS;
wchar_t* service= 0;
wchar_t* dir= 0;
+ wchar_t data[2*MAX_PATH];
+ DWORD len= MAX_PATH;
+
hr = WcaInitialize(hInstall, __FUNCTION__);
ExitOnFailure(hr, "Failed to initialize");
WcaLog(LOGMSG_STANDARD, "Initialized.");
- wchar_t data[2*MAX_PATH];
- DWORD len= MAX_PATH;
+
MsiGetPropertyW(hInstall, L"CustomActionData", data, &len);
/* Property is encoded as [SERVICENAME]\[DBLOCATION] */
@@ -864,13 +871,16 @@ extern "C" UINT __stdcall CheckServiceUpgrades(MSIHANDLE hInstall)
{
HRESULT hr = S_OK;
UINT er = ERROR_SUCCESS;
- wchar_t* service= 0;
- wchar_t* dir= 0;
wchar_t installerVersion[MAX_VERSION_PROPERTY_SIZE];
char installDir[MAX_PATH];
DWORD size =MAX_VERSION_PROPERTY_SIZE;
int installerMajorVersion, installerMinorVersion, installerPatchVersion;
bool upgradableServiceFound=false;
+ LPENUM_SERVICE_STATUS_PROCESSW info;
+ DWORD bufsize;
+ int index;
+ BOOL ok;
+ SC_HANDLE scm = NULL;
hr = WcaInitialize(hInstall, __FUNCTION__);
WcaLog(LOGMSG_STANDARD, "Initialized.");
@@ -895,7 +905,7 @@ extern "C" UINT __stdcall CheckServiceUpgrades(MSIHANDLE hInstall)
}
- SC_HANDLE scm = OpenSCManager(NULL, NULL,
+ scm = OpenSCManager(NULL, NULL,
SC_MANAGER_ENUMERATE_SERVICE | SC_MANAGER_CONNECT);
if (scm == NULL)
{
@@ -906,19 +916,19 @@ extern "C" UINT __stdcall CheckServiceUpgrades(MSIHANDLE hInstall)
static BYTE buf[64*1024];
static BYTE config_buffer[8*1024];
- DWORD bufsize= sizeof(buf);
+ bufsize= sizeof(buf);
DWORD bufneed;
DWORD num_services;
- BOOL ok= EnumServicesStatusExW(scm, SC_ENUM_PROCESS_INFO, SERVICE_WIN32,
+ ok= EnumServicesStatusExW(scm, SC_ENUM_PROCESS_INFO, SERVICE_WIN32,
SERVICE_STATE_ALL, buf, bufsize, &bufneed, &num_services, NULL, NULL);
if(!ok)
{
hr = HRESULT_FROM_WIN32(GetLastError());
ExitOnFailure(hr,"EnumServicesStatusEx failed");
}
- LPENUM_SERVICE_STATUS_PROCESSW info =
+ info =
(LPENUM_SERVICE_STATUS_PROCESSW)buf;
- int index=-1;
+ index=-1;
for (ULONG i=0; i < num_services; i++)
{
SC_HANDLE service= OpenServiceW(scm, info[i].lpServiceName,
@@ -928,7 +938,7 @@ extern "C" UINT __stdcall CheckServiceUpgrades(MSIHANDLE hInstall)
QUERY_SERVICE_CONFIGW *config=
(QUERY_SERVICE_CONFIGW*)(void *)config_buffer;
DWORD needed;
- BOOL ok= QueryServiceConfigW(service, config,sizeof(config_buffer),
+ ok= QueryServiceConfigW(service, config,sizeof(config_buffer),
&needed) && (config->dwStartType != SERVICE_DISABLED);
CloseServiceHandle(service);
if (ok)
diff --git a/win/packaging/create_msi.cmake.in b/win/packaging/create_msi.cmake
index 21c59dd4f38..122c25a0d91 100644
--- a/win/packaging/create_msi.cmake.in
+++ b/win/packaging/create_msi.cmake
@@ -1,35 +1,3 @@
-SET(CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@")
-SET(CMAKE_CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@")
-SET(CANDLE_EXECUTABLE "@CANDLE_EXECUTABLE@")
-SET(LIGHT_EXECUTABLE "@LIGHT_EXECUTABLE@")
-SET(CMAKE_COMMAND "@CMAKE_COMMAND@")
-SET(CMAKE_CFG_INTDIR "@CMAKE_CFG_INTDIR@")
-SET(VERSION "@VERSION@")
-SET(MAJOR_VERSION "@MAJOR_VERSION@")
-SET(MINOR_VERSION "@MINOR_VERSION@")
-SET(PATCH_VERSION "@PATCH_VERSION@")
-SET(TINY_VERSION "@TINY_VERSION@")
-SET(CMAKE_SIZEOF_VOID_P @CMAKE_SIZEOF_VOID_P@)
-SET(MANUFACTURER "@MANUFACTURER@")
-SET(WIXCA_LOCATION "@WIXCA_LOCATION@")
-SET(COPYING_RTF "@COPYING_RTF@")
-SET(CPACK_WIX_CONFIG "@CPACK_WIX_CONFIG@")
-SET(CPACK_WIX_INCLUDE "@CPACK_WIX_INCLUDE@")
-SET(CPACK_WIX_UPGRADE_CODE "@CPACK_WIX_UPGRADE_CODE@")
-SET(CPACK_WIX_PACKAGE_NAME "@CPACK_WIX_PACKAGE_NAME@")
-SET(CPACK_WIX_PACKAGE_BASE_NAME "@CPACK_WIX_PACKAGE_BASE_NAME@")
-SET(SIGNCODE "@SIGNCODE@")
-SET(SIGNTOOL_EXECUTABLE "@SIGNTOOL_EXECUTABLE@")
-SET(SIGNTOOL_PARAMETERS "@SIGNTOOL_PARAMETERS@")
-SET(CMAKE_FULL_VER
- "@CMAKE_MAJOR_VERSION@.@CMAKE_MINOR_VERSION@.@CMAKE_PATCH_VERSION@")
-SET(EXTRA_WIX_PREPROCESSOR_FLAGS "@EXTRA_WIX_PREPROCESSOR_FLAGS@")
-SET(WITH_THIRD_PARTY "@WITH_THIRD_PARTY@")
-SET(THIRD_PARTY_DOWNLOAD_LOCATION "@THIRD_PARTY_DOWNLOAD_LOCATION@")
-SET(THIRD_PARTY_FEATURE_CONDITION "@THIRD_PARTY_FEATURE_CONDITION@")
-SET(LIBMYSQL_LOCATION "@LIBMYSQL_LOCATION@")
-
-
MACRO(MAKE_WIX_IDENTIFIER str varname)
STRING(REPLACE "/" "." ${varname} "${str}")
STRING(REGEX REPLACE "[^a-zA-Z_0-9.]" "_" ${varname} "${${varname}}")
@@ -45,19 +13,15 @@ MACRO(MAKE_WIX_IDENTIFIER str varname)
ENDMACRO()
SET($ENV{VS_UNICODE_OUTPUT} "")
-IF(LIBMYSQL_LOCATION AND CMAKE_CFG_INTDIR)
- # resolve libmysql full path
- STRING(REPLACE "${CMAKE_CFG_INTDIR}" "${CMAKE_INSTALL_CONFIG_NAME}" LIBMYSQL_LOCATION "${LIBMYSQL_LOCATION}")
-ENDIF()
-
+
FOREACH(third_party ${WITH_THIRD_PARTY})
- INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/${third_party}.cmake)
+ INCLUDE(${SRCDIR}/${third_party}.cmake)
# Check than above script produced ${third_party}.wxi and ${third_party}_feature.wxi
FOREACH(outfile ${third_party}.wxi ${third_party}_feature.wxi)
IF(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/${outfile})
MESSAGE(FATAL_ERROR
- "${CMAKE_CURRENT_SOURCE_DIR}/${third_party}.cmake did not produce "
+ "${SRCDIR}/${third_party}.cmake did not produce "
"${CMAKE_CURRENT_BINARY_DIR}/${outfile}"
)
ENDIF()
@@ -79,7 +43,7 @@ ENDIF()
SET(ENV{VS_UNICODE_OUTPUT})
-INCLUDE(${CMAKE_BINARY_DIR}/CPackConfig.cmake)
+INCLUDE(${TOP_BINDIR}/CPackConfig.cmake)
IF(CPACK_WIX_CONFIG)
INCLUDE(${CPACK_WIX_CONFIG})
@@ -101,13 +65,13 @@ FOREACH(comp ${COMPONENTS_ALL})
SET(ENV{DESTDIR} testinstall/${comp})
EXECUTE_PROCESS(
COMMAND ${CMAKE_COMMAND} ${CONFIG_PARAM} -DCMAKE_INSTALL_COMPONENT=${comp}
- -DCMAKE_INSTALL_PREFIX= -P ${CMAKE_BINARY_DIR}/cmake_install.cmake
+ -DCMAKE_INSTALL_PREFIX= -P ${TOP_BINDIR}/cmake_install.cmake
OUTPUT_QUIET
)
# Exclude empty install components
SET(INCLUDE_THIS_COMPONENT 1)
- SET(MANIFEST_FILENAME "${CMAKE_BINARY_DIR}/install_manifest_${comp}.txt")
+ SET(MANIFEST_FILENAME "${TOP_BINDIR}/install_manifest_${comp}.txt")
IF(EXISTS ${MANIFEST_FILENAME})
FILE(READ ${MANIFEST_FILENAME} content)
STRING(LENGTH "${content}" content_length)
@@ -385,9 +349,9 @@ SET(CPACK_WIX_INCLUDES
ENDFOREACH()
-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql_server.wxs.in
+CONFIGURE_FILE(${SRCDIR}/mysql_server.wxs.in
${CMAKE_CURRENT_BINARY_DIR}/mysql_server.wxs)
-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/extra.wxs.in
+CONFIGURE_FILE(${SRCDIR}/extra.wxs.in
${CMAKE_CURRENT_BINARY_DIR}/extra.wxs)
SET(EXTRA_CANDLE_ARGS "$ENV{EXTRA_CANDLE_ARGS}")
@@ -426,6 +390,7 @@ EXECUTE_PROCESS(
)
IF(SIGNCODE)
+ SEPARATE_ARGUMENTS(SIGNTOOL_PARAMETERS WINDOWS_COMMAND "${SIGNTOOL_PARAMETERS}")
EXECUTE_PROCESS(
COMMAND ${SIGNTOOL_EXECUTABLE} sign ${SIGNTOOL_PARAMETERS}
/d ${CPACK_PACKAGE_FILE_NAME}.msi
@@ -433,6 +398,6 @@ IF(SIGNCODE)
)
ENDIF()
CONFIGURE_FILE(${CPACK_PACKAGE_FILE_NAME}.msi
- ${CMAKE_BINARY_DIR}/${CPACK_PACKAGE_FILE_NAME}.msi
+ ${TOP_BINDIR}/${CPACK_PACKAGE_FILE_NAME}.msi
COPYONLY)
diff --git a/win/packaging/extra.wxs.in b/win/packaging/extra.wxs.in
index 3aba129fdf3..a71ef982896 100644
--- a/win/packaging/extra.wxs.in
+++ b/win/packaging/extra.wxs.in
@@ -71,8 +71,8 @@
<!--
User interface dialogs
-->
- <WixVariable Id='WixUIBannerBmp' Value='@CMAKE_CURRENT_SOURCE_DIR@\WixUIBannerBmp.jpg' />
- <WixVariable Id='WixUIDialogBmp' Value='@CMAKE_CURRENT_SOURCE_DIR@\WixUIDialogBmp.jpg' />
+ <WixVariable Id='WixUIBannerBmp' Value='@SRCDIR@\WixUIBannerBmp.jpg' />
+ <WixVariable Id='WixUIDialogBmp' Value='@SRCDIR@\WixUIDialogBmp.jpg' />
<UI>
<!-- Dialog on uninstall of the database -->
@@ -445,7 +445,7 @@
<!-- Data directory with some reasonable security settings -->
<Component Id="C.datadir" Guid="*" Directory="DATADIR">
<RegistryValue Root='HKLM'
- Key='SOFTWARE\Monty Program AB\@CPACK_WIX_PACKAGE_NAME@'
+ Key='SOFTWARE\@CPACK_WIX_PACKAGE_NAME@'
Name='DATADIR' Value='[DATADIR]' Type='string' KeyPath='yes'/>
<CreateFolder>
<util:PermissionEx User="NetworkService" GenericAll="yes" />
@@ -461,7 +461,7 @@
<![CDATA[ (UserSID <> "S-1-5-18") AND (UserSID <> "S-1-5-19") AND (UserSID <> "S-1-5-20") ]]>
</Condition>
<RegistryValue Root='HKLM'
- Key='SOFTWARE\Monty Program AB\@CPACK_WIX_PACKAGE_NAME@'
+ Key='SOFTWARE\@CPACK_WIX_PACKAGE_NAME@'
Name='InstalledBy' Value='[USER_DOMAIN]\[LogonUser]' Type='string' KeyPath='yes'/>
<CreateFolder>
<util:PermissionEx User="[LogonUser]" Domain="[USER_DOMAIN]" GenericAll="yes" />
@@ -472,7 +472,7 @@
<Component Id="C.service" Guid="*" Directory="DATADIR">
<Condition>SERVICENAME</Condition>
<RegistryValue Root='HKLM'
- Key='SOFTWARE\Monty Program AB\@CPACK_WIX_PACKAGE_NAME@'
+ Key='SOFTWARE\@CPACK_WIX_PACKAGE_NAME@'
Name='SERVICENAME' Value='[SERVICENAME]' Type='string' KeyPath='yes'/>
<ServiceControl Id='DBInstanceServiceStop' Name='[SERVICENAME]' Stop='both' Remove='uninstall' Wait='yes'/>
<ServiceControl Id='DBInstanceServiceStart' Name='[SERVICENAME]' Start='install' Wait='yes'/>
@@ -480,7 +480,7 @@
<Component Id="C.myiniconfig" Guid="*" Directory="DATADIR">
<RegistryValue Root='HKLM'
- Key='SOFTWARE\Monty Program AB\@CPACK_WIX_PACKAGE_NAME@'
+ Key='SOFTWARE\@CPACK_WIX_PACKAGE_NAME@'
Name='STDCONFIG' Value='1' Type='string' KeyPath='yes'/>
<IniFile Id="Ini3"
Action="createLine"
@@ -493,7 +493,7 @@
<Component Id="C.feedback" Guid="*" Directory="DATADIR">
<Condition>FEEDBACK</Condition>
<RegistryValue Root='HKLM'
- Key='SOFTWARE\Monty Program AB\@CPACK_WIX_PACKAGE_NAME@'
+ Key='SOFTWARE\@CPACK_WIX_PACKAGE_NAME@'
Name='FEEDBACK' Value='1' Type='string' KeyPath='yes'/>
<IniFile Id="Ini5"
Action="createLine"
@@ -507,7 +507,7 @@
<Component Id="C.utf8" Guid="*" Directory="DATADIR">
<Condition>UTF8</Condition>
<RegistryValue Root='HKLM'
- Key='SOFTWARE\Monty Program AB\@CPACK_WIX_PACKAGE_NAME@'
+ Key='SOFTWARE\@CPACK_WIX_PACKAGE_NAME@'
Name='UTF8' Value='1' Type='string' KeyPath='yes'/>
<IniFile Id="Ini6"
Action="createLine"
@@ -750,7 +750,7 @@
<Feature Id='StoreInstallLocation' Level='1' Absent='disallow' Display='hidden'>
<Component Directory='INSTALLDIR' Guid='*' Id='C.storeinstalllocation'>
- <RegistryValue Root='HKLM' Key='SOFTWARE\Monty Program AB\@CPACK_WIX_PACKAGE_NAME@'
+ <RegistryValue Root='HKLM' Key='SOFTWARE\@CPACK_WIX_PACKAGE_NAME@'
Name='INSTALLDIR' Value='[INSTALLDIR]' Type='string' KeyPath='yes'/>
</Component>
</Feature>
@@ -759,7 +759,7 @@
<Property Id='$(var.STOREDVAR)' Secure='yes'>
<RegistrySearch Id='$(var.STOREDVAR)Property' Root='HKLM'
- Key='SOFTWARE\Monty Program AB\@CPACK_WIX_PACKAGE_NAME@'
+ Key='SOFTWARE\@CPACK_WIX_PACKAGE_NAME@'
Name='$(var.STOREDVAR)' Type='raw' />
</Property>
<CustomAction Id='SaveCmdLineValue_$(var.STOREDVAR)' Property='CMDLINE_$(var.STOREDVAR)'
diff --git a/win/packaging/heidisql.cmake b/win/packaging/heidisql.cmake
index 897678f2025..72c059aa706 100644
--- a/win/packaging/heidisql.cmake
+++ b/win/packaging/heidisql.cmake
@@ -13,11 +13,5 @@ IF(NOT EXISTS ${HEIDISQL_DOWNLOAD_DIR}/${HEIDISQL_ZIP})
ENDIF()
SET(LIBMYSQLDLL_SOURCE ${HEIDISQL_DOWNLOAD_DIR}/libmysql.dll)
-IF(CMAKE_SIZEOF_VOID_P EQUAL 4)
- # Use our libmysql if it is 32 bit.
- IF(LIBMYSQL_LOCATION)
- SET(LIBMYSQLDLL_SOURCE "${LIBMYSQL_LOCATION}")
- ENDIF()
-ENDIF()
-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/heidisql.wxi.in ${CMAKE_CURRENT_BINARY_DIR}/heidisql.wxi)
-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/heidisql_feature.wxi.in ${CMAKE_CURRENT_BINARY_DIR}/heidisql_feature.wxi)
+CONFIGURE_FILE(${SRCDIR}/heidisql.wxi.in ${CMAKE_CURRENT_BINARY_DIR}/heidisql.wxi)
+CONFIGURE_FILE(${SRCDIR}/heidisql_feature.wxi.in ${CMAKE_CURRENT_BINARY_DIR}/heidisql_feature.wxi)
diff --git a/win/upgrade_wizard/CMakeLists.txt b/win/upgrade_wizard/CMakeLists.txt
index 5f415e4960d..f4148ee98d2 100644
--- a/win/upgrade_wizard/CMakeLists.txt
+++ b/win/upgrade_wizard/CMakeLists.txt
@@ -1,12 +1,19 @@
IF(NOT MSVC)
RETURN()
ENDIF()
+IF(CMAKE_C_COMPILER_ID MATCHES Clang)
+ # MFC stuff does not compile with clang
+ RETURN()
+ENDIF()
IF(CMAKE_USING_VC_FREE_TOOLS)
# No MFC, so it cannot be built
RETURN()
ENDIF()
# We need MFC
+# /permissive- flag does not play well with MFC, disable it.
+STRING(REPLACE "/permissive-" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+
FIND_PACKAGE(MFC)
IF(NOT MFC_FOUND)
IF(BUILD_RELEASE)
@@ -39,9 +46,8 @@ SET_TARGET_PROPERTIES(mysql_upgrade_wizard PROPERTIES WIN32_EXECUTABLE 1)
# to change service configuration. Due to a CMake bug http://www.vtk.org/Bug/view.php?id=11171
# it is not possible currenly to do it with linker flags. Work around is to use
# manifest tool mt.exe and embed the manifest post-build.
-GET_TARGET_PROPERTY(upgrade_wizard_location mysql_upgrade_wizard LOCATION)
ADD_CUSTOM_COMMAND(
TARGET mysql_upgrade_wizard POST_BUILD
COMMAND mt.exe -manifest ${CMAKE_CURRENT_SOURCE_DIR}/upgrade_wizard.exe.manifest
- "-outputresource:${upgrade_wizard_location};#1"
+ "-outputresource:$<TARGET_FILE:mysql_upgrade_wizard>;#1"
)
diff --git a/win/upgrade_wizard/stdafx.h b/win/upgrade_wizard/stdafx.h
index 55f9e71ed70..86e4fd826de 100644
--- a/win/upgrade_wizard/stdafx.h
+++ b/win/upgrade_wizard/stdafx.h
@@ -14,7 +14,7 @@
#endif
#include "targetver.h"
-
+struct IUnknown;
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit
// turns off MFC's hiding of some common and often safely ignored warning messages
diff --git a/win/upgrade_wizard/upgradeDlg.cpp b/win/upgrade_wizard/upgradeDlg.cpp
index d996c0ebe5d..793e89886d6 100644
--- a/win/upgrade_wizard/upgradeDlg.cpp
+++ b/win/upgrade_wizard/upgradeDlg.cpp
@@ -422,21 +422,22 @@ void CUpgradeDlg::UpgradeOneService(const string& servicename)
{
allMessages[lines%MAX_MESSAGES] = output_line;
m_DataDir.SetWindowText(allMessages[lines%MAX_MESSAGES].c_str());
- output_line.clear();
lines++;
- /*
- Updating progress dialog.There are currently 9 messages from
- mysql_upgrade_service (actually it also writes Phase N/M but
- we do not parse the output right now).
- */
-#define EXPRECTED_MYSQL_UPGRADE_MESSAGES 9
-
- int stepsTotal= m_ProgressTotal*EXPRECTED_MYSQL_UPGRADE_MESSAGES;
- int stepsCurrent= m_ProgressCurrent*EXPRECTED_MYSQL_UPGRADE_MESSAGES
- + lines;
- int percentDone= stepsCurrent*100/stepsTotal;
- m_Progress.SetPos(percentDone);
+ int curPhase, numPhases;
+
+ // Parse output line to update progress indicator
+ if (strncmp(output_line.c_str(),"Phase ",6) == 0 &&
+ sscanf(output_line.c_str() +6 ,"%d/%d",&curPhase,&numPhases) == 2
+ && numPhases > 0 )
+ {
+ int stepsTotal= m_ProgressTotal*numPhases;
+ int stepsCurrent= m_ProgressCurrent*numPhases+ curPhase;
+ int percentDone= stepsCurrent*100/stepsTotal;
+ m_Progress.SetPos(percentDone);
+ m_Progress.SetPos(stepsCurrent * 100 / stepsTotal);
+ }
+ output_line.clear();
}
else
{