diff options
author | Vladislav Vaintroub <vvaintroub@mysql.com> | 2010-02-11 03:28:12 +0100 |
---|---|---|
committer | Vladislav Vaintroub <vvaintroub@mysql.com> | 2010-02-11 03:28:12 +0100 |
commit | 010bc51e54b4754372a877514b919c5e41a6f6c7 (patch) | |
tree | f3aa845ab1252bb6f47471349ed526f7b990b0d6 | |
parent | 3bd236fefb0024fa4f304d50f8725fcd153631f1 (diff) | |
download | mariadb-git-010bc51e54b4754372a877514b919c5e41a6f6c7.tar.gz |
Fix XML error in compiling MSI
-rw-r--r-- | packaging/WiX/create_msi.cmake.in | 38 | ||||
-rw-r--r-- | packaging/WiX/mysql_server.wxs.in | 11 |
2 files changed, 31 insertions, 18 deletions
diff --git a/packaging/WiX/create_msi.cmake.in b/packaging/WiX/create_msi.cmake.in index 13836d6d35f..34aa53fdc91 100644 --- a/packaging/WiX/create_msi.cmake.in +++ b/packaging/WiX/create_msi.cmake.in @@ -4,6 +4,10 @@ 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(ENV{VS_UNICODE_OUTPUT})
INCLUDE(${CMAKE_BINARY_DIR}/CPackConfig.cmake)
@@ -25,7 +29,16 @@ ENDFOREACH() MACRO(MAKE_WIX_IDENTIFIER str varname)
STRING(REPLACE "/" "." ${varname} "${str}")
- STRING(REPLACE "-" "_" ${varname} "${${varname}}")
+ 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(RANDOM r)
+ STRING(SUBSTRING "${${varname}}" 0 65 shortstr)
+ SET(${varname} "${shortstr}${r}")
+ ENDIF()
ENDMACRO()
FUNCTION(TRAVERSE_FILES dir topdir file file_comp dir_root)
@@ -37,7 +50,7 @@ FUNCTION(TRAVERSE_FILES dir topdir file file_comp dir_root) IF(dir_rel)
MAKE_DIRECTORY(${dir_root}/${dir_rel})
MAKE_WIX_IDENTIFIER("${dir_rel}" id)
- FILE(APPEND ${file} "<DirectoryRef Id='directory.${id}'>\n")
+ FILE(APPEND ${file} "<DirectoryRef Id='D.${id}'>\n")
ELSE()
FILE(APPEND ${file} "<DirectoryRef Id='INSTALLDIR'>\n")
ENDIF()
@@ -47,10 +60,10 @@ FUNCTION(TRAVERSE_FILES dir topdir file file_comp dir_root) 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 Id='C.${id}' Guid='*'>\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='component.${id}'/>\n")
+ FILE(APPEND ${file_comp} " <ComponentRef Id='C.${id}'/>\n")
ENDIF()
ENDFOREACH()
FILE(APPEND ${file} "</DirectoryRef>\n")
@@ -66,7 +79,7 @@ FUNCTION(TRAVERSE_DIRECTORIES dir topdir file prefix) 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")
+ FILE(APPEND ${file} "${prefix}<Directory Id='D.${id}' Name='${name}'>\n")
ENDIF()
FILE(GLOB all_files ${dir}/*)
FOREACH(f ${all_files})
@@ -96,8 +109,17 @@ FILE(WRITE directories.wxs "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi TRAVERSE_DIRECTORIES(${abs}/dirs ${abs}/dirs directories.wxs "")
FILE(APPEND directories.wxs "</DirectoryRef>\n</Fragment>\n</Wix>\n")
+FILE(GLOB WXS_FILES *.wxs)
+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()
+
EXECUTE_PROCESS(
- COMMAND ${CANDLE_EXECUTABLE} *.wxs
- COMMAND ${LIGHT_EXECUTABLE} -ext WixUIExtension *.wixobj -out ${CPACK_PACKAGE_FILE_NAME}.msi
+ COMMAND ${LIGHT_EXECUTABLE} -ext WixUIExtension ${WIXOBJ_NATIVE_FILES} -out ${CPACK_PACKAGE_FILE_NAME}.msi
)
diff --git a/packaging/WiX/mysql_server.wxs.in b/packaging/WiX/mysql_server.wxs.in index 21f2a6256f3..a4289195d47 100644 --- a/packaging/WiX/mysql_server.wxs.in +++ b/packaging/WiX/mysql_server.wxs.in @@ -13,19 +13,10 @@ </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" />
+ <ComponentGroupRef Id="componentgroup.Client" />
</Feature>
</Feature>
<Feature Id='Devel' Level='1' Title="Development Components"
|