Add manifest file on Windows to make the application UAC aware.
authorTobias Haeussler <mail@tobiashaeussler.com>
Sat, 29 Oct 2016 20:06:03 +0000 (22:06 +0200)
committerOlivier Goffart <olivier@woboq.com>
Mon, 14 Nov 2016 11:16:58 +0000 (12:16 +0100)
src/gui/CMakeLists.txt
src/gui/manifest-mingw.rc [new file with mode: 0644]
src/gui/owncloud.exe.manifest-mingw [new file with mode: 0644]

index af4c98ff905c7cd9d27b653456bf63b4ddf2dede..d38d14b52807b59582294a90d55fe48b120fa3fc 100644 (file)
@@ -199,6 +199,9 @@ IF( WIN32 )
       ${CMAKE_CURRENT_BINARY_DIR}/version.rc
       @ONLY)
     set(client_version ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
+    IF(NOT MSVC)
+        set(client_manifest ${CMAKE_CURRENT_SOURCE_DIR}/manifest-mingw.rc)
+    ENDIF()
 ENDIF()
 
 set( final_src
@@ -206,6 +209,7 @@ set( final_src
     ${client_SRCS}
     ${client_UI_SRCS}
     ${client_version}
+    ${client_manifest}
     ${guiMoc}
     ${client_I18N}
     ${3rdparty_SRC}
diff --git a/src/gui/manifest-mingw.rc b/src/gui/manifest-mingw.rc
new file mode 100644 (file)
index 0000000..e3125c9
--- /dev/null
@@ -0,0 +1,3 @@
+#include "winuser.h"
+
+CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "owncloud.exe.manifest-mingw"
diff --git a/src/gui/owncloud.exe.manifest-mingw b/src/gui/owncloud.exe.manifest-mingw
new file mode 100644 (file)
index 0000000..ecea6f7
--- /dev/null
@@ -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' uiAccess='false' />
+      </requestedPrivileges>
+    </security>
+  </trustInfo>
+</assembly>