diff options
Diffstat (limited to 'win')
-rw-r--r-- | win/packaging/CMakeLists.txt | 2 | ||||
-rw-r--r-- | win/packaging/ca/CustomAction.cpp | 72 | ||||
-rw-r--r-- | win/packaging/extra.wxs.in | 18 |
3 files changed, 52 insertions, 40 deletions
diff --git a/win/packaging/CMakeLists.txt b/win/packaging/CMakeLists.txt index d33516044f6..d5dc3becba8 100644 --- a/win/packaging/CMakeLists.txt +++ b/win/packaging/CMakeLists.txt @@ -130,7 +130,7 @@ GET_TARGET_PROPERTY(upgrade_wizard_location mysql_upgrade_wizard LOCATION) IF(NOT upgrade_wizard_location) 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() diff --git a/win/packaging/ca/CustomAction.cpp b/win/packaging/ca/CustomAction.cpp index c0062ddcdd1..025c4da4592 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); @@ -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) { @@ -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] */ @@ -871,6 +878,11 @@ extern "C" UINT __stdcall CheckServiceUpgrades(MSIHANDLE hInstall) 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; hr = WcaInitialize(hInstall, __FUNCTION__); WcaLog(LOGMSG_STANDARD, "Initialized."); @@ -895,7 +907,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 +918,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 +940,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/extra.wxs.in b/win/packaging/extra.wxs.in index 3aba129fdf3..9d1b1e1c910 100644 --- a/win/packaging/extra.wxs.in +++ b/win/packaging/extra.wxs.in @@ -53,7 +53,7 @@ <Property Id="DISABLEADVTSHORTCUTS" Secure="yes" Value="1"/> <!-- Activate feedback plugin--> - <Property Id="FEEDBACK" Secure="yes"/> + <Property Id="FEEDBACK" Secure="yes" Value="1"/> <!-- Quick configuration : set default storage engine to innodb, use strict sql_mode --> @@ -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)' |