summaryrefslogtreecommitdiff
path: root/packaging
diff options
context:
space:
mode:
authorDaniel Fischer <df@sun.com>2010-06-18 17:04:15 +0200
committerDaniel Fischer <df@sun.com>2010-06-18 17:04:15 +0200
commit073943cd7dc1b1c897543ffb704b821de942b07b (patch)
tree129482b631bc451c9ff9b99ac55692b6bec2563d /packaging
parentb79631bc7a2cdcb46f34d6e37e1597a6e71f09b1 (diff)
parentd6fe8c47b88faf5074f55d698a9b9af97d17fdd4 (diff)
downloadmariadb-git-073943cd7dc1b1c897543ffb704b821de942b07b.tar.gz
merge
Diffstat (limited to 'packaging')
-rw-r--r--packaging/WiX/AdminBackground.jpgbin0 -> 20557 bytes
-rw-r--r--packaging/WiX/AdminHeader.jpgbin0 -> 3469 bytes
-rw-r--r--packaging/WiX/CMakeLists.txt112
-rw-r--r--packaging/WiX/CPackWixConfig.cmake95
-rw-r--r--packaging/WiX/MySQLServer.icobin0 -> 22486 bytes
-rw-r--r--packaging/WiX/ca/CMakeLists.txt27
-rw-r--r--packaging/WiX/ca/CustomAction.cpp188
-rw-r--r--packaging/WiX/ca/CustomAction.def8
-rw-r--r--packaging/WiX/ca/CustomAction.rc18
-rw-r--r--packaging/WiX/create_msi.cmake.in311
-rw-r--r--packaging/WiX/extra.wxs.in60
-rw-r--r--packaging/WiX/mysql_server.wxs.in114
12 files changed, 933 insertions, 0 deletions
diff --git a/packaging/WiX/AdminBackground.jpg b/packaging/WiX/AdminBackground.jpg
new file mode 100644
index 00000000000..847dc6cdbed
--- /dev/null
+++ b/packaging/WiX/AdminBackground.jpg
Binary files differ
diff --git a/packaging/WiX/AdminHeader.jpg b/packaging/WiX/AdminHeader.jpg
new file mode 100644
index 00000000000..6e2e33d404f
--- /dev/null
+++ b/packaging/WiX/AdminHeader.jpg
Binary files differ
diff --git a/packaging/WiX/CMakeLists.txt b/packaging/WiX/CMakeLists.txt
new file mode 100644
index 00000000000..8a6a4ae4c41
--- /dev/null
+++ b/packaging/WiX/CMakeLists.txt
@@ -0,0 +1,112 @@
+# Copyright 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+IF(NOT WIN32)
+ RETURN()
+ENDIF()
+
+FIND_PATH(WIX_DIR heat.exe
+ $ENV{WIX_DIR}/bin
+ $ENV{ProgramFiles}/wix/bin
+ "$ENV{ProgramFiles}/Windows Installer XML v3/bin"
+ "$ENV{ProgramFiles}/Windows Installer XML v3.5/bin"
+)
+
+IF(NOT WIX_DIR)
+ IF(NOT _WIX_DIR_CHECKED)
+ SET(_WIX_DIR_CHECKED 1 CACHE INTERNAL "")
+ MESSAGE(STATUS "Cannot find wix 3, installer project will not be generated")
+ ENDIF()
+ RETURN()
+ENDIF()
+
+ADD_SUBDIRECTORY(ca)
+
+# extra.wxs.in needs DATADIR_MYSQL_FILES and DATADIR_PERFORMANCE_SCHEMA_FILES, i.e
+# Wix-compatible file lists for ${builddir}\sql\data\{mysql,performance_schema}
+
+FOREACH(dir mysql performance_schema)
+ FILE(GLOB files ${CMAKE_BINARY_DIR}/sql/data/${dir}/*)
+ SET(filelist)
+ FOREACH(f ${files})
+ FILE(TO_NATIVE_PATH "${f}" file_native_path)
+ GET_FILENAME_COMPONENT(file_name "${f}" NAME)
+ SET(filelist
+"${filelist}
+<File Id='${file_name}' Source='${file_native_path}'/>")
+ ENDFOREACH()
+ STRING(TOUPPER ${dir} DIR_UPPER)
+ SET(DATADIR_${DIR_UPPER}_FILES "${filelist}")
+ENDFOREACH()
+
+
+FIND_PROGRAM(HEAT_EXECUTABLE heat ${WIX_DIR})
+FIND_PROGRAM(CANDLE_EXECUTABLE candle ${WIX_DIR})
+FIND_PROGRAM(LIGHT_EXECUTABLE light ${WIX_DIR})
+
+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'")
+ELSE()
+ SET(WixWin64)
+ENDIF()
+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/extra.wxs.in
+ ${CMAKE_CURRENT_BINARY_DIR}/extra.wxs)
+
+IF(CMAKE_GENERATOR MATCHES "Visual Studio")
+ SET(CONFIG_PARAM "-DCMAKE_INSTALL_CONFIG_NAME=${CMAKE_CFG_INTDIR}")
+ENDIF()
+
+# WiX wants the license text as rtf; if there is no rtf license,
+# we create a fake one from the plain text COPYING file.
+IF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/COPYING.rtf")
+ MESSAGE("copying COPYING.rtf")
+ FILE(READ "${CMAKE_CURRENT_SOURCE_DIR}/COPYING.rtf" CONTENTS)
+ FILE(WRITE "${CMAKE_CURRENT_BINARY_DIR}/COPYING.rtf" "${CONTENTS}")
+ELSE()
+ MESSAGE("creating COPYING.rtf")
+ FILE(READ "${CMAKE_CURRENT_SOURCE_DIR}/../../COPYING" CONTENTS)
+ STRING(REGEX REPLACE "\n" "\\\\par\n" CONTENTS "${CONTENTS}")
+ STRING(REGEX REPLACE "\t" "\\\\tab" CONTENTS "${CONTENTS}")
+ FILE(WRITE "${CMAKE_CURRENT_BINARY_DIR}/COPYING.rtf" "{\\rtf1\\ansi\\deff0{\\fonttbl{\\f0\\fnil\\fcharset0 Courier New;}}\\viewkind4\\uc1\\pard\\lang1031\\f0\\fs15")
+ FILE(APPEND "${CMAKE_CURRENT_BINARY_DIR}/COPYING.rtf" "${CONTENTS}")
+ FILE(APPEND "${CMAKE_CURRENT_BINARY_DIR}/COPYING.rtf" "\n}\n")
+ENDIF()
+
+ADD_CUSTOM_TARGET(
+ MSI
+ COMMAND set VS_UNICODE_OUTPUT=
+ COMMAND ${CMAKE_COMMAND}
+ -DCPACK_WIX_CONFIG=${CMAKE_CURRENT_SOURCE_DIR}/CPackWixConfig.cmake
+ -DCPACK_WIX_INCLUDE=${CMAKE_CURRENT_BINARY_DIR}/extra.wxs
+ ${CONFIG_PARAM}
+ -P ${CMAKE_CURRENT_BINARY_DIR}/create_msi.cmake
+)
+ADD_DEPENDENCIES(MSI wixca)
+
+ADD_CUSTOM_TARGET(
+ MSI_ESSENTIALS
+ COMMAND set VS_UNICODE_OUTPUT=
+ COMMAND ${CMAKE_COMMAND} -DESSENTIALS=1
+ -DCPACK_WIX_CONFIG=${CMAKE_CURRENT_SOURCE_DIR}/CPackWixConfig.cmake
+ -DCPACK_WIX_INCLUDE=${CMAKE_CURRENT_BINARY_DIR}/extra.wxs
+ ${CONFIG_PARAM}
+ -P ${CMAKE_CURRENT_BINARY_DIR}/create_msi.cmake
+)
+ADD_DEPENDENCIES(MSI wixca)
+
diff --git a/packaging/WiX/CPackWixConfig.cmake b/packaging/WiX/CPackWixConfig.cmake
new file mode 100644
index 00000000000..9577574bbaf
--- /dev/null
+++ b/packaging/WiX/CPackWixConfig.cmake
@@ -0,0 +1,95 @@
+
+IF(ESSENTIALS)
+ MESSAGE("Essentials!")
+ SET(CPACK_COMPONENTS_USED "Server;Client;DataFiles")
+ SET(CPACK_WIX_UI "WixUI_InstallDir")
+ MATH(EXPR bits ${CMAKE_SIZEOF_VOID_P}*8)
+ SET(CPACK_PACKAGE_FILE_NAME "mysql-essentials-${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH}-win${bits}")
+ELSE()
+ SET(CPACK_COMPONENTS_USED
+ "Server;Client;DataFiles;Development;SharedLibraries;Embedded;Debuginfo;Documentation;IniFiles;Readme;Server_Scripts")
+ENDIF()
+
+
+# Some components like Embedded are optional
+# We will build MSI without embedded if it was not selected for build
+#(need to modify CPACK_COMPONENTS_ALL for that)
+SET(CPACK_ALL)
+FOREACH(comp1 ${CPACK_COMPONENTS_USED})
+ SET(found)
+ FOREACH(comp2 ${CPACK_COMPONENTS_ALL})
+ IF(comp1 STREQUAL comp2)
+ SET(found 1)
+ BREAK()
+ ENDIF()
+ ENDFOREACH()
+ IF(found)
+ SET(CPACK_ALL ${CPACK_ALL} ${comp1})
+ ENDIF()
+ENDFOREACH()
+SET(CPACK_COMPONENTS_ALL ${CPACK_ALL})
+
+# Always install (hidden), includes Readme files
+SET(CPACK_COMPONENT_GROUP_ALWAYSINSTALL_HIDDEN 1)
+SET(CPACK_COMPONENT_README_GROUP "AlwaysInstall")
+
+# Feature MySQL Server
+SET(CPACK_COMPONENT_GROUP_MYSQLSERVER_DISPLAY_NAME "MySQL Server")
+SET(CPACK_COMPONENT_GROUP_MYSQLSERVER_EXPANDED "1")
+SET(CPACK_COMPONENT_GROUP_MYSQLSERVER_DESCRIPTION "Install MySQL Server")
+ # Subfeature "Server" (hidden)
+ SET(CPACK_COMPONENT_SERVER_GROUP "MySQLServer")
+ SET(CPACK_COMPONENT_SERVER_HIDDEN 1)
+ # Subfeature "Client"
+ SET(CPACK_COMPONENT_CLIENT_GROUP "MySQLServer")
+ SET(CPACK_COMPONENT_CLIENT_DISPLAY_NAME "Client Programs")
+ SET(CPACK_COMPONENT_CLIENT_DESCRIPTION
+ "Various helpful (commandline) tools including the mysql command line client" )
+
+ #Subfeature "Data Files"
+ SET(CPACK_COMPONENT_DATAFILES_GROUP "MySQLServer")
+ SET(CPACK_COMPONENT_DATAFILES_DISPLAY_NAME "Server data files")
+ SET(CPACK_COMPONENT_DATAFILES_DESCRIPTION "Server data files" )
+
+
+#Feature "Devel"
+SET(CPACK_COMPONENT_GROUP_DEVEL_DISPLAY_NAME "Development Components")
+SET(CPACK_COMPONENT_GROUP_DEVEL_DESCRIPTION "Installs C/C++ header files and libraries")
+ #Subfeature "Development"
+ SET(CPACK_COMPONENT_DEVELOPMENT_GROUP "Devel")
+ SET(CPACK_COMPONENT_DEVELOPMENT_HIDDEN 1)
+
+ #Subfeature "Shared libraries"
+ SET(CPACK_COMPONENT_SHAREDLIBRARIES_GROUP "Devel")
+ SET(CPACK_COMPONENT_SHAREDLIBRARIES_DISPLAY_NAME "Client C API library (shared)")
+ SET(CPACK_COMPONENT_SHAREDLIBRARIES_DESCRIPTION "Installs shared client library")
+
+ #Subfeature "Embedded"
+ SET(CPACK_COMPONENT_EMBEDDED_GROUP "Devel")
+ SET(CPACK_COMPONENT_EMBEDDED_DISPLAY_NAME "Embedded server library")
+ SET(CPACK_COMPONENT_EMBEDDED_DESCRIPTION "Installs embedded server library")
+ SET(CPACK_COMPONENT_EMBEDDED_WIX_LEVEL 2)
+
+#Feature Debug Symbols
+SET(CPACK_COMPONENT_GROUP_DEBUGSYMBOLS_DISPLAY_NAME "Debug Symbols")
+SET(CPACK_COMPONENT_GROUP_DEBUGSYMBOLS_DESCRIPTION "Installs Debug Symbols")
+SET(CPACK_COMPONENT_GROUP_DEBUGSYMBOLS_WIX_LEVEL 2)
+ SET(CPACK_COMPONENT_DEBUGINFO_GROUP "DebugSymbols")
+ SET(CPACK_COMPONENT_DEBUGINFO_HIDDEN 1)
+
+#Feature Documentation
+SET(CPACK_COMPONENT_DOCUMENTATION_DISPLAY_NAME "Documentation")
+SET(CPACK_COMPONENT_DOCUMENTATION_DESCRIPTION "Installs documentation")
+SET(CPACK_COMPONENT_DOCUMENTATION_WIX_LEVEL 2)
+
+#Feature tests
+SET(CPACK_COMPONENT_TEST_DISPLAY_NAME "Tests")
+SET(CPACK_COMPONENT_TEST_DESCRIPTION "Installs unittests (requires Perl to run)")
+SET(CPACK_COMPONENT_TEST_WIX_LEVEL 2)
+
+
+#Feature Misc (hidden, installs only if everything is installed)
+SET(CPACK_COMPONENT_GROUP_MISC_HIDDEN 1)
+SET(CPACK_COMPONENT_GROUP_MISC_WIX_LEVEL 100)
+ SET(CPACK_COMPONENT_INIFILES_GROUP "Misc")
+ SET(CPACK_COMPONENT_SERVER_SCRIPTS_GROUP "Misc")
diff --git a/packaging/WiX/MySQLServer.ico b/packaging/WiX/MySQLServer.ico
new file mode 100644
index 00000000000..a471afcda95
--- /dev/null
+++ b/packaging/WiX/MySQLServer.ico
Binary files differ
diff --git a/packaging/WiX/ca/CMakeLists.txt b/packaging/WiX/ca/CMakeLists.txt
new file mode 100644
index 00000000000..c74b51284c7
--- /dev/null
+++ b/packaging/WiX/ca/CMakeLists.txt
@@ -0,0 +1,27 @@
+# Copyright 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+INCLUDE_DIRECTORIES(${WIX_DIR}/../SDK/inc)
+LINK_DIRECTORIES(${WIX_DIR}/../SDK/lib)
+
+SET(WIXCA_SOURCES CustomAction.cpp CustomAction.rc CustomAction.def)
+
+IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
+ LINK_LIBRARIES(wcautil_x64 dutil_x64 msi version)
+ELSE()
+ LINK_LIBRARIES(wcautil dutil msi version)
+ENDIF()
+
+ADD_LIBRARY(wixca SHARED ${WIXCA_SOURCES})
diff --git a/packaging/WiX/ca/CustomAction.cpp b/packaging/WiX/ca/CustomAction.cpp
new file mode 100644
index 00000000000..806535bc79a
--- /dev/null
+++ b/packaging/WiX/ca/CustomAction.cpp
@@ -0,0 +1,188 @@
+/* Copyright 2010, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+#ifndef UNICODE
+#define UNICODE
+#endif
+
+#include <windows.h>
+#include <winreg.h>
+#include <msi.h>
+#include <msiquery.h>
+#include <wcautil.h>
+#include <string.h>
+#include <strsafe.h>
+
+/*
+ * Search the registry for a service whose ImagePath starts
+ * with our install directory. Stop and remove it if requested.
+ */
+static TCHAR last_service_name[128];
+int remove_service(TCHAR *installdir, int check_only) {
+ HKEY hKey;
+ int done = 0;
+
+ if(wcslen(installdir) < 3) {
+ WcaLog(LOGMSG_STANDARD, "INSTALLDIR is suspiciously short, better not do anything.");
+ return 0;
+ }
+
+ if(check_only == 0) {
+ WcaLog(LOGMSG_STANDARD, "Determining number of matching services...");
+ int servicecount = remove_service(installdir, 1);
+ if(servicecount <= 0) {
+ WcaLog(LOGMSG_STANDARD, "No services found, not removing anything.");
+ return 0;
+ } else if(servicecount == 1) {
+ TCHAR buf[256];
+ swprintf_s(buf, sizeof(buf), TEXT("There is a service called '%ls' set up to run from this installation. Do you wish me to stop and remove that service?"), last_service_name);
+ int rc = MessageBox(NULL, buf, TEXT("Removing MySQL Server"), MB_ICONQUESTION|MB_YESNOCANCEL|MB_SYSTEMMODAL);
+ if(rc == IDCANCEL) return -1;
+ if(rc != IDYES) return 0;
+ } else if(servicecount > 0) {
+ TCHAR buf[256];
+ swprintf_s(buf, sizeof(buf), TEXT("There appear to be %d services set up to run from this installation. Do you wish me to stop and remove those services?"), servicecount);
+ int rc = MessageBox(NULL, buf, TEXT("Removing MySQL Server"), MB_ICONQUESTION|MB_YESNOCANCEL|MB_SYSTEMMODAL);
+ if(rc == IDCANCEL) return -1;
+ if(rc != IDYES) return 0;
+ }
+ }
+
+ if(check_only == -1) check_only = 0;
+
+ WcaLog(LOGMSG_STANDARD, "Looking for service...");
+ WcaLog(LOGMSG_STANDARD, "INSTALLDIR = %ls", installdir);
+ if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, TEXT("SYSTEM\\CurrentControlSet\\services"), 0, KEY_READ, &hKey)==ERROR_SUCCESS) {
+ DWORD index = 0;
+ TCHAR keyname[1024];
+ DWORD keylen = sizeof(keyname);
+ FILETIME t;
+ /* Go through all services in the registry */
+ while(RegEnumKeyExW(hKey, index, keyname, &keylen, NULL, NULL, NULL, &t) == ERROR_SUCCESS) {
+ HKEY hServiceKey = 0;
+ TCHAR path[1024];
+ DWORD pathlen = sizeof(path)-1;
+ if (RegOpenKeyExW(hKey, keyname, NULL, KEY_READ, &hServiceKey) == ERROR_SUCCESS) {
+ /* Look at the ImagePath value of each service */
+ if (RegQueryValueExW(hServiceKey, TEXT("ImagePath"), NULL, NULL, (LPBYTE)path, &pathlen) == ERROR_SUCCESS) {
+ path[pathlen] = 0;
+ TCHAR *p = path;
+ if(p[0] == '"') p += 1;
+ /* See if it is similar to our install directory */
+ if(wcsncmp(p, installdir, wcslen(installdir)) == 0) {
+ WcaLog(LOGMSG_STANDARD, "Found service '%ls' with ImagePath '%ls'.", keyname, path);
+ swprintf_s(last_service_name, sizeof(last_service_name), TEXT("%ls"), keyname);
+ /* If we are supposed to stop and remove the service... */
+ if(!check_only) {
+ WcaLog(LOGMSG_STANDARD, "Trying to stop the service.");
+ SC_HANDLE hSCM = NULL;
+ hSCM = OpenSCManager(NULL, NULL, SC_MANAGER_CONNECT);
+ if(hSCM != NULL) {
+ SC_HANDLE hService = NULL;
+ hService = OpenService(hSCM, keyname, SERVICE_STOP|SERVICE_QUERY_STATUS|DELETE);
+ if(hService != NULL) {
+ WcaLog(LOGMSG_STANDARD, "Waiting for the service to stop...");
+ SERVICE_STATUS status;
+ /* Attempt to stop the service */
+ if(ControlService(hService, SERVICE_CONTROL_STOP, &status)) {
+ /* Now wait until it's stopped */
+ while("it's one big, mean and cruel world out there") {
+ if(!QueryServiceStatus(hService, &status)) break;
+ if(status.dwCurrentState == SERVICE_STOPPED) break;
+ Sleep(1000);
+ }
+ WcaLog(LOGMSG_STANDARD, "Stopped the service.");
+ }
+ /* Mark the service for deletion */
+ DeleteService(hService);
+ CloseServiceHandle(hService);
+ }
+ CloseServiceHandle(hSCM);
+ }
+ }
+ done++;
+ }
+ }
+ RegCloseKey(hServiceKey);
+ }
+ index++;
+ keylen = sizeof(keyname)-1;
+ }
+ RegCloseKey(hKey);
+ } else {
+ WcaLog(LOGMSG_STANDARD, "Can't seem to go through the list of installed services in the registry.");
+ }
+ return done;
+}
+
+UINT wrap(MSIHANDLE hInstall, char *name, int check_only) {
+ HRESULT hr = S_OK;
+ UINT er = ERROR_SUCCESS;
+
+ hr = WcaInitialize(hInstall, name);
+ ExitOnFailure(hr, "Failed to initialize");
+
+ WcaLog(LOGMSG_STANDARD, "Initialized.");
+
+ TCHAR INSTALLDIR[1024];
+ DWORD INSTALLDIR_size = sizeof(INSTALLDIR);
+ if(MsiGetPropertyW(hInstall, TEXT("CustomActionData"), INSTALLDIR, &INSTALLDIR_size) == ERROR_SUCCESS) {
+ int rc = remove_service(INSTALLDIR, check_only);
+ if(rc < 0) {
+ er = ERROR_CANCELLED;
+ }
+ } else {
+ er = ERROR_CANT_ACCESS_FILE;
+ }
+
+LExit:
+ return WcaFinalize(er);
+}
+
+UINT __stdcall RemoveServiceNoninteractive(MSIHANDLE hInstall)
+{
+ return wrap(hInstall, "RemoveServiceNoninteractive", -1);
+}
+
+UINT __stdcall RemoveService(MSIHANDLE hInstall)
+{
+ return wrap(hInstall, "RemoveService", 0);
+}
+
+UINT __stdcall TestService(MSIHANDLE hInstall)
+{
+ return wrap(hInstall, "TestService", 1);
+}
+
+/* DllMain - Initialize and cleanup WiX custom action utils */
+extern "C" BOOL WINAPI DllMain(
+ __in HINSTANCE hInst,
+ __in ULONG ulReason,
+ __in LPVOID
+ )
+{
+ switch(ulReason)
+ {
+ case DLL_PROCESS_ATTACH:
+ WcaGlobalInitialize(hInst);
+ break;
+
+ case DLL_PROCESS_DETACH:
+ WcaGlobalFinalize();
+ break;
+ }
+
+ return TRUE;
+}
diff --git a/packaging/WiX/ca/CustomAction.def b/packaging/WiX/ca/CustomAction.def
new file mode 100644
index 00000000000..5f5e6630013
--- /dev/null
+++ b/packaging/WiX/ca/CustomAction.def
@@ -0,0 +1,8 @@
+LIBRARY "wixca"
+VERSION 1.0
+
+EXPORTS
+
+RemoveService
+RemoveServiceNoninteractive
+TestService
diff --git a/packaging/WiX/ca/CustomAction.rc b/packaging/WiX/ca/CustomAction.rc
new file mode 100644
index 00000000000..3f37126ee77
--- /dev/null
+++ b/packaging/WiX/ca/CustomAction.rc
@@ -0,0 +1,18 @@
+#include "afxres.h"
+#undef APSTUDIO_READONLY_SYMBOLS
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 1,0,0,1
+ PRODUCTVERSION 1,0,0,1
+ FILEFLAGSMASK 0x17L
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x0L
+ FILESUBTYPE 0x0L
+BEGIN
+END
+
diff --git a/packaging/WiX/create_msi.cmake.in b/packaging/WiX/create_msi.cmake.in
new file mode 100644
index 00000000000..ff18009fd0c
--- /dev/null
+++ b/packaging/WiX/create_msi.cmake.in
@@ -0,0 +1,311 @@
+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(MAJOR_VERSION "@MAJOR_VERSION@")
+SET(MINOR_VERSION "@MINOR_VERSION@")
+SET(PATCH "@PATCH@")
+SET(CMAKE_SIZEOF_VOID_P @CMAKE_SIZEOF_VOID_P@)
+SET(MANUFACTURER "@MANUFACTURER@")
+
+IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
+ SET(Win64 " Win64='yes'")
+ SET(Platform x64)
+ SET(PlatformProgramFilesFolder ProgramFiles64Folder)
+ELSE()
+ SET(Platform x86)
+ SET(PlatformProgramFilesFolder ProgramFilesFolder)
+ SET(Win64)
+ENDIF()
+
+SET(ENV{VS_UNICODE_OUTPUT})
+
+INCLUDE(${CMAKE_BINARY_DIR}/CPackConfig.cmake)
+
+IF(CPACK_WIX_CONFIG)
+ INCLUDE(${CPACK_WIX_CONFIG})
+ENDIF()
+
+IF(NOT CPACK_WIX_UI)
+ SET(CPACK_WIX_UI "WixUI_Mondo")
+ENDIF()
+
+SET(WIX_FEATURES)
+FOREACH(comp ${CPACK_COMPONENTS_ALL})
+ STRING(TOUPPER "${comp}" comp_upper)
+ IF(NOT CPACK_COMPONENT_${comp_upper}_GROUP)
+ SET(WIX_FEATURE_${comp_upper}_COMPONENTS "${comp}")
+ SET(CPACK_COMPONENT_${comp_upper}_HIDDEN 1)
+ SET(CPACK_COMPONENT_GROUP_${comp_upper}_DISPLAY_NAME ${CPACK_COMPONENT_${comp_upper}_DISPLAY_NAME})
+ SET(CPACK_COMPONENT_GROUP_${comp_upper}_DESCRIPTION ${CPACK_COMPONENT_${comp_upper}_DESCRIPTION})
+ SET(CPACK_COMPONENT_GROUP_${comp_upper}_WIX_LEVEL ${CPACK_COMPONENT_${comp_upper}_WIX_LEVEL})
+ SET(WIX_FEATURES ${WIX_FEATURES} WIX_FEATURE_${comp_upper})
+ ELSE()
+ SET(FEATURE_NAME WIX_FEATURE_${CPACK_COMPONENT_${comp_upper}_GROUP})
+ SET(WIX_FEATURES ${WIX_FEATURES} ${FEATURE_NAME})
+ LIST(APPEND ${FEATURE_NAME}_COMPONENTS ${comp})
+ ENDIF()
+ENDFOREACH()
+
+LIST(REMOVE_DUPLICATES WIX_FEATURES)
+
+SET(CPACK_WIX_FEATURES)
+
+FOREACH(f ${WIX_FEATURES})
+ STRING(TOUPPER "${f}" f_upper)
+ STRING(REPLACE "WIX_FEATURE_" "" f_upper ${f_upper})
+ IF (CPACK_COMPONENT_GROUP_${f_upper}_DISPLAY_NAME)
+ SET(TITLE ${CPACK_COMPONENT_GROUP_${f_upper}_DISPLAY_NAME})
+ ELSE()
+ SET(TITLE CPACK_COMPONENT_GROUP_${f_upper}_DISPLAY_NAME)
+ ENDIF()
+
+ IF (CPACK_COMPONENT_GROUP_${f_upper}_DESCRIPTION)
+ SET(DESCRIPTION ${CPACK_COMPONENT_GROUP_${f_upper}_DESCRIPTION})
+ ELSE()
+ SET(DESCRIPTION CPACK_COMPONENT_GROUP_${f_upper}_DESCRIPTION)
+ ENDIF()
+ IF(CPACK_COMPONENT_${f_upper}_WIX_LEVEL)
+ SET(Level ${CPACK_COMPONENT_${f_upper}_WIX_LEVEL})
+ ELSE()
+ SET(Level 1)
+ ENDIF()
+ IF(CPACK_COMPONENT_GROUP_${f_upper}_HIDDEN)
+ SET(DISPLAY "Display='hidden'")
+ SET(TITLE ${f_upper})
+ SET(DESCRIPTION ${f_upper})
+ ELSE()
+ SET(DISPLAY)
+ IF(CPACK_COMPONENT_GROUP_${f_upper}_EXPANDED)
+ SET(DISPLAY "Display='expand'")
+ ENDIF()
+ IF (CPACK_COMPONENT_GROUP_${f_upper}_DISPLAY_NAME)
+ SET(TITLE ${CPACK_COMPONENT_GROUP_${f_upper}_DISPLAY_NAME})
+ ELSE()
+ SET(TITLE CPACK_COMPONENT_GROUP_${f_upper}_DISPLAY_NAME)
+ ENDIF()
+ IF (CPACK_COMPONENT_GROUP_${f_upper}_DESCRIPTION)
+ SET(DESCRIPTION ${CPACK_COMPONENT_GROUP_${f_upper}_DESCRIPTION})
+ ELSE()
+ SET(DESCRIPTION CPACK_COMPONENT_GROUP_${f_upper}_DESCRIPTION)
+ ENDIF()
+ ENDIF()
+
+ SET(CPACK_WIX_FEATURES
+ "${CPACK_WIX_FEATURES}
+ <Feature Id='${f_upper}'
+ Title='${TITLE}'
+ Description='${DESCRIPTION}'
+ ConfigurableDirectory='INSTALLDIR'
+ Level='${Level}' ${DISPLAY} >"
+ )
+ FOREACH(c ${${f}_COMPONENTS})
+ STRING(TOUPPER "${c}" c_upper)
+ IF (CPACK_COMPONENT_${c_upper}_DISPLAY_NAME)
+ SET(TITLE ${CPACK_COMPONENT_${c_upper}_DISPLAY_NAME})
+ ELSE()
+ SET(TITLE CPACK_COMPONENT_${c_upper}_DISPLAY_NAME)
+ ENDIF()
+
+ IF (CPACK_COMPONENT_${c_upper}_DESCRIPTION)
+ SET(DESCRIPTION ${CPACK_COMPONENT_${c_upper}_DESCRIPTION})
+ ELSE()
+ SET(DESCRIPTION CPACK_COMPONENT_${c_upper}_DESCRIPTION)
+ ENDIF()
+ IF(CPACK_COMPONENT_${c_upper}_WIX_LEVEL)
+ SET(Level ${CPACK_COMPONENT_${c_upper}_WIX_LEVEL})
+ ELSE()
+ SET(Level 1)
+ ENDIF()
+ IF(CPACK_COMPONENT_${c_upper}_HIDDEN)
+ SET(CPACK_WIX_FEATURES
+ "${CPACK_WIX_FEATURES}
+ <ComponentGroupRef Id='componentgroup.${c}'/>")
+ ELSE()
+ SET(CPACK_WIX_FEATURES
+ "${CPACK_WIX_FEATURES}
+ <Feature Id='${c}'
+ Title='${TITLE}'
+ Description='${DESCRIPTION}'
+ ConfigurableDirectory='INSTALLDIR'
+ Level='${Level}'>
+ <ComponentGroupRef Id='componentgroup.${c}'/>
+ </Feature>")
+ ENDIF()
+
+ ENDFOREACH()
+ SET(CPACK_WIX_FEATURES
+ "${CPACK_WIX_FEATURES}
+ </Feature>
+ ")
+ENDFOREACH()
+
+
+
+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql_server.wxs.in
+ ${CMAKE_CURRENT_BINARY_DIR}/mysql_server.wxs)
+
+
+IF(CMAKE_INSTALL_CONFIG_NAME)
+ SET(CONFIG_PARAM "-DCMAKE_INSTALL_CONFIG_NAME=${CMAKE_INSTALL_CONFIG_NAME}")
+ENDIF()
+
+FOREACH(comp ${CPACK_COMPONENTS_ALL})
+ SET(ENV{DESTDIR} testinstall/${comp})
+ SET(DIRS ${DIRS} testinstall/${comp})
+ EXECUTE_PROCESS(
+ COMMAND ${CMAKE_COMMAND} ${CONFIG_PARAM} -DCMAKE_INSTALL_COMPONENT=${comp}
+ -DCMAKE_INSTALL_PREFIX= -P ${CMAKE_BINARY_DIR}/cmake_install.cmake
+ OUTPUT_QUIET
+ )
+ENDFOREACH()
+
+MACRO(GENERATE_GUID VarName)
+ EXECUTE_PROCESS(COMMAND uuidgen -c
+ OUTPUT_VARIABLE ${VarName}
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ENDMACRO()
+
+SET(INC_VAR 0)
+MACRO(MAKE_WIX_IDENTIFIER str varname)
+ STRING(REPLACE "/" "." ${varname} "${str}")
+ STRING(REGEX REPLACE "[^a-zA-Z_0-9.]" "_" ${varname} "${${varname}}")
+ STRING(LENGTH "${${varname}}" len)
+ # Identifier should be smaller than 72 character
+ # We have to cut down the length to 70 chars, since we add 2 char prefix
+ # pretty often
+ IF(len GREATER 70)
+ STRING(SUBSTRING "${${varname}}" 0 67 shortstr)
+ MATH(EXPR INC_VAR ${INC_VAR}+1)
+ SET(${varname} "${shortstr}${INC_VAR}")
+ ENDIF()
+ENDMACRO()
+
+
+FUNCTION(TRAVERSE_FILES dir topdir file file_comp dir_root)
+ FILE(GLOB all_files ${dir}/*)
+ IF(NOT all_files)
+ RETURN()
+ ENDIF()
+ FILE(RELATIVE_PATH dir_rel ${topdir} ${dir})
+ IF(dir_rel)
+ MAKE_DIRECTORY(${dir_root}/${dir_rel})
+ MAKE_WIX_IDENTIFIER("${dir_rel}" id)
+ SET(DirectoryRefId "D.${id}")
+ ELSE()
+ SET(DirectoryRefId "INSTALLDIR")
+ ENDIF()
+ FILE(APPEND ${file} "<DirectoryRef Id='${DirectoryRefId}'>\n")
+
+ SET(NONEXEFILES)
+ FOREACH(f ${all_files})
+ IF(NOT IS_DIRECTORY ${f})
+ FILE(RELATIVE_PATH rel ${topdir} ${f})
+ MAKE_WIX_IDENTIFIER("${rel}" id)
+ FILE(TO_NATIVE_PATH ${f} f_native)
+ GET_FILENAME_COMPONENT(f_ext "${f}" EXT)
+ # According to MSDN each DLL or EXE should be in the own component
+ IF(f_ext MATCHES ".exe" OR f_ext MATCHES ".dll")
+
+ FILE(APPEND ${file} " <Component Id='C.${id}' Guid='*' ${Win64}>\n")
+ FILE(APPEND ${file} " <File Id='F.${id}' KeyPath='yes' Source='${f_native}'/>\n")
+ FILE(APPEND ${file} " </Component>\n")
+ FILE(APPEND ${file_comp} " <ComponentRef Id='C.${id}'/>\n")
+ ELSE()
+ SET(NONEXEFILES "${NONEXEFILES}\n<File Id='F.${id}' Source='${f_native}'/>" )
+ ENDIF()
+ ENDIF()
+ ENDFOREACH()
+ FILE(APPEND ${file} "</DirectoryRef>\n")
+ IF(NONEXEFILES)
+ GENERATE_GUID(guid)
+ SET(ComponentId "C._files_${COMP_NAME}.${DirectoryRefId}")
+ FILE(APPEND ${file}
+ "<DirectoryRef Id='${DirectoryRefId}'>\n<Component Guid='${guid}' Id='${ComponentId}' ${Win64}>${NONEXEFILES}\n</Component></DirectoryRef>\n")
+ FILE(APPEND ${file_comp} " <ComponentRef Id='${ComponentId}'/>\n")
+ ENDIF()
+ FOREACH(f ${all_files})
+ IF(IS_DIRECTORY ${f})
+ TRAVERSE_FILES(${f} ${topdir} ${file} ${file_comp} ${dir_root})
+ ENDIF()
+ ENDFOREACH()
+ENDFUNCTION()
+
+FUNCTION(TRAVERSE_DIRECTORIES dir topdir file prefix)
+ FILE(RELATIVE_PATH rel ${topdir} ${dir})
+ IF(rel AND IS_DIRECTORY "${f}")
+ MAKE_WIX_IDENTIFIER("${rel}" id)
+ GET_FILENAME_COMPONENT(name ${dir} NAME)
+ FILE(APPEND ${file} "${prefix}<Directory Id='D.${id}' Name='${name}'>\n")
+ ENDIF()
+ FILE(GLOB all_files ${dir}/*)
+ FOREACH(f ${all_files})
+ IF(IS_DIRECTORY ${f})
+ TRAVERSE_DIRECTORIES(${f} ${topdir} ${file} "${prefix} ")
+ ENDIF()
+ ENDFOREACH()
+ IF(rel AND IS_DIRECTORY "${f}")
+ FILE(APPEND ${file} "${prefix}</Directory>\n")
+ ENDIF()
+ENDFUNCTION()
+
+SET(CPACK_WIX_COMPONENTS)
+SET(CPACK_WIX_COMPONENT_GROUPS)
+GET_FILENAME_COMPONENT(abs . ABSOLUTE)
+FOREACH(d ${DIRS})
+ GET_FILENAME_COMPONENT(d ${d} ABSOLUTE)
+ GET_FILENAME_COMPONENT(d_name ${d} NAME)
+ FILE(WRITE ${abs}/${d_name}_component_group.wxs "<ComponentGroup Id='componentgroup.${d_name}'>")
+ SET(COMP_NAME ${d_name})
+ TRAVERSE_FILES(${d} ${d} ${abs}/${d_name}.wxs ${abs}/${d_name}_component_group.wxs "${abs}/dirs")
+ FILE(APPEND ${abs}/${d_name}_component_group.wxs "</ComponentGroup>")
+ FILE(READ ${d_name}.wxs WIX_TMP)
+ SET(CPACK_WIX_COMPONENTS "${CPACK_WIX_COMPONENTS}\n${WIX_TMP}")
+ FILE(REMOVE ${d_name}.wxs)
+ FILE(READ ${d_name}_component_group.wxs WIX_TMP)
+
+ SET(CPACK_WIX_COMPONENT_GROUPS "${CPACK_WIX_COMPONENT_GROUPS}\n${WIX_TMP}")
+ FILE(REMOVE ${d_name}_component_group.wxs)
+ENDFOREACH()
+
+FILE(WRITE directories.wxs "<DirectoryRef Id='INSTALLDIR'>\n")
+TRAVERSE_DIRECTORIES(${abs}/dirs ${abs}/dirs directories.wxs "")
+FILE(APPEND directories.wxs "</DirectoryRef>\n")
+
+FILE(READ directories.wxs CPACK_WIX_DIRECTORIES)
+FILE(REMOVE directories.wxs)
+
+
+FOREACH(src ${CPACK_WIX_INCLUDE})
+SET(CPACK_WIX_INCLUDES
+"${CPACK_WIX_INCLUDES}
+ <?include ${src}?>"
+)
+ENDFOREACH()
+
+
+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql_server.wxs.in
+ ${CMAKE_CURRENT_BINARY_DIR}/mysql_server.wxs)
+
+SET(EXTRA_CANDLE_ARGS)
+IF("$ENV{EXTRA_CANDLE_ARGS}")
+ SET(EXTRA_CANDLE_ARGS "$ENV{EXTRA_CANDLE_ARGS}")
+ENDIF()
+
+SET(EXTRA_LIGHT_ARGS)
+IF("$ENV{EXTRA_LIGHT_ARGS}")
+ SET(EXTRA_LIGHT_ARGS "$ENV{EXTRA_LIGHT_ARGS}")
+ENDIF()
+
+FILE(REMOVE mysql_server.wixobj)
+EXECUTE_PROCESS(
+ COMMAND ${CANDLE_EXECUTABLE} -ext WixUtilExtension mysql_server.wxs ${EXTRA_CANDLE_ARGS}
+)
+EXECUTE_PROCESS(
+ COMMAND ${LIGHT_EXECUTABLE} -ext WixUIExtension -ext WixUtilExtension
+ mysql_server.wixobj -out ${CPACK_PACKAGE_FILE_NAME}.msi
+ ${EXTRA_LIGHT_ARGS}
+)
+
diff --git a/packaging/WiX/extra.wxs.in b/packaging/WiX/extra.wxs.in
new file mode 100644
index 00000000000..b6c42136129
--- /dev/null
+++ b/packaging/WiX/extra.wxs.in
@@ -0,0 +1,60 @@
+<Include xmlns="http://schemas.microsoft.com/wix/2006/wi"
+ xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
+
+ <!-- Datafiles that installation will copy to CommonAppData (initial database)
+ They are declared Permanent and NeverOverwrite since it is user data -->
+ <DirectoryRef Id='TARGETDIR'>
+ <Directory Id="CommonAppDataFolder">
+ <Directory Id="datadir.mysql" Name="MySQL">
+ <Directory Id="datadir.mysql.mysqlserver"
+ Name="MySQL Server @MAJOR_VERSION@.@MINOR_VERSION@">
+ <Directory Id="DATADIR" Name=".">
+ <Component Id="component.datadir" Guid="d3491319-5dbc-4477-95f3-4f809ef1dd2d">
+ <CreateFolder>
+ <util:PermissionEx User="[LogonUser]" GenericAll="yes" />
+ </CreateFolder>
+ </Component>
+ <Directory Id="datadir.mysql.mysqlserver.data" Name="data">
+ <Directory Id="datadir.mysql.mysqlserver.data.mysql" Name="mysql">
+ <Component Id="component.datadir.mysql"
+ Guid="19ec0f1f-1a7f-424e-a788-b09346c0a709"
+ Permanent="yes" NeverOverwrite="yes">
+ <CreateFolder>
+ <util:PermissionEx User="[LogonUser]" GenericAll="yes" />
+ </CreateFolder>
+ @DATADIR_MYSQL_FILES@
+ </Component>
+ </Directory>
+ <Directory Id="datadir.mysql.mysqlserver.data.performance_schema"
+ Name="performance_schema">
+ <Component Id="component.datadir.performance_schema"
+ Guid="af2a6776-2655-431f-a748-9e9f4645acc3"
+ Permanent="yes" NeverOverwrite="yes">
+ <CreateFolder>
+ <util:PermissionEx User="[LogonUser]" GenericAll="yes" />
+ </CreateFolder>
+ @DATADIR_PERFORMANCE_SCHEMA_FILES@
+ </Component>
+ </Directory>
+ <Directory Id="datadir.mysql.mysqlserver.data.test" Name="test">
+ <Component Id="component.datadir.test" Guid="52fa9f0a-fcd1-420a-b2ac-95a8f70ad20a">
+ <CreateFolder/>
+ </Component>
+ </Directory>
+ </Directory>
+ </Directory>
+ </Directory>
+ </Directory>
+ </Directory>
+ </DirectoryRef>
+
+ <Feature Id="UserEditableDatafiles" Level='1' Display='hidden' ConfigurableDirectory="DATADIR">
+ <ComponentRef Id="component.datadir"/>
+ <ComponentRef Id="component.datadir.mysql"/>
+ <ComponentRef Id="component.datadir.performance_schema"/>
+ <ComponentRef Id="component.datadir.test"/>
+ </Feature>
+</Include>
+
+
+
diff --git a/packaging/WiX/mysql_server.wxs.in b/packaging/WiX/mysql_server.wxs.in
new file mode 100644
index 00000000000..8b20644e58d
--- /dev/null
+++ b/packaging/WiX/mysql_server.wxs.in
@@ -0,0 +1,114 @@
+<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
+ xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
+ <Product
+ Id="*"
+ UpgradeCode="49EB7A6A-1CEF-4A1E-9E89-B9A4993963E3"
+ Name="MySQL Server @MAJOR_VERSION@.@MINOR_VERSION@"
+ Version="@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH@"
+ Language="1033"
+ Manufacturer="@MANUFACTURER@">
+
+ <Package Id='*'
+ Keywords='Installer'
+ Description="MySQL Database Server"
+ Manufacturer='@MANUFACTURER@'
+ InstallerVersion='200'
+ Languages='1033'
+ Compressed='yes'
+ SummaryCodepage='1252'
+ Platform='@Platform@'/>
+
+ <Media Id='1' Cabinet='product.cab' EmbedCab='yes' />
+
+ <!-- Upgrade -->
+ <Upgrade Id="49EB7A6A-1CEF-4A1E-9E89-B9A4993963E3">
+ <UpgradeVersion
+ Minimum="@MAJOR_VERSION@.@MINOR_VERSION@.0"
+ IncludeMinimum="yes"
+ Maximum="@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH@"
+ Property="OLDERVERSIONBEINGUPGRADED" />
+ <UpgradeVersion
+ Minimum="@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH@"
+ OnlyDetect="yes"
+ Property="NEWERVERSIONDETECTED" />
+ </Upgrade>
+ <Condition Message="A later version of [ProductName] is already installed. Setup will now exit.">
+ NOT NEWERVERSIONDETECTED OR Installed
+ </Condition>
+ <InstallExecuteSequence>
+ <RemoveExistingProducts After="InstallInitialize"/>
+ </InstallExecuteSequence>
+
+
+ <!-- UI -->
+ <Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR"></Property>
+ <UIRef Id="@CPACK_WIX_UI@" />
+ <UIRef Id="WixUI_ErrorProgressText" />
+ <WixVariable
+ Id="WixUIBannerBmp"
+ Value="@CMAKE_CURRENT_SOURCE_DIR@/AdminHeader.jpg" />
+ <WixVariable
+ Id="WixUIDialogBmp"
+ Value="@CMAKE_CURRENT_SOURCE_DIR@/AdminBackground.jpg" />
+ <Icon
+ Id="icon.ico"
+ SourceFile="@CMAKE_CURRENT_SOURCE_DIR@/MySQLServer.ico"/>
+ <Property
+ Id="ARPPRODUCTICON"
+ Value="icon.ico" />
+
+ <!-- License -->
+ <WixVariable
+ Id="WixUILicenseRtf"
+ Value="@CMAKE_CURRENT_BINARY_DIR@/COPYING.rtf"/>
+
+ <!-- How to remove the service on uninstall -->
+ <Binary Id='wixca.dll' SourceFile='@CMAKE_CURRENT_BINARY_DIR@/ca/RelWithDebInfo/wixca.dll' />
+ <CustomAction Id="UnregisterProperty" Property="UnregisterService" Value="[INSTALLDIR]" Return="check" />
+ <CustomAction Id="UnregisterPropertySilent" Property="UnregisterServiceSilently" Value="[INSTALLDIR]" Return="check" />
+ <CustomAction Id="UnregisterService"
+ BinaryKey="wixca.dll"
+ DllEntry="RemoveService"
+ Execute="deferred"
+ Impersonate="no"
+ Return="check" />
+ <CustomAction Id="UnregisterServiceSilently"
+ BinaryKey="wixca.dll"
+ DllEntry="RemoveServiceNoninteractive"
+ Execute="deferred"
+ Impersonate="no"
+ Return="check" />
+ <InstallExecuteSequence>
+ <Custom Action="UnregisterProperty" After="InstallInitialize">Installed And Not UPGRADINGPRODUCTCODE</Custom>
+ <Custom Action="UnregisterPropertySilent" After="InstallInitialize">Installed And Not UPGRADINGPRODUCTCODE</Custom>
+ <Custom Action="UnregisterService" After="UnregisterProperty">Installed And Not UPGRADINGPRODUCTCODE And UILevel&gt;2</Custom>
+ <Custom Action="UnregisterServiceSilently" After="UnregisterPropertySilent">Installed And Not UPGRADINGPRODUCTCODE And UILevel&lt;=2</Custom>
+ </InstallExecuteSequence>
+
+ <!-- Installation root-->
+ <Directory Id='TARGETDIR' Name='SourceDir'>
+ <Directory Id='@PlatformProgramFilesFolder@'>
+ <Directory Id='directory.MySQL' Name='MySQL'>
+ <Directory Id='INSTALLDIR' Name='MySQL Server @MAJOR_VERSION@.@MINOR_VERSION@'>
+ </Directory>
+ </Directory>
+ </Directory>
+ </Directory>
+
+ <!-- CPACK_WIX_FEATURES -->
+ @CPACK_WIX_FEATURES@
+
+ <!-- CPACK_WIX_DIRECTORIES -->
+ @CPACK_WIX_DIRECTORIES@
+
+ <!--CPACK_WIX_COMPONENTS-->
+ @CPACK_WIX_COMPONENTS@
+
+ <!--CPACK_WIX_COMPONENTS_GROUPS -->
+ @CPACK_WIX_COMPONENT_GROUPS@
+
+ <!--CPACK_WIX_INCLUDES -->
+ @CPACK_WIX_INCLUDES@
+ </Product>
+
+</Wix> \ No newline at end of file