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() ...@@ -95,7 +95,7 @@ ENDIF()
GET_TARGET_PROPERTY(WIXCA_LOCATION wixca LOCATION) GET_TARGET_PROPERTY(WIXCA_LOCATION wixca LOCATION)
SET(CPACK_WIX_CONFIG ${CMAKE_CURRENT_SOURCE_DIR}/CPackWixConfig.cmake) 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) IF(NOT upgrade_wizard_location)
SET(EXTRA_WIX_PREPROCESSOR_FLAGS "-dHaveUpgradeWizard=0") SET(EXTRA_WIX_PREPROCESSOR_FLAGS "-dHaveUpgradeWizard=0")
ENDIF() ENDIF()
......
...@@ -30,7 +30,15 @@ ...@@ -30,7 +30,15 @@
<Property Id="CLEANUPDATA" Secure="yes" Value="1"/> <Property Id="CLEANUPDATA" Secure="yes" Value="1"/>
<!-- Force per machine installation --> <!-- Force per machine installation -->
<Property Id="ALLUSERS" Secure="yes" Value="1"/> <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 User interface dialogs
--> -->
...@@ -435,6 +443,8 @@ ...@@ -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;" 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" /> Description="Opens command line in the installation bin directory" />
</Component> </Component>
</Feature> </Feature>
<Feature Id="SharedClientServerComponents" <Feature Id="SharedClientServerComponents"
...@@ -463,6 +473,20 @@ ...@@ -463,6 +473,20 @@
Arguments="/k &quot;set PATH=[D.bin];%PATH%;&amp;&amp;echo Setting environment for [ProductName] &quot;" 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" /> Description="Opens command line in the installation bin directory" />
</Component> </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> </Feature>
<!-- Custom action, call mysql_install_db --> <!-- Custom action, call mysql_install_db -->
...@@ -592,14 +616,7 @@ ...@@ -592,14 +616,7 @@
Optionally, start upgrade wizard on exit. 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" ?> <?if $(var.HaveUpgradeWizard) != "0" ?>
<UI> <UI>
...@@ -612,7 +629,7 @@ ...@@ -612,7 +629,7 @@
Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT"
Value="Launch wizard to upgrade existing MariaDB or MySQL services." /> Value="Launch wizard to upgrade existing MariaDB or MySQL services." />
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1"/> <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" <CustomAction Id="LaunchApplication"
BinaryKey="WixCA" BinaryKey="WixCA"
DllEntry="WixShellExec" DllEntry="WixShellExec"
...@@ -623,16 +640,16 @@ ...@@ -623,16 +640,16 @@
Execute="immediate" /> Execute="immediate" />
<InstallUISequence> <InstallUISequence>
<Custom Action="CheckServiceUpgrades" After="CostFinalize"> <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> </Custom>
</InstallUISequence> </InstallUISequence>
<SetProperty Before="ExecuteAction" Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" <SetProperty Before="ExecuteAction" Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT"
Sequence="ui" Value="[NonExistentProperty]"> 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>
<SetProperty Before="ExecuteAction" Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" <SetProperty Before="ExecuteAction" Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX"
Sequence="ui" Value="[NonExistentProperty]"> 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>
<?endif ?> <!-- HaveUpgradeWizard --> <?endif ?> <!-- HaveUpgradeWizard -->
......
...@@ -24,21 +24,21 @@ SET(CMAKE_MFC_FLAG 1) ...@@ -24,21 +24,21 @@ SET(CMAKE_MFC_FLAG 1)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/sql) INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/sql)
MYSQL_ADD_EXECUTABLE(upgrade_wizard MYSQL_ADD_EXECUTABLE(mysql_upgrade_wizard
upgrade.cpp upgradeDlg.cpp upgrade.rc upgrade.cpp upgradeDlg.cpp upgrade.rc
COMPONENT Server) 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 # upgrade_wizard is Windows executable, set WIN32_EXECUTABLE so it does not
# create a console. # 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 # 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 # 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 # 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. # 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( 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 COMMAND mt.exe -manifest ${CMAKE_CURRENT_SOURCE_DIR}/upgrade_wizard.exe.manifest
"-outputresource:${upgrade_wizard_location};#1" "-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