[PATCH 1 of 7] Use open instead of runas if not admin

Wald Commits scm-commit at wald.intevation.org
Mon Apr 28 19:15:53 CEST 2014


# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1398681839 0
# Node ID cef7320727743af31a4e3ca301b5e3b15c95c3b2
# Parent  20f81c195cc4a16c92a3081bce088072bfc17a30
Use open instead of runas if not admin

diff -r 20f81c195cc4 -r cef732072774 ui/installwrapper.cpp
--- a/ui/installwrapper.cpp	Mon Apr 28 10:15:45 2014 +0000
+++ b/ui/installwrapper.cpp	Mon Apr 28 10:43:59 2014 +0000
@@ -15,6 +15,7 @@
 #include <QDebug>
 
 #include "logging.h"
+#include "util.h"
 
 #define INSTALL_TIMEOUT 3600000 /* Wait up to an hour */
 
@@ -95,7 +96,11 @@
 
     shExecInfo.cbSize = sizeof(SHELLEXECUTEINFOW);
     shExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
-    shExecInfo.lpVerb = L"runas";
+    if (!is_admin()) {
+        shExecInfo.lpVerb = L"open";
+    } else {
+        shExecInfo.lpVerb = L"runas";
+    }
     shExecInfo.lpFile = reinterpret_cast<LPCWSTR> (cinstFileName.utf16());
     shExecInfo.lpParameters =  reinterpret_cast<LPCWSTR> (parameters.utf16());
 


More information about the Trustbridge-commits mailing list