diff options
author | Vladislav Vaintroub <vvaintroub@mysql.com> | 2010-04-23 14:25:45 +0200 |
---|---|---|
committer | Vladislav Vaintroub <vvaintroub@mysql.com> | 2010-04-23 14:25:45 +0200 |
commit | e8bb2fd4a117f1a019d618a207e1de4a30d72c20 (patch) | |
tree | e01e74f892085cad21f37113bfa08fe6840ea859 /packaging | |
parent | e427d8b33a1c20e4823b34d6b3cd6406276f6c57 (diff) | |
download | mariadb-git-e8bb2fd4a117f1a019d618a207e1de4a30d72c20.tar.gz |
Create MySQL data folder in %ProgramData% directory.
Note that a read only copy will still exist in the ProgramFiles directory
(so it can be reused for other instances)
Diffstat (limited to 'packaging')
-rw-r--r-- | packaging/WiX/CMakeLists.txt | 27 | ||||
-rw-r--r-- | packaging/WiX/create_msi.cmake.in | 27 | ||||
-rw-r--r-- | packaging/WiX/extra.wxs.in | 117 | ||||
-rw-r--r-- | packaging/WiX/mysql_server.wxs.in | 8 |
4 files changed, 129 insertions, 50 deletions
diff --git a/packaging/WiX/CMakeLists.txt b/packaging/WiX/CMakeLists.txt index 9cd043e001b..f3fa3eb7a30 100644 --- a/packaging/WiX/CMakeLists.txt +++ b/packaging/WiX/CMakeLists.txt @@ -18,28 +18,47 @@ IF(NOT WIX_DIR) RETURN()
ENDIF()
+# 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)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/extra.wxs.in
${CMAKE_CURRENT_BINARY_DIR}/extra.wxs
- @ONLY@
+ @ONLY
)
IF(CMAKE_GENERATOR MATCHES "Visual Studio")
SET(CONFIG_PARAM "-DCMAKE_INSTALL_CONFIG_NAME=${CMAKE_CFG_INTDIR}")
ENDIF()
+
ADD_CUSTOM_TARGET(
MSI
COMMAND set VS_UNICODE_OUTPUT=
COMMAND ${CMAKE_COMMAND}
-DCPACK_WIX_CONFIG=${CMAKE_CURRENT_SOURCE_DIR}/CPackWixConfig.cmake
- -DCPACK_WIX_EXTRA_SOURCE=${CMAKE_CURRENT_BINARY_DIR}/extra.wxs
+ -DCPACK_WIX_INCLUDE=${CMAKE_CURRENT_BINARY_DIR}/extra.wxs
${CONFIG_PARAM}
-P ${CMAKE_CURRENT_BINARY_DIR}/create_msi.cmake
)
@@ -49,7 +68,7 @@ ADD_CUSTOM_TARGET( COMMAND set VS_UNICODE_OUTPUT=
COMMAND ${CMAKE_COMMAND} -DESSENTIALS=1
-DCPACK_WIX_CONFIG=${CMAKE_CURRENT_SOURCE_DIR}/CPackWixConfig.cmake
- -DCPACK_WIX_EXTRA_SOURCE=${CMAKE_CURRENT_BINARY_DIR}/extra.wxs
+ -DCPACK_WIX_INCLUDE=${CMAKE_CURRENT_BINARY_DIR}/extra.wxs
${CONFIG_PARAM}
-P ${CMAKE_CURRENT_BINARY_DIR}/create_msi.cmake
)
diff --git a/packaging/WiX/create_msi.cmake.in b/packaging/WiX/create_msi.cmake.in index 92bba7d34e9..dc60123b58a 100644 --- a/packaging/WiX/create_msi.cmake.in +++ b/packaging/WiX/create_msi.cmake.in @@ -274,21 +274,24 @@ 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(WXS_FILES ${CMAKE_CURRENT_BINARY_DIR}/mysql_server.wxs ${CPACK_WIX_EXTRA_SOURCE})
-SET(WIXOBJ_NATIVE_FILES)
-SET(WXS_NATIVE_FILES)
-FOREACH(f "${WXS_FILES}")
- FILE(TO_NATIVE_PATH "${f}" f)
- EXECUTE_PROCESS(COMMAND ${CANDLE_EXECUTABLE} ${f})
- STRING(REPLACE ".wxs" ".wixobj" f "${f}")
- LIST(APPEND WIXOBJ_NATIVE_FILES ${f})
-ENDFOREACH()
+FILE(REMOVE mysql_server.wixobj)
+EXECUTE_PROCESS(
+ COMMAND ${CANDLE_EXECUTABLE} -ext WixUtilExtension mysql_server.wxs
+)
EXECUTE_PROCESS(
- COMMAND ${LIGHT_EXECUTABLE} -ext WixUIExtension ${WIXOBJ_NATIVE_FILES} -out ${CPACK_PACKAGE_FILE_NAME}.msi
+ COMMAND ${LIGHT_EXECUTABLE} -ext WixUIExtension -ext WixUtilExtension
+ mysql_server.wixobj -out ${CPACK_PACKAGE_FILE_NAME}.msi
)
diff --git a/packaging/WiX/extra.wxs.in b/packaging/WiX/extra.wxs.in index b1286bfba61..78e6f96dbcc 100644 --- a/packaging/WiX/extra.wxs.in +++ b/packaging/WiX/extra.wxs.in @@ -1,32 +1,85 @@ -<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
- <Fragment>
- <DirectoryRef Id="INSTALLDIR">
- <Component Id="RegKeys" Guid="*">
- <RegistryKey
- Id='MySQLKey'
- Root='HKLM'
- Key='SOFTWARE\MySQL AB\[ProductName]'
- Action='createAndRemoveOnUninstall'>
- <RegistryValue
- Type='string'
- Name='Location'
- Value='[INSTALLDIR]'/>
- <RegistryValue
- Type="string"
- Name="Version"
- Value="[ProductVersion]"/>
- <RegistryValue
- Type="string"
- Name="DataLocation"
- Value="[DATADIR]"/>
- </RegistryKey>
- </Component>
- </DirectoryRef>
- <Feature
- Id='RegKeys'
- Display='hidden'
- Level='1'>
- <ComponentRef Id='RegKeys'/>
- </Feature>
- </Fragment>
-</Wix>
\ No newline at end of file +<Include xmlns="http://schemas.microsoft.com/wix/2006/wi"
+ xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
+ <DirectoryRef Id='TARGETDIR'>
+ <Component Id="RegKeys" Guid="*">
+ <RegistryKey
+ Id='MySQLKey'
+ Root='HKLM'
+ Key='SOFTWARE\MySQL AB\[ProductName]'
+ Action='createAndRemoveOnUninstall'>
+ <RegistryValue
+ Type='string'
+ Name='Location'
+ Value='[INSTALLDIR]'/>
+ <RegistryValue
+ Type="string"
+ Name="Version"
+ Value="[ProductVersion]"/>
+ <RegistryValue
+ Type="string"
+ Name="DataLocation"
+ Value="[DATADIR]"/>
+ </RegistryKey>
+ </Component>
+ </DirectoryRef>
+
+ <Feature
+ Id='RegKeys'
+ Display='hidden'
+ Level='1'>
+ <ComponentRef Id='RegKeys'/>
+ </Feature>
+
+ <!-- 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">
+ @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">
+ @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 index 30baefbf64b..8c2b839c6e7 100644 --- a/packaging/WiX/mysql_server.wxs.in +++ b/packaging/WiX/mysql_server.wxs.in @@ -1,4 +1,5 @@ -<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
+<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"
@@ -78,5 +79,8 @@ <!--CPACK_WIX_COMPONENTS_GROUPS -->
@CPACK_WIX_COMPONENT_GROUPS@
+ <!--CPACK_WIX_INCLUDES -->
+ @CPACK_WIX_INCLUDES@
</Product>
-</Wix>
+
+</Wix>
\ No newline at end of file |