diff options
author | Vladislav Vaintroub <vvaintroub@mysql.com> | 2010-02-10 20:23:24 +0100 |
---|---|---|
committer | Vladislav Vaintroub <vvaintroub@mysql.com> | 2010-02-10 20:23:24 +0100 |
commit | 890c52d889231c7854c52d7b649d2be24e509e69 (patch) | |
tree | dfea6a5cf6f617ecfe6559b0eff36aba6b474d05 /packaging | |
parent | befe4641f23d1b62a797d678aa2e5198e0c2d388 (diff) | |
download | mariadb-git-890c52d889231c7854c52d7b649d2be24e509e69.tar.gz |
Add components to INSTALL, some eraly Wix support
Diffstat (limited to 'packaging')
-rw-r--r-- | packaging/WiX/AdminBackground.jpg | bin | 0 -> 20557 bytes | |||
-rw-r--r-- | packaging/WiX/AdminHeader.jpg | bin | 0 -> 3469 bytes | |||
-rw-r--r-- | packaging/WiX/CMakeLists.txt | 28 | ||||
-rw-r--r-- | packaging/WiX/create_fragments.cmake | 86 | ||||
-rw-r--r-- | packaging/WiX/create_msi.cmake.in | 103 | ||||
-rw-r--r-- | packaging/WiX/mysql_server.wxs.in | 40 |
6 files changed, 257 insertions, 0 deletions
diff --git a/packaging/WiX/AdminBackground.jpg b/packaging/WiX/AdminBackground.jpg Binary files differnew file mode 100644 index 00000000000..847dc6cdbed --- /dev/null +++ b/packaging/WiX/AdminBackground.jpg diff --git a/packaging/WiX/AdminHeader.jpg b/packaging/WiX/AdminHeader.jpg Binary files differnew file mode 100644 index 00000000000..6e2e33d404f --- /dev/null +++ b/packaging/WiX/AdminHeader.jpg diff --git a/packaging/WiX/CMakeLists.txt b/packaging/WiX/CMakeLists.txt new file mode 100644 index 00000000000..1d1a82f7b1c --- /dev/null +++ b/packaging/WiX/CMakeLists.txt @@ -0,0 +1,28 @@ +FIND_PATH(WIX_DIR heat.exe
+ $ENV{WIX_DIR}/bin
+ $ENV{ProgramFiles}/wix/bin
+ "$ENV{ProgramFiles}/Windows Installer XML v3.0/bin"
+ "$ENV{ProgramFiles}/Windows Installer XML v3.5/bin"
+)
+
+IF(NOT WIX_DIR)
+ MESSAGE(FATAL_ERROR "Cannot find wix")
+ENDIF()
+
+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_GENERATOR MATCHES "Visual Studio")
+ SET(CONFIG_PARAM "-DCMAKE_INSTALL_CONFIG_NAME=${CMAKE_CFG_INTDIR}")
+ENDIF()
+ADD_CUSTOM_TARGET(
+ WIX_Installer
+ COMMAND set VS_UNICODE_OUTPUT=
+ COMMAND ${CMAKE_COMMAND} ${CONFIG_PARAM} -P ${CMAKE_CURRENT_BINARY_DIR}/create_msi.cmake
+)
+
diff --git a/packaging/WiX/create_fragments.cmake b/packaging/WiX/create_fragments.cmake new file mode 100644 index 00000000000..01e8a11c0cf --- /dev/null +++ b/packaging/WiX/create_fragments.cmake @@ -0,0 +1,86 @@ +INCLUDE(${CMAKE_BINARY_DIR}/CPackConfig)
+
+FOREACH(comp ${COMPS})
+ SET(CMDS ${CMDS}
+ COMMAND set DESTDIR=testinstall/${comp}
+ COMMAND ${CMAKE_COMMAND}
+ -DCMAKE_INSTALL_CONFIG_NAME=${CMAKE_CFG_INTDIR}
+ -DCMAKE_INSTALL_COMPONENT=${comp}
+ -DCMAKE_INSTALL_PREFIX=
+ -P ${CMAKE_BINARY_DIR}/cmake_install.cmake
+ )
+ENDFOREACH()
+
+MACRO(MAKE_WIX_IDENTIFIER str varname)
+ STRING(REPLACE "/" "." ${varname} "${str}")
+ STRING(REPLACE "-" "_" ${varname} "${${varname}}")
+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)
+ FILE(APPEND ${file} "<DirectoryRef Id='directory.${id}'>\n")
+ ELSE()
+ FILE(APPEND ${file} "<DirectoryRef Id='INSTALLDIR'>\n")
+ ENDIF()
+
+ 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)
+ FILE(APPEND ${file} " <Component Id='component.${id}' Guid='*'>\n")
+ FILE(APPEND ${file} " <File Id='file.${id}' KeyPath='yes' Source='${f_native}'/>\n")
+ FILE(APPEND ${file} " </Component>\n")
+ FILE(APPEND ${file_comp} " <ComponentRef Id='component.${id}'/>\n")
+ ENDIF()
+ ENDFOREACH()
+ FILE(APPEND ${file} "</DirectoryRef>\n")
+ 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)
+ MAKE_WIX_IDENTIFIER("${rel}" id)
+ GET_FILENAME_COMPONENT(name ${dir} NAME)
+ FILE(APPEND ${file} "${prefix}<Directory Id='directory.${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)
+ FILE(APPEND ${file} "</Directory>\n")
+ ENDIF()
+ENDFUNCTION()
+
+
+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}.wxs "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>\n<Fragment>\n")
+ FILE(WRITE
+ ${abs}/${d_name}_component_group.wxs "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>\n<Fragment>\n<ComponentGroup Id='componentgroup.${d_name}'>\n")
+ TRAVERSE_FILES(${d} ${d} ${abs}/${d_name}.wxs ${abs}/${d_name}_component_group.wxs "${abs}/dirs")
+ FILE(APPEND ${abs}/${d_name}.wxs " </Fragment>\n</Wix>")
+ FILE(APPEND ${abs}/${d_name}_component_group.wxs "</ComponentGroup>\n</Fragment>\n</Wix>")
+ENDFOREACH()
+FILE(WRITE directories.wxs "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>\n<Fragment>\n<DirectoryRef Id='INSTALLDIR'>\n")
+TRAVERSE_DIRECTORIES(${abs}/dirs ${abs}/dirs directories.wxs "")
+FILE(APPEND directories.wxs "</DirectoryRef>\n</Fragment>\n</Wix>\n")
+
diff --git a/packaging/WiX/create_msi.cmake.in b/packaging/WiX/create_msi.cmake.in new file mode 100644 index 00000000000..13836d6d35f --- /dev/null +++ b/packaging/WiX/create_msi.cmake.in @@ -0,0 +1,103 @@ +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(ENV{VS_UNICODE_OUTPUT})
+INCLUDE(${CMAKE_BINARY_DIR}/CPackConfig.cmake)
+
+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
+ )
+ENDFOREACH()
+
+MACRO(MAKE_WIX_IDENTIFIER str varname)
+ STRING(REPLACE "/" "." ${varname} "${str}")
+ STRING(REPLACE "-" "_" ${varname} "${${varname}}")
+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)
+ FILE(APPEND ${file} "<DirectoryRef Id='directory.${id}'>\n")
+ ELSE()
+ FILE(APPEND ${file} "<DirectoryRef Id='INSTALLDIR'>\n")
+ ENDIF()
+
+ 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)
+ FILE(APPEND ${file} " <Component Id='component.${id}' Guid='*'>\n")
+ FILE(APPEND ${file} " <File Id='file.${id}' KeyPath='yes' Source='${f_native}'/>\n")
+ FILE(APPEND ${file} " </Component>\n")
+ FILE(APPEND ${file_comp} " <ComponentRef Id='component.${id}'/>\n")
+ ENDIF()
+ ENDFOREACH()
+ FILE(APPEND ${file} "</DirectoryRef>\n")
+ 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='directory.${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} "</Directory>\n")
+ ENDIF()
+ENDFUNCTION()
+
+
+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}.wxs "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>\n<Fragment>\n")
+ FILE(WRITE
+ ${abs}/${d_name}_component_group.wxs "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>\n<Fragment>\n<ComponentGroup Id='componentgroup.${d_name}'>\n")
+ TRAVERSE_FILES(${d} ${d} ${abs}/${d_name}.wxs ${abs}/${d_name}_component_group.wxs "${abs}/dirs")
+ FILE(APPEND ${abs}/${d_name}.wxs " </Fragment>\n</Wix>")
+ FILE(APPEND ${abs}/${d_name}_component_group.wxs "</ComponentGroup>\n</Fragment>\n</Wix>")
+ENDFOREACH()
+FILE(WRITE directories.wxs "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>\n<Fragment>\n<DirectoryRef Id='INSTALLDIR'>\n")
+TRAVERSE_DIRECTORIES(${abs}/dirs ${abs}/dirs directories.wxs "")
+FILE(APPEND directories.wxs "</DirectoryRef>\n</Fragment>\n</Wix>\n")
+
+EXECUTE_PROCESS(
+ COMMAND ${CANDLE_EXECUTABLE} *.wxs
+ COMMAND ${LIGHT_EXECUTABLE} -ext WixUIExtension *.wixobj -out ${CPACK_PACKAGE_FILE_NAME}.msi
+)
+
diff --git a/packaging/WiX/mysql_server.wxs.in b/packaging/WiX/mysql_server.wxs.in new file mode 100644 index 00000000000..21f2a6256f3 --- /dev/null +++ b/packaging/WiX/mysql_server.wxs.in @@ -0,0 +1,40 @@ +<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
+ <Product Id="*" UpgradeCode="49EB7A6A-1CEF-4A1E-9E89-B9A4993963E3"
+ Name="MySQL Server @MAJOR_VERSION@.@MINOR_VERSION@" Version="@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH@" Language="1033" Manufacturer="MySQL AB">
+ <Package Id='*' Keywords='Installer' Description="MySQL Database Server"
+ Manufacturer='MySQL AB'
+ InstallerVersion='310' Languages='1033' Compressed='yes' SummaryCodepage='1252' />
+ <Media Id='1' Cabinet='product.cab' EmbedCab='yes' />
+ <Directory Id='TARGETDIR' Name='SourceDir'>
+ <Directory Id='ProgramFilesFolder'>
+ <Directory Id='directory.MySQL' Name='MySQL'>
+ <Directory Id='INSTALLDIR' Name='MySQL Server @MAJOR_VERSION@.@MINOR_VERSION@'>
+ </Directory>
+ </Directory>
+ </Directory>
+ </Directory>
+ <Directory Id="CommonAppDataFolder">
+ <Directory Id="directory.Data.MySQL" Name="MySQL">
+ <Directory Id="DATADIR" LongName="MySQL Server @MAJOR_VERSION@.@MINOR_VERSION@" src=".\">
+ <Directory Id="DATADIR" Name=".">
+ <!-- *****************************************************************************************
+ data directory
+ -->
+ <Directory Id="DataDir" Name="data">
+ <Directory Id="mysql" Name="mysql">
+ <Feature Id='Server' Level='1' Title="MySQL Server" Description="Install MySQL server" Display="expand">
+ <ComponentGroupRef Id='componentgroup.Server'/>
+ <Feature Level='1' Id='ClientPrograms' Title="Client Programs" Description="Various helpful (commandline) tools including the mysql command line client" >
+ <ComponentRef Id="componentgroup.Client" />
+ </Feature>
+ </Feature>
+ <Feature Id='Devel' Level='1' Title="Development Components"
+ Description="Installs C/C++ header files and libraries">
+ <ComponentGroupRef Id='componentgroup.Development' />
+ </Feature>
+ <UIRef Id="WixUI_FeatureTree" />
+ <UIRef Id="WixUI_ErrorProgressText" />
+ <WixVariable Id="WixUIBannerBmp" Value="@CMAKE_CURRENT_SOURCE_DIR@/AdminHeader.jpg" />
+ <WixVariable Id="WixUIDialogBmp" Value="@CMAKE_CURRENT_SOURCE_DIR@/AdminBackground.jpg" />
+ </Product>
+</Wix>
|