summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2020-08-12 21:18:21 +0200
committerVladislav Vaintroub <wlad@mariadb.com>2020-08-12 21:18:21 +0200
commit754108021415ee718087b004a49bd54bd31cf6ad (patch)
treeca8968bfde42afd0739622bb2057dbf951bb7fb0
parent602d3dafa9496cd6996a787a4f16c4ab140f2ac2 (diff)
downloadmariadb-git-754108021415ee718087b004a49bd54bd31cf6ad.tar.gz
MDEV-23461 mysql_upgrade_wizard.exe differs from mariadb-upgrade-wizard.exe
The post-build custom command to embed Vista elevation manifest into mariadb-upgrade-wizard.exe seems to do something nasty to the executable, perhaps it removes and recreates it. Thus the previously created hardlink mysql_upgrade_wizard is not marked to require elevation. Solved by using MANIFESTUAC linker flag, rather than invoke mt.exe. This avoids an extra post-build step that modifies mariadb-upgrade-wizard.exe
-rw-r--r--win/upgrade_wizard/CMakeLists.txt15
1 files changed, 5 insertions, 10 deletions
diff --git a/win/upgrade_wizard/CMakeLists.txt b/win/upgrade_wizard/CMakeLists.txt
index 5a98ab15d0f..20a06a41215 100644
--- a/win/upgrade_wizard/CMakeLists.txt
+++ b/win/upgrade_wizard/CMakeLists.txt
@@ -35,17 +35,12 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/sql)
MYSQL_ADD_EXECUTABLE(mariadb-upgrade-wizard
upgrade.cpp upgradeDlg.cpp upgrade.rc ${UPGRADE_WIZARD_SOURCES}
COMPONENT Server)
+
+
TARGET_LINK_LIBRARIES(mariadb-upgrade-wizard ${UPGRADE_WIZARD_LINK_LIBRARIES})
# upgrade_wizard is Windows executable, set WIN32_EXECUTABLE so it does not
# create a console.
-SET_TARGET_PROPERTIES(mariadb-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.
-ADD_CUSTOM_COMMAND(
- TARGET mariadb-upgrade-wizard POST_BUILD
- COMMAND mt.exe -manifest ${CMAKE_CURRENT_SOURCE_DIR}/upgrade_wizard.exe.manifest
- "-outputresource:$<TARGET_FILE:mariadb-upgrade-wizard>;#1"
+SET_TARGET_PROPERTIES(mariadb-upgrade-wizard PROPERTIES
+ WIN32_EXECUTABLE 1
+ LINK_FLAGS "/MANIFESTUAC:level='requireAdministrator'"
)