diff options
author | Vladislav Vaintroub <wlad@montyprogram.com> | 2011-06-01 15:52:52 +0200 |
---|---|---|
committer | Vladislav Vaintroub <wlad@montyprogram.com> | 2011-06-01 15:52:52 +0200 |
commit | 02dabe3597be3bd418c1cd28a3172a6b0cce24e3 (patch) | |
tree | 3d5103bf2f915c44b9bac0134f8c6254cf65959b /win | |
parent | 00752ba43c9034fd77e03a65f2a6be9ea15032d2 (diff) | |
download | mariadb-git-02dabe3597be3bd418c1cd28a3172a6b0cce24e3.tar.gz |
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.
Diffstat (limited to 'win')
-rw-r--r-- | win/Makefile.am | 3 | ||||
-rw-r--r-- | win/packaging/CMakeLists.txt | 31 | ||||
-rw-r--r-- | win/packaging/create_msi.cmake.in | 17 | ||||
-rw-r--r-- | win/packaging/extra.wxs.in | 35 | ||||
-rw-r--r-- | win/packaging/heidisql.cmake | 13 | ||||
-rw-r--r-- | win/packaging/heidisql.wxi.in | 35 | ||||
-rw-r--r-- | win/packaging/heidisql_feature.wxi.in | 10 |
7 files changed, 144 insertions, 0 deletions
diff --git a/win/Makefile.am b/win/Makefile.am index b657acfd65c..310c54bc117 100644 --- a/win/Makefile.am +++ b/win/Makefile.am @@ -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 \ diff --git a/win/packaging/CMakeLists.txt b/win/packaging/CMakeLists.txt index 02fba4ae16b..8c8cca60c35 100644 --- a/win/packaging/CMakeLists.txt +++ b/win/packaging/CMakeLists.txt @@ -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() diff --git a/win/packaging/create_msi.cmake.in b/win/packaging/create_msi.cmake.in index 13c433887b8..80560a8c1f2 100644 --- a/win/packaging/create_msi.cmake.in +++ b/win/packaging/create_msi.cmake.in @@ -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) diff --git a/win/packaging/extra.wxs.in b/win/packaging/extra.wxs.in index 456b833cf4f..5aab7bc813c 100644 --- a/win/packaging/extra.wxs.in +++ b/win/packaging/extra.wxs.in @@ -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>
diff --git a/win/packaging/heidisql.cmake b/win/packaging/heidisql.cmake new file mode 100644 index 00000000000..c1dfb7c4cad --- /dev/null +++ b/win/packaging/heidisql.cmake @@ -0,0 +1,13 @@ +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)
diff --git a/win/packaging/heidisql.wxi.in b/win/packaging/heidisql.wxi.in new file mode 100644 index 00000000000..d47d4ae67c0 --- /dev/null +++ b/win/packaging/heidisql.wxi.in @@ -0,0 +1,35 @@ +<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>
diff --git a/win/packaging/heidisql_feature.wxi.in b/win/packaging/heidisql_feature.wxi.in new file mode 100644 index 00000000000..9fceb4689d0 --- /dev/null +++ b/win/packaging/heidisql_feature.wxi.in @@ -0,0 +1,10 @@ +<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>
|