summaryrefslogtreecommitdiff
path: root/packaging
diff options
context:
space:
mode:
authorVladislav Vaintroub <vvaintroub@mysql.com>2010-02-18 23:52:35 +0100
committerVladislav Vaintroub <vvaintroub@mysql.com>2010-02-18 23:52:35 +0100
commit718ee3e595d3c73517c1bc1df8d3bdfc2e22510b (patch)
treeb6822778dfe75b653b18eb39ba2c04313e8a37ad /packaging
parentb852bf835a92a17af1618b839cc00d600b022046 (diff)
downloadmariadb-git-718ee3e595d3c73517c1bc1df8d3bdfc2e22510b.tar.gz
Refactor some stuff
Diffstat (limited to 'packaging')
-rw-r--r--packaging/WiX/CMakeLists.txt18
-rw-r--r--packaging/WiX/create_msi.cmake.in46
-rw-r--r--packaging/WiX/extra.wxs.in32
-rw-r--r--packaging/WiX/mysql_server.wxs.in82
4 files changed, 144 insertions, 34 deletions
diff --git a/packaging/WiX/CMakeLists.txt b/packaging/WiX/CMakeLists.txt
index f083c79e1df..9cd043e001b 100644
--- a/packaging/WiX/CMakeLists.txt
+++ b/packaging/WiX/CMakeLists.txt
@@ -25,18 +25,32 @@ 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@
+ )
+
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 ${CONFIG_PARAM} -P ${CMAKE_CURRENT_BINARY_DIR}/create_msi.cmake
+ COMMAND ${CMAKE_COMMAND}
+ -DCPACK_WIX_CONFIG=${CMAKE_CURRENT_SOURCE_DIR}/CPackWixConfig.cmake
+ -DCPACK_WIX_EXTRA_SOURCE=${CMAKE_CURRENT_BINARY_DIR}/extra.wxs
+ ${CONFIG_PARAM}
+ -P ${CMAKE_CURRENT_BINARY_DIR}/create_msi.cmake
)
ADD_CUSTOM_TARGET(
MSI_ESSENTIALS
COMMAND set VS_UNICODE_OUTPUT=
- COMMAND ${CMAKE_COMMAND} -DESSENTIALS=1 -DCPACK_WIX_CONFIG=${CMAKE_CURRENT_SOURCE_DIR}/CPackWixConfig.cmake ${CONFIG_PARAM} -P ${CMAKE_CURRENT_BINARY_DIR}/create_msi.cmake
+ COMMAND ${CMAKE_COMMAND} -DESSENTIALS=1
+ -DCPACK_WIX_CONFIG=${CMAKE_CURRENT_SOURCE_DIR}/CPackWixConfig.cmake
+ -DCPACK_WIX_EXTRA_SOURCE=${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 d932e064237..92bba7d34e9 100644
--- a/packaging/WiX/create_msi.cmake.in
+++ b/packaging/WiX/create_msi.cmake.in
@@ -181,7 +181,7 @@ MACRO(MAKE_WIX_IDENTIFIER str varname)
ENDMACRO()
-FUNCTION(TRAVERSE_FILES dir topdir file file_comp file_default_component dir_root)
+FUNCTION(TRAVERSE_FILES dir topdir file file_comp dir_root)
FILE(GLOB all_files ${dir}/*)
IF(NOT all_files)
RETURN()
@@ -219,13 +219,13 @@ FUNCTION(TRAVERSE_FILES dir topdir file file_comp file_default_component dir_roo
IF(NONEXEFILES)
GENERATE_GUID(guid)
SET(ComponentId "C._files_${COMP_NAME}.${DirectoryRefId}")
- FILE(APPEND ${file_default_component}
+ 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} ${file_default_component} ${dir_root})
+ TRAVERSE_FILES(${f} ${topdir} ${file} ${file_comp} ${dir_root})
ENDIF()
ENDFOREACH()
ENDFUNCTION()
@@ -244,33 +244,41 @@ FUNCTION(TRAVERSE_DIRECTORIES dir topdir file prefix)
ENDIF()
ENDFOREACH()
IF(rel AND IS_DIRECTORY "${f}")
- FILE(APPEND ${file} "</Directory>\n")
+ 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}.wxs "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>\n<Fragment>\n")
- FILE(WRITE
- ${abs}/${d_name}_default_component.wxs "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'><Fragment>")
- FILE(WRITE
- ${abs}/${d_name}_component_group.wxs "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
- <Fragment>\n<ComponentGroup Id='componentgroup.${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}/${d_name}_default_component.wxs "${abs}/dirs")
- FILE(APPEND ${abs}/${d_name}_default_component.wxs "\n</Fragment>\n</Wix>")
- FILE(APPEND ${abs}/${d_name}.wxs " </Fragment>\n</Wix>")
- FILE(APPEND ${abs}/${d_name}_component_group.wxs "</ComponentGroup>\n</Fragment>\n</Wix>")
+ 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 "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>\n<Fragment>\n<DirectoryRef Id='INSTALLDIR'>\n")
+
+FILE(WRITE directories.wxs "<DirectoryRef Id='INSTALLDIR'>\n")
TRAVERSE_DIRECTORIES(${abs}/dirs ${abs}/dirs directories.wxs "")
-FILE(APPEND directories.wxs "</DirectoryRef>\n</Fragment>\n</Wix>\n")
+FILE(APPEND directories.wxs "</DirectoryRef>\n")
+
+FILE(READ directories.wxs CPACK_WIX_DIRECTORIES)
+FILE(REMOVE directories.wxs)
-FILE(GLOB WXS_FILES *.wxs)
+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}")
diff --git a/packaging/WiX/extra.wxs.in b/packaging/WiX/extra.wxs.in
new file mode 100644
index 00000000000..b1286bfba61
--- /dev/null
+++ b/packaging/WiX/extra.wxs.in
@@ -0,0 +1,32 @@
+<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
diff --git a/packaging/WiX/mysql_server.wxs.in b/packaging/WiX/mysql_server.wxs.in
index 2e1443e0153..30baefbf64b 100644
--- a/packaging/WiX/mysql_server.wxs.in
+++ b/packaging/WiX/mysql_server.wxs.in
@@ -1,11 +1,62 @@
<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"
+ <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='200' Languages='1033' Compressed='yes' SummaryCodepage='1252'
- Platform='@Platform@'/>
+ 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" />
+
+ <!-- Installation root-->
<Directory Id='TARGETDIR' Name='SourceDir'>
<Directory Id='@PlatformProgramFilesFolder@'>
<Directory Id='directory.MySQL' Name='MySQL'>
@@ -14,13 +65,18 @@
</Directory>
</Directory>
</Directory>
- <!-- CPACK_WIX_FEATURES -->
- @CPACK_WIX_FEATURES@
- <!--CPACK_WIX_FEATURES end -->
- <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" />
+
+ <!-- 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@
+
</Product>
</Wix>