diff ui/installwrapper.cpp @ 511:cef732072774

Use open instead of runas if not admin
author Andre Heinecke <aheinecke@intevation.de>
date Mon, 28 Apr 2014 10:43:59 +0000
parents a7163018de2f
children a9a57dc1eb2f
line wrap: on
line diff
--- 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());
 

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