[PATCH] (issue128) Add manifest for the correct execution level

Wald Commits scm-commit at wald.intevation.org
Wed Sep 24 11:42:33 CEST 2014


# HG changeset patch
# User Andre Heinecke <andre.heinecke at intevation.de>
# Date 1411551749 -7200
# Node ID 60927efa48cc781603ef076fd45c374b3d7f49b6
# Parent  cc86f69d6ac3cd6cfde3b02257022883d22b4b68
(issue128) Add manifest for the correct execution level.

diff -r cc86f69d6ac3 -r 60927efa48cc CMakeLists.txt
--- 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)
diff -r cc86f69d6ac3 -r 60927efa48cc cinst/CMakeLists.txt
--- 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})
diff -r cc86f69d6ac3 -r 60927efa48cc cinst/asInvoker.manifest
--- /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>
diff -r cc86f69d6ac3 -r 60927efa48cc cinst/asInvoker.rc
--- /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"
diff -r cc86f69d6ac3 -r 60927efa48cc ui/CMakeLists.txt
--- 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


More information about the Trustbridge-commits mailing list