changeset 1220:60927efa48cc

(issue128) Add manifest for the correct execution level.
author Andre Heinecke <andre.heinecke@intevation.de>
date Wed, 24 Sep 2014 11:42:29 +0200
parents cc86f69d6ac3
children c2d590d15141
files CMakeLists.txt cinst/CMakeLists.txt cinst/asInvoker.manifest cinst/asInvoker.rc ui/CMakeLists.txt
diffstat 5 files changed, 38 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/CMakeLists.txt	Wed Sep 24 11:35:20 2014 +0200
+++ b/CMakeLists.txt	Wed Sep 24 11:42:29 2014 +0200
@@ -134,6 +134,12 @@
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
 
+# Cmake does not correctly identify gcc windres when cross compiling
+# making this line neccessary to set the correct flags for it.
+# See: http://public.kitware.com/Bug/view.php?id=11773
+SET(CMAKE_RC_COMPILE_OBJECT
+      "<CMAKE_RC_COMPILER> <FLAGS> <DEFINES> -Ocoff <SOURCE> <OBJECT>")
+
 add_subdirectory(common)
 
 add_subdirectory(cinst)
--- a/cinst/CMakeLists.txt	Wed Sep 24 11:35:20 2014 +0200
+++ b/cinst/CMakeLists.txt	Wed Sep 24 11:42:29 2014 +0200
@@ -17,6 +17,15 @@
     ${CMAKE_CURRENT_SOURCE_DIR}/nssstore_win.c
     ${CMAKE_CURRENT_SOURCE_DIR}/certificate-installer.c
 )
+if (WIN32)
+   # Add asInvoker manifest to avoid windows heuristics
+   # that want to always run an -installer with admin rights.
+    set(trustbridge-certificate-installer_SOURCES
+       ${trustbridge-certificate-installer_SOURCES}
+       ${CMAKE_CURRENT_SOURCE_DIR}/asInvoker.rc)
+endif()
+
+
 add_executable(trustbridge-certificate-installer ${trustbridge-certificate-installer_SOURCES})
 
 if (WIN32)
@@ -62,6 +71,15 @@
  ${CMAKE_CURRENT_SOURCE_DIR}/nss-installer.c
  )
 
+if (WIN32)
+   # Add asInvoker manifest to avoid windows heuristics
+   # that want to always run an -installer with admin rights.
+    set(trustbridge-nss-installer_SOURCES
+       ${trustbridge-nss-installer_SOURCES}
+       ${CMAKE_CURRENT_SOURCE_DIR}/asInvoker.rc)
+endif()
+
+
 if(WIN32 OR NSS_FOUND)
    include_directories(${NSS_INCLUDE_DIRS})
    add_executable(trustbridge-nss-installer ${trustbridge-nss-installer_SOURCES})
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cinst/asInvoker.manifest	Wed Sep 24 11:42:29 2014 +0200
@@ -0,0 +1,12 @@
+<?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"
+          uiAccess="false"/>
+        </requestedPrivileges>
+       </security>
+  </trustInfo>
+</assembly>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cinst/asInvoker.rc	Wed Sep 24 11:42:29 2014 +0200
@@ -0,0 +1,2 @@
+#include "winuser.h"
+1 RT_MANIFEST "asInvoker.manifest"
--- a/ui/CMakeLists.txt	Wed Sep 24 11:35:20 2014 +0200
+++ b/ui/CMakeLists.txt	Wed Sep 24 11:42:29 2014 +0200
@@ -37,12 +37,6 @@
    MESSAGE(FATAL_ERROR "libcurl not found but usage of curl is requested.")
 endif()
 
-# Cmake does not correctly identify gcc windres when cross compiling
-# making this line neccessary to set the correct flags for it.
-# See: http://public.kitware.com/Bug/view.php?id=11773
-SET(CMAKE_RC_COMPILE_OBJECT
-      "<CMAKE_RC_COMPILER> <FLAGS> <DEFINES> -Ocoff <SOURCE> <OBJECT>")
-
 set(TRUSTBRIDGE_SOURCES
     ${CMAKE_CURRENT_SOURCE_DIR}/mainwindow.cpp
     ${CMAKE_CURRENT_SOURCE_DIR}/helpdialog.cpp

http://wald.intevation.org/projects/trustbridge/