summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorRalf Habacker <ralf.habacker@freenet.de>2017-09-26 12:06:10 +0200
committerRalf Habacker <ralf.habacker@freenet.de>2017-09-27 22:05:13 +0200
commit214fbc6dbfa3547e8cf250c1dd41f1990d98e823 (patch)
treedf839fb04c27630a6988ad6092023e30ce049f49 /cmake
parentc6e79f9113d320679d3c29f83b306cb6e5d81bee (diff)
downloaddbus-214fbc6dbfa3547e8cf250c1dd41f1990d98e823.tar.gz
Add Windows manifest to dbus-update-activation-environment.exe
This explicitly sets the execution level to 'asInvoker', preventing Windows' UAC heuristics from deciding that because its name mentions "update", it probably needs to escalate privileges. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=102558 Reviewed-by: Simon McVittie <smcv@collabora.com>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/tools/CMakeLists.txt9
1 files changed, 9 insertions, 0 deletions
diff --git a/cmake/tools/CMakeLists.txt b/cmake/tools/CMakeLists.txt
index 8b3de0c9..5613269e 100644
--- a/cmake/tools/CMakeLists.txt
+++ b/cmake/tools/CMakeLists.txt
@@ -62,6 +62,15 @@ add_executable(dbus-test-tool ${dbus_test_tool_SOURCES})
target_link_libraries(dbus-test-tool ${DBUS_LIBRARIES})
install(TARGETS dbus-test-tool ${INSTALL_TARGETS_DEFAULT_ARGS})
+if(WIN32)
+ # avoid dbus-update-activation-environment triggering UAC
+ # 1 is the resource ID, ID_MANIFEST
+ # 24 is the resource type, RT_MANIFEST
+ # constants are used because of a bug in windres
+ # see https://stackoverflow.com/questions/33000158/embed-manifest-file-to-require-administrator-execution-level-with-mingw32
+ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/disable-uac.rc "1 24 \"${CMAKE_SOURCE_DIR}/../tools/Win32.Manifest\"\n")
+ list(APPEND dbus_update_activation_environment_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/disable-uac.rc)
+endif()
add_executable(dbus-update-activation-environment ${dbus_update_activation_environment_SOURCES})
target_link_libraries(dbus-update-activation-environment ${DBUS_LIBRARIES})
install(TARGETS dbus-update-activation-environment ${INSTALL_TARGETS_DEFAULT_ARGS})