Commit 3ec6533a authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

MWL#55 : address Philip's final review comments :

- rename upgrade_wizard.exe to mysql_upgrade_wizard.exe
- have shortcut to upgrade wizard in the menu folder
parent 577d02b1
......@@ -95,7 +95,7 @@ ENDIF()
GET_TARGET_PROPERTY(WIXCA_LOCATION wixca LOCATION)
SET(CPACK_WIX_CONFIG ${CMAKE_CURRENT_SOURCE_DIR}/CPackWixConfig.cmake)
GET_TARGET_PROPERTY(upgrade_wizard_location upgrade_wizard LOCATION)
GET_TARGET_PROPERTY(upgrade_wizard_location mysql_upgrade_wizard LOCATION)
IF(NOT upgrade_wizard_location)
SET(EXTRA_WIX_PREPROCESSOR_FLAGS "-dHaveUpgradeWizard=0")
ENDIF()
......
......@@ -30,6 +30,14 @@
<Property Id="CLEANUPDATA" Secure="yes" Value="1"/>
<!-- Force per machine installation -->
<Property Id="ALLUSERS" Secure="yes" Value="1"/>
<!--
Check, if upgrade wizard was built
It currently requires MFC, which is not in SDK
neither in express edítions of VS.
-->
<?ifndef HaveUpgradeWizard ?>
<?define HaveUpgradeWizard="1"?>
<?endif?>
<!--
User interface dialogs
......@@ -435,6 +443,8 @@
Arguments="/k &quot;set MYSQL_HOME=[DATADIR]&amp;&amp; set PATH=[D.bin];%PATH%;&amp;&amp;echo Setting environment for [ProductName] &quot;"
Description="Opens command line in the installation bin directory" />
</Component>
</Feature>
<Feature Id="SharedClientServerComponents"
......@@ -463,6 +473,20 @@
Arguments="/k &quot;set PATH=[D.bin];%PATH%;&amp;&amp;echo Setting environment for [ProductName] &quot;"
Description="Opens command line in the installation bin directory" />
</Component>
<?if $(var.HaveUpgradeWizard) != "0" ?>
<ComponentRef Id='C.bin.mysql_upgrade_wizard.exe'/>
<Component Id="c.shortcuts.upgrade_wizard" Guid="*" Directory="ShortcutFolder" Transitive="yes">
<RegistryValue
Root="HKCU" Key="Software\@CPACK_WIX_PACKAGE_NAME@\Uninstall"
Name="shortcuts.upgrade_wizard"
Value="1" Type="string" KeyPath="yes" />
<Shortcut Id="shortcut.upgrade_wizard"
Name="Upgrade Wizard (@CPACK_WIX_PACKAGE_NAME@)"
Target="[INSTALLDIR]bin\mysql_upgrade_wizard.exe"
Directory="ShortcutFolder"
Description="Upgrades older instances of MariaDB/MySQL services to version @MAJOR_VERSION@.@MINOR_VERSION@" />
</Component>
<?endif?>
</Feature>
<!-- Custom action, call mysql_install_db -->
......@@ -592,14 +616,7 @@
Optionally, start upgrade wizard on exit.
-->
<!--
Check, if upgrade wizard was built
It currently requires MFC, which is not in SDK
neither in express edítions of VS.
-->
<?ifndef HaveUpgradeWizard ?>
<?define HaveUpgradeWizard="1"?>
<?endif?>
<?if $(var.HaveUpgradeWizard) != "0" ?>
<UI>
......@@ -612,7 +629,7 @@
Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT"
Value="Launch wizard to upgrade existing MariaDB or MySQL services." />
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1"/>
<Property Id="WixShellExecTarget" Value="[#F.bin.upgrade_wizard.exe]" />
<Property Id="WixShellExecTarget" Value="[#F.bin.mysql_upgrade_wizard.exe]" />
<CustomAction Id="LaunchApplication"
BinaryKey="WixCA"
DllEntry="WixShellExec"
......@@ -623,16 +640,16 @@
Execute="immediate" />
<InstallUISequence>
<Custom Action="CheckServiceUpgrades" After="CostFinalize">
$C.bin.upgrade_wizard.exe = 3 AND NOT Installed
$C.bin.mysql_upgrade_wizard.exe = 3 AND NOT Installed
</Custom>
</InstallUISequence>
<SetProperty Before="ExecuteAction" Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT"
Sequence="ui" Value="[NonExistentProperty]">
<![CDATA[($C.bin.upgrade_wizard.exe <> 3) AND NOT Installed]]>
<![CDATA[($C.bin.mysql_upgrade_wizard.exe <> 3) AND NOT Installed]]>
</SetProperty>
<SetProperty Before="ExecuteAction" Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX"
Sequence="ui" Value="[NonExistentProperty]">
<![CDATA[($C.bin.upgrade_wizard.exe <> 3) AND NOT Installed]]>
<![CDATA[($C.bin.mysql_upgrade_wizard.exe <> 3) AND NOT Installed]]>
</SetProperty>
<?endif ?> <!-- HaveUpgradeWizard -->
......
......@@ -24,21 +24,21 @@ SET(CMAKE_MFC_FLAG 1)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/sql)
MYSQL_ADD_EXECUTABLE(upgrade_wizard
MYSQL_ADD_EXECUTABLE(mysql_upgrade_wizard
upgrade.cpp upgradeDlg.cpp upgrade.rc
COMPONENT Server)
TARGET_LINK_LIBRARIES(upgrade_wizard winservice)
TARGET_LINK_LIBRARIES(mysql_upgrade_wizard winservice)
# upgrade_wizard is Windows executable, set WIN32_EXECUTABLE so it does not
# create a console.
SET_TARGET_PROPERTIES(upgrade_wizard PROPERTIES WIN32_EXECUTABLE 1)
SET_TARGET_PROPERTIES(mysql_upgrade_wizard PROPERTIES WIN32_EXECUTABLE 1)
# Embed Vista "admin" manifest, since upgrade_wizard needs admin privileges
# to change service configuration. Due to a CMake bug http://www.vtk.org/Bug/view.php?id=11171
# it is not possible currenly to do it with linker flags. Work around is to use
# manifest tool mt.exe and embed the manifest post-build.
GET_TARGET_PROPERTY(upgrade_wizard_location upgrade_wizard LOCATION)
GET_TARGET_PROPERTY(upgrade_wizard_location mysql_upgrade_wizard LOCATION)
ADD_CUSTOM_COMMAND(
TARGET upgrade_wizard POST_BUILD
TARGET mysql_upgrade_wizard POST_BUILD
COMMAND mt.exe -manifest ${CMAKE_CURRENT_SOURCE_DIR}/upgrade_wizard.exe.manifest
"-outputresource:${upgrade_wizard_location};#1"
)
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