Commit 835393a4 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

merge MWL#200

parents 6ae42b75 37f464f3
......@@ -42,6 +42,9 @@ EXTRA_DIST = build-vs71.bat build-vs8.bat build-vs8_x64.bat build-vs9.bat \
packaging/ca/CustomAction.rc \
packaging/WixUIBannerBmp.jpg \
packaging/WixUIDialogBmp.jpg \
packaging/heidisql.cmake \
packaging/heidisql.wxi.in \
packaging/heidisql_feature.wxi.in\
upgrade_wizard/resource.h \
upgrade_wizard/stdafx.h \
upgrade_wizard/targetver.h \
......
......@@ -103,6 +103,38 @@ IF(WITH_INNOBASE_STORAGE_ENGINE OR WITH_INNODB_STORAGE_ENGINE OR WITH_XTRADB_STO
SET(EXTRA_WIX_PREPROCESSOR_FLAGS ${EXTRA_WIX_PREPROCESSOR_FLAGS} "-dHaveInnodb=1")
ENDIF()
SET(THIRD_PARTY_FEATURE_CONDITION "")
IF(WITH_THIRD_PARTY)
SET(THIRD_PARTY_DOWNLOAD_LOCATION "$ENV{TEMP}")
IF(THIRD_PARTY_DOWNLOAD_LOCATION)
FILE(TO_CMAKE_PATH "${THIRD_PARTY_DOWNLOAD_LOCATION}" THIRD_PARTY_DOWNLOAD_LOCATION)
ELSE()
SET(THIRD_PARTY_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}")
ENDIF()
ENDIF()
GET_TARGET_PROPERTY(LIBMYSQL_LOCATION libmysql LOCATION)
FOREACH(third_party ${WITH_THIRD_PARTY})
SET(third_party_install_plugin ${CMAKE_CURRENT_SOURCE_DIR}/${third_party}.cmake)
IF(NOT EXISTS ${third_party_install_plugin})
MESSAGE(FATAL_ERROR
"Third party MSI installation plugin ${third_party_install_plugin} does not exist.
It was expected due to WITH_THIRD_PARTY=${WITH_THIRD_PARTY}"
)
ENDIF()
STRING(TOUPPER "${third_party}" upper_third_party)
IF(NOT THIRD_PARTY_FEATURE_CONDITION )
SET(THIRD_PARTY_FEATURE_CONDITION "<Condition Level='0'>${upper_third_party}INSTALLED")
ELSE()
SET(THIRD_PARTY_FEATURE_CONDITION "AND ${upper_third_party}INSTALLED")
ENDIF()
ENDFOREACH()
IF(THIRD_PARTY_FEATURE_CONDITION)
SET(THIRD_PARTY_FEATURE_CONDITION "${THIRD_PARTY_FEATURE_CONDITION}</Condition>")
ENDIF()
IF(NOT CPACK_WIX_UI)
SET(CPACK_WIX_UI "MyWixUI_Mondo")
ENDIF()
......
......@@ -23,8 +23,31 @@ SET(SIGNTOOL_PARAMETERS "@SIGNTOOL_PARAMETERS@")
SET(CMAKE_FULL_VER
"@CMAKE_MAJOR_VERSION@.@CMAKE_MINOR_VERSION@.@CMAKE_PATCH_VERSION@")
SET(EXTRA_WIX_PREPROCESSOR_FLAGS "@EXTRA_WIX_PREPROCESSOR_FLAGS@")
SET(WITH_THIRD_PARTY "@WITH_THIRD_PARTY@")
SET(THIRD_PARTY_DOWNLOAD_LOCATION "@THIRD_PARTY_DOWNLOAD_LOCATION@")
SET(THIRD_PARTY_FEATURE_CONDITION "@THIRD_PARTY_FEATURE_CONDITION@")
SET(LIBMYSQL_LOCATION "@LIBMYSQL_LOCATION@")
IF(LIBMYSQL_LOCATION AND CMAKE_CFG_INTDIR)
# resolve libmysql full path
STRING(REPLACE "${CMAKE_CFG_INTDIR}" "${CMAKE_INSTALL_CONFIG_NAME}" LIBMYSQL_LOCATION "${LIBMYSQL_LOCATION}")
ENDIF()
FOREACH(third_party ${WITH_THIRD_PARTY})
INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/${third_party}.cmake)
# Check than above script produced ${third_party}.wxi and ${third_party}_feature.wxi
FOREACH(outfile ${third_party}.wxi ${third_party}_feature.wxi)
IF(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/${outfile})
MESSAGE(FATAL_ERROR
"${CMAKE_CURRENT_SOURCE_DIR}/${third_party}.cmake did not produce "
"${CMAKE_CURRENT_BINARY_DIR}/${outfile}"
)
ENDIF()
ENDFOREACH()
ENDFOREACH()
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
SET(CANDLE_ARCH -arch x64)
......
......@@ -46,6 +46,9 @@
<Property Id="CLEANUPDATA" Secure="yes" Value="1"/>
<!-- Force per machine installation -->
<Property Id="ALLUSERS" Secure="yes" Value="1"/>
<!-- Disable advertised shortcuts weirdness -->
<Property Id="DISABLEADVTSHORTCUTS" Secure="yes" Value="1"/>
<?if $(var.HaveInnodb) = "1" ?>
<!-- Quick configuration : set default storage engine to innodb, use strict sql_mode -->
<Property Id="STDCONFIG" Secure="yes" Value="1"/>
......@@ -567,6 +570,38 @@
<?endif?>
</Feature>
<!-- Optional 3rd party tools -->
<DirectoryRef Id='TARGETDIR'>
<Directory Id='CommonFilesFolder'>
<Directory Id='MariaDBShared' Name='MariaDBShared'/>
</Directory>
<Directory Id='DesktopFolder'/>
</DirectoryRef>
<?if "@WITH_THIRD_PARTY@" != "" ?>
<!-- Include definition of 3party components -->
<?foreach tool in @WITH_THIRD_PARTY@ ?>
<?include "${CMAKE_CURRENT_BINARY_DIR}\$(var.tool).wxi" ?>
<?endforeach ?>
<Feature Id="ThirdPartyTools"
Title='Third party tools'
Description= 'Third party tools'
AllowAdvertise='no'
Level='1'
Display='expand'>
@THIRD_PARTY_FEATURE_CONDITION@
<!-- Include definition of 3rd party features -->
<?foreach tool in @WITH_THIRD_PARTY@ ?>
<?include "${CMAKE_CURRENT_BINARY_DIR}\$(var.tool)_feature.wxi" ?>
<?endforeach ?>
</Feature>
<?endif ?>
<!-- Custom action, call mysql_install_db -->
<SetProperty Sequence='execute' Before='CreateDatabaseCommand' Id="SKIPNETWORKING" Value="--skip-networking" >SKIPNETWORKING</SetProperty>
<SetProperty Sequence='execute' Before='CreateDatabaseCommand' Id="ALLOWREMOTEROOTACCESS" Value="--allow-remote-root-access">ALLOWREMOTEROOTACCESS</SetProperty>
......
SET(HEIDISQL_BASE_NAME "HeidiSQL_6.0_Portable")
SET(HEIDISQL_ZIP "${HEIDISQL_BASE_NAME}.zip")
SET(HEIDISQL_URL "http://heidisql.googlecode.com/files/${HEIDISQL_ZIP}")
SET(HEIDISQL_DOWNLOAD_DIR ${THIRD_PARTY_DOWNLOAD_LOCATION}/${HEIDISQL_BASE_NAME})
IF(NOT EXISTS ${HEIDISQL_DOWNLOAD_DIR}/${HEIDISQL_ZIP})
MAKE_DIRECTORY(${HEIDISQL_DOWNLOAD_DIR})
MESSAGE(STATUS "Downloading ${HEIDISQL_URL} to ${HEIDISQL_DOWNLOAD_DIR}/${HEIDISQL_ZIP}")
FILE(DOWNLOAD ${HEIDISQL_URL} ${HEIDISQL_DOWNLOAD_DIR}/${HEIDISQL_ZIP} TIMEOUT 60)
EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E chdir ${HEIDISQL_DOWNLOAD_DIR}
${CMAKE_COMMAND} -E tar xfz ${HEIDISQL_DOWNLOAD_DIR}/${HEIDISQL_ZIP}
)
ENDIF()
SET(LIBMYSQLDLL_SOURCE ${HEIDISQL_DOWNLOAD_DIR}/libmysql.dll)
IF(CMAKE_SIZEOF_VOID_P EQUAL 4)
# Use our libmysql if it is 32 bit.
IF(LIBMYSQL_LOCATION)
SET(LIBMYSQLDLL_SOURCE "${LIBMYSQL_LOCATION}")
ENDIF()
ENDIF()
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/heidisql.wxi.in ${CMAKE_CURRENT_BINARY_DIR}/heidisql.wxi)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/heidisql_feature.wxi.in ${CMAKE_CURRENT_BINARY_DIR}/heidisql_feature.wxi)
<Include>
<Property Id="HEIDISQLINSTALLED" Secure="yes">
<RegistrySearch Id="HeidiSQL"
Root="HKLM"
Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\HeidiSQL_is1"
Name="Install"
Type="raw"
Win64="no"
/>
</Property>
<DirectoryRef Id="MariaDBShared">
<Directory Id="D.HeidiSQL" Name="HeidiSQL">
<Component Id="component.HeidiSQL" Guid="96ea3879-5320-4098-8f26-2f655d2f716c" Win64="no">
<File Id="heidisql.gpl.txt" Name="gpl.txt" Source="${HEIDISQL_DOWNLOAD_DIR}\gpl.txt" />
<File Id="heidisql.heidisql.exe" Name="heidisql.exe" Source="${HEIDISQL_DOWNLOAD_DIR}\heidisql.exe" KeyPath="yes">
<Shortcut Id="desktopHeidiSQL" Directory="DesktopFolder" Name="HeidiSQL" Advertise="yes"/>
</File>
<!--
Forced file removal for heidisql.exe might be required.
HeidiSQL is self-updating, thus the version that was installed by MSI not necessarily matches
the version of the file on uninstall. MSI would not touch such file by default and leave it after
uninstallation. We use RemoveFile to force delete in any case.
-->
<RemoveFile Id="Remove_HeidiSQL_exe" Name="heidisql.exe" On="uninstall" />
<File Id="heidisql.license.txt" Name="license.txt" Source="${HEIDISQL_DOWNLOAD_DIR}\license.txt" />
<File Id="heidisql.readme.txt" Name="readme.txt" Source="${HEIDISQL_DOWNLOAD_DIR}\readme.txt" />
</Component>
<Component Id="component.HeidiSQL_MenuShortcut" Guid="*" Win64="no">
<RegistryValue Root="HKCU" Key="Software\@CPACK_WIX_PACKAGE_NAME@\Uninstall" Name="shortcuts.heidisql" Value="1" Type="string" KeyPath="yes" />
<Shortcut Id="startmenuHeidiSQL" Directory="ShortcutFolder" Name="HeidiSQL" Target="[D.HeidiSQL]\heidisql.exe"/>
<RemoveRegistryKey Id="HeidiSQL_RegistryCleanup" Root="HKCU" Key="SOFTWARE\HeidiSQL" Action="removeOnUninstall" />
</Component>
<Component Id="component.HeidiSQL_libmysql.dll" Guid="*" Win64="no">
<File Id="heidisql.libmysql.dll" Name="libmysql.dll" Source="${LIBMYSQLDLL_SOURCE}" />
</Component>
</Directory>
</DirectoryRef>
<ComponentGroup Id="HeidiSQL">
<ComponentRef Id="component.HeidiSQL"/>
<ComponentRef Id="component.HeidiSQL_MenuShortcut"/>
<ComponentRef Id="component.HeidiSQL_libmysql.dll"/>
</ComponentGroup>
</Include>
<Include>
<Feature Id="HeidiSQL"
Title='HeidiSQL'
Description= 'Powerful, easy and free MySQL/MariaDB GUI client by Ansgar Becker'
AllowAdvertise='no'
Level='1'>
<Condition Level="0">HEIDISQLINSTALLED</Condition>
<ComponentGroupRef Id='HeidiSQL'/>
</Feature>
</Include>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment