[PATCH 3/3] Require administrator privileges (UAC)

Ľubomír Carik lubomir.carik at gmail.com
Wed Feb 21 15:12:54 PST 2018


The application requires higher run privileges to be able modify
network settings. With this change, there is no need to start
the tool explicitly in console with administrator rights.

Signed-off-by: Ľubomír Carik <Lubomir.Carik at gmail.com>
---
 openconnect.exe.manifest | 11 +++++++++++
 openconnect.rc           |  3 +++
 2 files changed, 14 insertions(+)
 create mode 100644 openconnect.exe.manifest

diff --git a/openconnect.exe.manifest b/openconnect.exe.manifest
new file mode 100644
index 0000000..51a810d
--- /dev/null
+++ b/openconnect.exe.manifest
@@ -0,0 +1,11 @@
+<?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="requireAdministrator" uiAccess="false" />
+      </requestedPrivileges>
+    </security>
+  </trustInfo>
+</assembly>
diff --git a/openconnect.rc b/openconnect.rc
index c4165a0..64bff48 100644
--- a/openconnect.rc
+++ b/openconnect.rc
@@ -1,3 +1,6 @@
+// UAC: require administrator
+1 24 "openconnect.exe.manifest"
+
 // application icon
 IDI_ICON1       ICON    DISCARDABLE     "openconnect.ico"
 
-- 
2.16.2




More information about the openconnect-devel mailing list