summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2007-09-11 19:21:37 (GMT)
committerDavid Cole <david.cole@kitware.com>2007-09-11 19:21:37 (GMT)
commita54169789d2eaffd83fa121d092e1af755c2a968 (patch)
tree2cc7bfabfad00c26abc2333a97de3b311b2ea742 /Source
parent1f99030cfa5d7782859d903e09eda3f518aa31a2 (diff)
downloadCMake-a54169789d2eaffd83fa121d092e1af755c2a968.zip
CMake-a54169789d2eaffd83fa121d092e1af755c2a968.tar.gz
CMake-a54169789d2eaffd83fa121d092e1af755c2a968.tar.bz2
ENH: Avoid prompting for admin privileges when running CMakeSetup.exe on Vista by adding a requestedExecutionLevel element to its manifest.
Diffstat (limited to 'Source')
-rw-r--r--Source/MFCDialog/CMakeLists.txt19
-rw-r--r--Source/MFCDialog/CMakeSetupManifest.xml10
2 files changed, 29 insertions, 0 deletions
diff --git a/Source/MFCDialog/CMakeLists.txt b/Source/MFCDialog/CMakeLists.txt
index 060509f..ae9fc37 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 0000000..1a662f3
--- /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>