summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2007-09-11 15:21:37 -0400
committerDavid Cole <david.cole@kitware.com>2007-09-11 15:21:37 -0400
commita54169789d2eaffd83fa121d092e1af755c2a968 (patch)
tree2cc7bfabfad00c26abc2333a97de3b311b2ea742
parent1f99030cfa5d7782859d903e09eda3f518aa31a2 (diff)
downloadcmake-a54169789d2eaffd83fa121d092e1af755c2a968.tar.gz
ENH: Avoid prompting for admin privileges when running CMakeSetup.exe on Vista by adding a requestedExecutionLevel element to its manifest.
-rw-r--r--CTestCustom.cmake.in3
-rw-r--r--Source/MFCDialog/CMakeLists.txt19
-rw-r--r--Source/MFCDialog/CMakeSetupManifest.xml10
3 files changed, 30 insertions, 2 deletions
diff --git a/CTestCustom.cmake.in b/CTestCustom.cmake.in
index f6640f3ac7..bdd75245c8 100644
--- a/CTestCustom.cmake.in
+++ b/CTestCustom.cmake.in
@@ -22,9 +22,9 @@ SET(CTEST_CUSTOM_WARNING_EXCEPTION
"Clock skew detected"
"remark\\(1209"
"stl_deque.h:1051"
+ "CMakeSetupManifest.xml.*manifest authoring warning.*Unrecognized Element"
)
-
IF(NOT "@CMAKE_GENERATOR@" MATCHES "Xcode")
SET(CTEST_CUSTOM_COVERAGE_EXCLUDE
${CTEST_CUSTOM_COVERAGE_EXCLUDE}
@@ -38,4 +38,3 @@ IF(NOT "@CMAKE_GENERATOR@" MATCHES "KDevelop")
"Kdevelop"
)
ENDIF (NOT "@CMAKE_GENERATOR@" MATCHES "KDevelop")
-
diff --git a/Source/MFCDialog/CMakeLists.txt b/Source/MFCDialog/CMakeLists.txt
index 060509fa44..ae9fc3765e 100644
--- a/Source/MFCDialog/CMakeLists.txt
+++ b/Source/MFCDialog/CMakeLists.txt
@@ -30,4 +30,23 @@ SET(CMAKE_MFC_FLAG 2)
ADD_EXECUTABLE(CMakeSetup WIN32 ${SRCS})
TARGET_LINK_LIBRARIES(CMakeSetup CMakeLib)
ADD_DEPENDENCIES(CMakeSetup cmake)
+
+IF(MSVC AND NOT MSVC60 AND NOT MSVC70 AND NOT MSVC71)
+ SET(exe "${CMAKE_CFG_INTDIR}/CMakeSetup.exe")
+ IF(EXECUTABLE_OUTPUT_PATH)
+ SET(exe "${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/CMakeSetup.exe")
+ ENDIF(EXECUTABLE_OUTPUT_PATH)
+
+ # Solve the "things named like *Setup prompt for admin privileges
+ # on Vista" problem by merging a manifest fragment that contains a
+ # requestedExecutionLevel element:
+ #
+ ADD_CUSTOM_COMMAND(TARGET CMakeSetup
+ POST_BUILD COMMAND mt
+ "-inputresource:${exe};#1"
+ -manifest "${CMAKE_CURRENT_SOURCE_DIR}/CMakeSetupManifest.xml"
+ "-outputresource:${exe};#1"
+ )
+ENDIF(MSVC AND NOT MSVC60 AND NOT MSVC70 AND NOT MSVC71)
+
INSTALL_TARGETS(/bin CMakeSetup)
diff --git a/Source/MFCDialog/CMakeSetupManifest.xml b/Source/MFCDialog/CMakeSetupManifest.xml
new file mode 100644
index 0000000000..1a662f34ae
--- /dev/null
+++ b/Source/MFCDialog/CMakeSetupManifest.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
+ <security>
+ <requestedPrivileges>
+ <requestedExecutionLevel level="asInvoker"/>
+ </requestedPrivileges>
+ </security>
+</trustInfo>
+</assembly>