Commit 78145e4a authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

MWL#200 - provide options to install 3rd party components.

Added HeidiSQL as example, i.e cmake -DWITH_THIRD_PARTY=HeidiSQL  
and building MSI will bundle HeidiSQL.
parent 7430485c
......@@ -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,37 @@ 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()
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,25 @@ 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@")
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}")
IF(NOT EXISTS ${THIRD_PARTY_DOWNLOAD_LOCATION}/HeidiSQL/${HEIDISQL_ZIP})
MAKE_DIRECTORY(${THIRD_PARTY_DOWNLOAD_LOCATION}/HeidiSQL)
MESSAGE(STATUS "Downloading ${HEIDISQL_URL} to ${THIRD_PARTY_DOWNLOAD_LOCATION}/HeidiSQL/${HEIDISQL_ZIP}")
FILE(DOWNLOAD ${HEIDISQL_URL} ${THIRD_PARTY_DOWNLOAD_LOCATION}/HeidiSQL/${HEIDISQL_ZIP} TIMEOUT 60)
EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E chdir ${THIRD_PARTY_DOWNLOAD_LOCATION}/HeidiSQL
${CMAKE_COMMAND} -E tar xfz ${THIRD_PARTY_DOWNLOAD_LOCATION}/HeidiSQL/${HEIDISQL_ZIP}
)
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>
<Icon Id='heidisql.exe' SourceFile='${THIRD_PARTY_DOWNLOAD_LOCATION}\HeidiSQL\heidisql.exe' />
<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='${THIRD_PARTY_DOWNLOAD_LOCATION}\HeidiSQL\gpl.txt' />
<File Id='heidisql.heidisql.exe' Name='heidisql.exe' Source='${THIRD_PARTY_DOWNLOAD_LOCATION}\HeidiSQL\heidisql.exe' KeyPath='yes'>
<Shortcut Id="desktopHeidiSQL" Directory="DesktopFolder" Name="HeidiSQL" Icon='heidisql.exe' Advertise='yes'/>
</File>
<File Id='heidisql.libmysql.dll' Name='libmysql.dll' Source='${THIRD_PARTY_DOWNLOAD_LOCATION}\HeidiSQL\libmysql.dll' />
<File Id='heidisql.license.txt' Name='license.txt' Source='${THIRD_PARTY_DOWNLOAD_LOCATION}\HeidiSQL\license.txt' />
<File Id='heidisql.portable_settings.txt' Name='portable_settings.txt' Source='${THIRD_PARTY_DOWNLOAD_LOCATION}\HeidiSQL\portable_settings.txt' />
<File Id='heidisql.readme.txt' Name='readme.txt' Source='${THIRD_PARTY_DOWNLOAD_LOCATION}\HeidiSQL\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'/>
</Component>
</Directory>
</DirectoryRef>
<ComponentGroup Id='HeidiSQL'>
<ComponentRef Id='component.HeidiSQL'/>
<ComponentRef Id='component.HeidiSQL_MenuShortcut'/>
</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