Commit 5c4e95f8 authored by Bo Thorsen's avatar Bo Thorsen

Implement an NSIS based installer

parent f7d6a2ed
...@@ -333,3 +333,78 @@ IF(WITH_EMBEDDED_SERVER) ...@@ -333,3 +333,78 @@ IF(WITH_EMBEDDED_SERVER)
ADD_SUBDIRECTORY(libmysqld/examples) ADD_SUBDIRECTORY(libmysqld/examples)
ENDIF(WITH_EMBEDDED_SERVER) ENDIF(WITH_EMBEDDED_SERVER)
ADD_SUBDIRECTORY(mysql-test/lib/My/SafeProcess) ADD_SUBDIRECTORY(mysql-test/lib/My/SafeProcess)
# Set up the installer
SET(CPACK_PACKAGE_NAME "MariaDB")
STRING(REPLACE "-MariaDB" "" CPACK_PACKAGE_VERSION ${VERSION})
SET(CPACK_PACKAGE_VENDOR "Monty Program AB http://www.montyprogram.com")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MariaDB")
SET(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/COPYING)
SET(CPACK_GENERATOR NSIS)
# Installer components and grouping
SET(CPACK_COMPONENT_GROUP_SERVER_DESCRIPTION "The files necessary for running the MariaDB server.")
SET(CPACK_COMPONENT_GROUP_DEVELOPMENT_DESCRIPTION "Files used in development on the MariaDB server.")
SET(CPACK_ALL_INSTALL_TYPES Normal Development)
SET(CPACK_COMPONENT_RUNTIME_DISPLAY_NAME "MariaDB server")
SET(CPACK_COMPONENT_RUNTIME_DESCRIPTION "The server itself. You want to install this one.")
SET(CPACK_COMPONENT_RUNTIME_GROUP "Server")
SET(CPACK_COMPONENT_RUNTIME_INSTALL_TYPES Normal Development)
SET(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "Development headers")
SET(CPACK_COMPONENT_HEADERS_DESCRIPTION "Header files for development on MariaDB.")
SET(CPACK_COMPONENT_HEADERS_DEPENDS runtime)
SET(CPACK_COMPONENT_HEADERS_GROUP "Development")
SET(CPACK_COMPONENT_HEADERS_INSTALL_TYPES Development)
SET(CPACK_COMPONENT_PERLSCRIPTS_DISPLAY_NAME "Server perl scripts")
SET(CPACK_COMPONENT_PERLSCRIPTS_DESCRIPTION "Scripts to controll and modify the server. You need a perl installation for these to work.")
SET(CPACK_COMPONENT_PERLSCRIPTS_DEPENDS runtime)
SET(CPACK_COMPONENT_PERLSCRIPTS_GROUP "Server")
SET(CPACK_COMPONENT_PERLSCRIPTS_INSTALL_TYPES Normal Development)
# TODO: Add debug files
# TODO: Add embedded server files
# TODO: Add test files
# TODO: Add sql-bench
# Add files to the installer
INSTALL(FILES COPYING EXCEPTIONS-CLIENT DESTINATION .)
INSTALL(FILES support-files/my-huge.ini support-files/my-innodb-heavy-4G.ini DESTINATION .)
INSTALL(FILES support-files/my-large.ini support-files/my-medium.ini DESTINATION .)
INSTALL(FILES support-files/my-small.ini DESTINATION .)
INSTALL(FILES Docs/INSTALL-BINARY DESTINATION Docs)
INSTALL(FILES COPYING DESTINATION Docs)
FILE(GLOB headerfiles "${CMAKE_CURRENT_SOURCE_DIR}/include/*.h")
INSTALL(FILES ${headerfiles} DESTINATION include COMPONENT headers)
INSTALL(FILES include/mysql/plugin.h DESTINATION include/mysql COMPONENT headers)
INSTALL(FILES libmysql/libmysql.def DESTINATION include COMPONENT headers)
# Handle the database files
FILE(GLOB datafiles "${CMAKE_CURRENT_SOURCE_DIR}/win/data/mysql/*")
INSTALL(FILES ${datafiles} DESTINATION data/clean/mysql)
INSTALL(FILES win/data/maria_log.00000001 win/data/maria_log_control DESTINATION data/clean)
INSTALL(DIRECTORY win/data/test DESTINATION data/clean)
SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}
IfFileExists '$INSTDIR\\\\data\\\\mysql\\\\db.frm' 0 CopyDatabaseFiles
MessageBox MB_OK 'There are already database files present in the data directory. Clean database files are not written to the directory'
GoTo EndCopyDatabaseFiles
CopyDatabaseFiles:
CopyFiles '$INSTDIR\\\\data\\\\clean\\\\*' '$INSTDIR\\\\data'
EndCopyDatabaseFiles:")
SET(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS}
MessageBox MB_OK 'This will not delete the database files in $INSTDIR\\\\data'")
# Files in the share dir
INSTALL(FILES sql/share/errmsg.txt DESTINATION share COMPONENT runtime)
FILE(GLOB charsets sql/share/charsets/*)
INSTALL(FILES ${charsets} DESTINATION share/charsets COMPONENT runtime)
FILE(GLOB share_dirs sql/share/*)
FOREACH(SUBDIR ${share_dirs})
FILE(RELATIVE_PATH DIRNAME ${PROJECT_SOURCE_DIR}/sql/share ${SUBDIR})
IF (EXISTS ${SUBDIR}/errmsg.sys)
INSTALL(FILES ${SUBDIR}/errmsg.sys DESTINATION share/${DIRNAME} COMPONENT runtime)
ENDIF(EXISTS ${SUBDIR}/errmsg.sys)
ENDFOREACH(SUBDIR ${share_dirs})
INCLUDE(InstallRequiredSystemLibraries)
# This must always be the last line
INCLUDE(CPack)
...@@ -83,3 +83,5 @@ IF(EMBED_MANIFESTS) ...@@ -83,3 +83,5 @@ IF(EMBED_MANIFESTS)
MYSQL_EMBED_MANIFEST("echo" "asInvoker") MYSQL_EMBED_MANIFEST("echo" "asInvoker")
ENDIF(EMBED_MANIFESTS) ENDIF(EMBED_MANIFESTS)
INSTALL(TARGETS mysql mysqltest mysqlcheck mysqldump mysqlimport mysql_upgrade mysqlshow
mysqlbinlog mysqladmin mysqlslap echo DESTINATION bin COMPONENT runtime)
...@@ -53,3 +53,5 @@ TARGET_LINK_LIBRARIES(replace strings mysys debug dbug wsock32) ...@@ -53,3 +53,5 @@ TARGET_LINK_LIBRARIES(replace strings mysys debug dbug wsock32)
IF(EMBED_MANIFESTS) IF(EMBED_MANIFESTS)
MYSQL_EMBED_MANIFEST("myTest" "asInvoker") MYSQL_EMBED_MANIFEST("myTest" "asInvoker")
ENDIF(EMBED_MANIFESTS) ENDIF(EMBED_MANIFESTS)
INSTALL(TARGETS comp_err my_print_defaults perror resolveip replace DESTINATION bin COMPONENT runtime)
...@@ -129,3 +129,11 @@ TARGET_LINK_LIBRARIES(libmysql wsock32) ...@@ -129,3 +129,11 @@ TARGET_LINK_LIBRARIES(libmysql wsock32)
IF(EMBED_MANIFESTS) IF(EMBED_MANIFESTS)
MYSQL_EMBED_MANIFEST("myTest" "asInvoker") MYSQL_EMBED_MANIFEST("myTest" "asInvoker")
ENDIF(EMBED_MANIFESTS) ENDIF(EMBED_MANIFESTS)
# TODO: Install mysqlclient_notls?
# TODO: Which component should these be part of, development?
INSTALL(TARGETS mysqlclient DESTINATION lib/opt COMPONENT runtime)
INSTALL(TARGETS libmysql DESTINATION lib/opt COMPONENT runtime)
# Also install libmysql.dll to the bin dir
INSTALL(TARGETS libmysql DESTINATION bin COMPONENT runtime)
...@@ -49,4 +49,6 @@ SET(MYSYS_SOURCES array.c charset-def.c charset.c checksum.c default.c default_ ...@@ -49,4 +49,6 @@ SET(MYSYS_SOURCES array.c charset-def.c charset.c checksum.c default.c default_
IF(NOT SOURCE_SUBLIBS) IF(NOT SOURCE_SUBLIBS)
ADD_LIBRARY(mysys ${MYSYS_SOURCES}) ADD_LIBRARY(mysys ${MYSYS_SOURCES})
INSTALL(TARGETS mysys DESTINATION lib/opt COMPONENT runtime) # TODO: Component?
ENDIF(NOT SOURCE_SUBLIBS) ENDIF(NOT SOURCE_SUBLIBS)
...@@ -22,4 +22,6 @@ SET(REGEX_SOURCES regcomp.c regerror.c regexec.c regfree.c reginit.c) ...@@ -22,4 +22,6 @@ SET(REGEX_SOURCES regcomp.c regerror.c regexec.c regfree.c reginit.c)
IF(NOT SOURCE_SUBLIBS) IF(NOT SOURCE_SUBLIBS)
ADD_LIBRARY(regex ${REGEX_SOURCES}) ADD_LIBRARY(regex ${REGEX_SOURCES})
INSTALL(TARGETS regex DESTINATION lib/opt COMPONENT runtime) # TODO: Component
ENDIF(NOT SOURCE_SUBLIBS) ENDIF(NOT SOURCE_SUBLIBS)
...@@ -75,3 +75,8 @@ CONFIGURE_FILE(mysqldumpslow.sh ...@@ -75,3 +75,8 @@ CONFIGURE_FILE(mysqldumpslow.sh
CONFIGURE_FILE(mysqlhotcopy.sh CONFIGURE_FILE(mysqlhotcopy.sh
${CMAKE_BINARY_DIR}/scripts/mysqlhotcopy.pl ESCAPE_QUOTES @ONLY) ${CMAKE_BINARY_DIR}/scripts/mysqlhotcopy.pl ESCAPE_QUOTES @ONLY)
INSTALL(FILES mysqldumpslow.pl mysqlhotcopy.pl mysql_config.pl
mysql_convert_table_format.pl mysql_install_db.pl
mysql_secure_installation.pl mysqld_multi.pl
DESTINATION scripts COMPONENT perlscripts)
...@@ -36,3 +36,5 @@ TARGET_LINK_LIBRARIES(mysqlmanager debug dbug mysys strings taocrypt vio yassl z ...@@ -36,3 +36,5 @@ TARGET_LINK_LIBRARIES(mysqlmanager debug dbug mysys strings taocrypt vio yassl z
IF(EMBED_MANIFESTS) IF(EMBED_MANIFESTS)
MYSQL_EMBED_MANIFEST("mysqlmanager" "asInvoker") MYSQL_EMBED_MANIFEST("mysqlmanager" "asInvoker")
ENDIF(EMBED_MANIFESTS) ENDIF(EMBED_MANIFESTS)
INSTALL(TARGETS mysqlmanager DESTINATION bin COMPONENT runtime)
...@@ -154,3 +154,8 @@ SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ...@@ -154,3 +154,8 @@ SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
ADD_LIBRARY(udf_example MODULE udf_example.c udf_example.def) ADD_LIBRARY(udf_example MODULE udf_example.c udf_example.def)
ADD_DEPENDENCIES(udf_example strings GenError) ADD_DEPENDENCIES(udf_example strings GenError)
TARGET_LINK_LIBRARIES(udf_example strings wsock32) TARGET_LINK_LIBRARIES(udf_example strings wsock32)
INSTALL(TARGETS mysqld
RUNTIME DESTINATION bin COMPONENT runtime
LIBRARY DESTINATION lib COMPONENT runtime
ARCHIVE DESTINATION lib COMPONENT runtime)
...@@ -91,4 +91,7 @@ IF(EMBED_MANIFESTS) ...@@ -91,4 +91,7 @@ IF(EMBED_MANIFESTS)
MYSQL_EMBED_MANIFEST("maria_pack" "asInvoker") MYSQL_EMBED_MANIFEST("maria_pack" "asInvoker")
ENDIF(EMBED_MANIFESTS) ENDIF(EMBED_MANIFESTS)
INSTALL(TARGETS maria_ftdump maria_chk maria_read_log maria_pack maria_dump_log
DESTINATION bin COMPONENT runtime)
ENDIF(NOT SOURCE_SUBLIBS) ENDIF(NOT SOURCE_SUBLIBS)
...@@ -70,4 +70,6 @@ IF(NOT SOURCE_SUBLIBS) ...@@ -70,4 +70,6 @@ IF(NOT SOURCE_SUBLIBS)
MYSQL_EMBED_MANIFEST("myisampack" "asInvoker") MYSQL_EMBED_MANIFEST("myisampack" "asInvoker")
ENDIF(EMBED_MANIFESTS) ENDIF(EMBED_MANIFESTS)
INSTALL(TARGETS myisam_ftdump myisamchk myisamlog myisampack DESTINATION bin COMPONENT runtime)
ENDIF(NOT SOURCE_SUBLIBS) ENDIF(NOT SOURCE_SUBLIBS)
...@@ -30,4 +30,6 @@ SET(STRINGS_SOURCES bchange.c bcmp.c bfill.c bmove512.c bmove_upp.c ctype-big5.c ...@@ -30,4 +30,6 @@ SET(STRINGS_SOURCES bchange.c bcmp.c bfill.c bmove512.c bmove_upp.c ctype-big5.c
IF(NOT SOURCE_SUBLIBS) IF(NOT SOURCE_SUBLIBS)
ADD_LIBRARY(strings ${STRINGS_SOURCES}) ADD_LIBRARY(strings ${STRINGS_SOURCES})
INSTALL(TARGETS strings DESTINATION lib/opt COMPONENT runtime) # TODO: Component
ENDIF(NOT SOURCE_SUBLIBS) ENDIF(NOT SOURCE_SUBLIBS)
...@@ -25,3 +25,5 @@ TARGET_LINK_LIBRARIES(mysql_client_test mysqlclient_notls wsock32) ...@@ -25,3 +25,5 @@ TARGET_LINK_LIBRARIES(mysql_client_test mysqlclient_notls wsock32)
ADD_EXECUTABLE(bug25714 bug25714.c) ADD_EXECUTABLE(bug25714 bug25714.c)
TARGET_LINK_LIBRARIES(bug25714 mysqlclient_notls wsock32) TARGET_LINK_LIBRARIES(bug25714 mysqlclient_notls wsock32)
INSTALL(TARGETS mysql_client_test bug25714 DESTINATION bin COMPONENT runtime)
...@@ -27,4 +27,6 @@ SET(ZLIB_SOURCES adler32.c compress.c crc32.c crc32.h deflate.c deflate.h gzio. ...@@ -27,4 +27,6 @@ SET(ZLIB_SOURCES adler32.c compress.c crc32.c crc32.h deflate.c deflate.h gzio.
zutil.c zutil.h) zutil.c zutil.h)
IF(NOT SOURCE_SUBLIBS) IF(NOT SOURCE_SUBLIBS)
ADD_LIBRARY(zlib ${ZLIB_SOURCES}) ADD_LIBRARY(zlib ${ZLIB_SOURCES})
INSTALL(TARGETS zlib DESTINATION lib/opt COMPONENT runtime) # TODO: Component
ENDIF(NOT SOURCE_SUBLIBS) ENDIF(NOT SOURCE_SUBLIBS)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment