Skip to content

Commit e474364

Browse files
Piotr Obrzutnawazn
authored andcommitted
Bug#26171638 MYSQL 5.5.57 - MSI COMMUNITY PACKAGES NOT GETTING INSTALLED
Corrected the revert. (cherry picked from commit f637e524bf9b692c3ed46d856e2beac193b42a3e) (cherry picked from commit 4104f9089cdfaf9e7859365aaea9d1cdc7baaac5)
1 parent a5007e2 commit e474364

File tree

2 files changed

+31
-26
lines changed

2 files changed

+31
-26
lines changed

packaging/WiX/create_msi.cmake.in

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,37 @@ MACRO(GENERATE_GUID VarName)
230230
OUTPUT_STRIP_TRAILING_WHITESPACE)
231231
ENDMACRO()
232232

233+
# Make sure that WIX identifier created from a path matches all the rules:
234+
# - it is shorter than 72 characters
235+
# - doesn't contain reserver characters ('+', '-' and '/')
236+
# ID_SET contains a global list of all identifiers which are too long.
237+
# Every time we use an identifier which is too long we use its index in
238+
# ID_SET to shorten the name.
239+
SET_PROPERTY(GLOBAL PROPERTY ID_SET)
240+
MACRO(MAKE_WIX_IDENTIFIER str varname)
241+
STRING(REPLACE "/" "." ${varname} "${str}")
242+
STRING(REPLACE "+" "p" ${varname} "${str}")
243+
STRING(REPLACE "-" "m" ${varname} "${str}")
244+
STRING(REGEX REPLACE "[^a-zA-Z_0-9.]" "_" ${varname} "${${varname}}")
245+
STRING(LENGTH "${${varname}}" len)
246+
# FIXME: the prefix length has to be controlled better
247+
# Identifier should be smaller than 72 character
248+
# We have to cut down the length to 40 chars, since we add prefixes
249+
# pretty often
250+
IF(len GREATER 40)
251+
STRING(SUBSTRING "${${varname}}" 0 37 shortstr)
252+
GET_PROPERTY(LOCAL_LIST GLOBAL PROPERTY ID_SET)
253+
LIST(FIND LOCAL_LIST "${${varname}}" STRING_ID)
254+
IF(${STRING_ID} EQUAL -1)
255+
LIST(APPEND LOCAL_LIST "${${varname}}")
256+
SET_PROPERTY(GLOBAL PROPERTY ID_SET "${LOCAL_LIST}")
257+
LIST(LENGTH LOCAL_LIST STRING_ID)
258+
MATH(EXPR STRING_ID "${STRING_ID}-1" )
259+
ENDIF()
260+
SET(${varname} "${shortstr}${STRING_ID}")
261+
ENDIF()
262+
ENDMACRO()
263+
233264
FUNCTION(TRAVERSE_FILES dir topdir file file_comp dir_root)
234265
FILE(RELATIVE_PATH dir_rel ${topdir} ${dir})
235266
IF(dir_rel)

packaging/WiX/mysql_server.wxs.in

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -61,32 +61,6 @@
6161
<InstallExecuteSequence>
6262
<RemoveExistingProducts After="InstallInitialize"/>
6363
</InstallExecuteSequence>
64-
65-
<?if "@LINK_STATIC_RUNTIME_LIBRARIES@"="OFF" ?>
66-
<?if "@Platform@"="x64"?>
67-
<Property Id="VS08REDISTX64">
68-
<RegistrySearch Id="FindRedistVS08"
69-
Root="HKLM"
70-
Key="SOFTWARE\Classes\Installer\Products\153AA053AF120723B8A73845437E66DA"
71-
Name="Version"
72-
Type="raw" />
73-
</Property>
74-
<Condition Message="This application requires Visual Studio 2008 x64 Redistributable. Please install the Redistributable then run this installer again.">
75-
Installed OR VS08REDISTX64
76-
</Condition>
77-
<?elseif "@Platform@"="x86" ?>
78-
<Property Id="VS08REDISTX86">
79-
<RegistrySearch Id="FindRedistVS08"
80-
Root="HKLM"
81-
Key="SOFTWARE\Classes\Installer\Products\6F9E66FF7E38E3A3FA41D89E8A906A4A"
82-
Name="Version"
83-
Type="raw" />
84-
</Property>
85-
<Condition Message="This application requires Visual Studio 2008 x86 Redistributable. Please install the Redistributable then run this installer again.">
86-
Installed OR VS08REDISTX86
87-
</Condition>
88-
<?endif?>
89-
<?endif?>
9064

9165
<!-- Save/restore install location -->
9266
<CustomAction Id="SaveTargetDir" Property="ARPINSTALLLOCATION" Value="[INSTALLDIR]" />

0 commit comments

Comments
 (0)