diff options
Diffstat (limited to 'win/packaging')
-rw-r--r-- | win/packaging/CMakeLists.txt | 75 | ||||
-rw-r--r-- | win/packaging/ca/CustomAction.cpp | 76 | ||||
-rw-r--r-- | win/packaging/create_msi.cmake (renamed from win/packaging/create_msi.cmake.in) | 55 | ||||
-rw-r--r-- | win/packaging/extra.wxs.in | 20 | ||||
-rw-r--r-- | win/packaging/heidisql.cmake | 4 |
5 files changed, 125 insertions, 105 deletions
diff --git a/win/packaging/CMakeLists.txt b/win/packaging/CMakeLists.txt index ded44af5276..0b46ea19a27 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 d3bea12ffd9..b9d938f4443 100644 --- a/win/packaging/ca/CustomAction.cpp +++ b/win/packaging/ca/CustomAction.cpp @@ -62,13 +62,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); @@ -92,7 +92,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])) { @@ -162,20 +162,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) { @@ -397,6 +398,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")) { @@ -411,7 +418,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"); @@ -434,10 +441,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); @@ -508,6 +513,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"); @@ -526,7 +532,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, @@ -579,7 +585,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). */ @@ -614,13 +620,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]) { @@ -649,13 +658,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); @@ -699,8 +706,6 @@ extern "C" UINT __stdcall CheckDatabaseProperties (MSIHANDLE hInstall) } } - - DWORD QuickConfigLen = MAX_PATH; MsiGetPropertyW (hInstall, L"STDCONFIG", QuickConfig, &QuickConfigLen); if(QuickConfig[0] !=0) { @@ -777,12 +782,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]) @@ -872,11 +877,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] */ @@ -919,13 +926,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."); @@ -950,7 +960,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) { @@ -961,19 +971,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, @@ -983,7 +993,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 c589f98becc..58edcef3ef9 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() @@ -81,7 +45,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}) @@ -103,13 +67,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) @@ -387,9 +351,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}") @@ -428,6 +392,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 @@ -435,6 +400,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 4c8e1a5a973..ee4753d099f 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 6290ada9704..1d66c812ec0 100644 --- a/win/packaging/heidisql.cmake +++ b/win/packaging/heidisql.cmake @@ -12,5 +12,5 @@ IF(NOT EXISTS ${HEIDISQL_DOWNLOAD_DIR}/${HEIDISQL_ZIP}) ) 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) |