mirror of
https://github.com/MariaDB/server.git
synced 2026-05-16 11:57:38 +02:00
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
This commit is contained in:
parent
602d3dafa9
commit
7541080214
1 changed files with 5 additions and 10 deletions
|
|
@ -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'"
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue