Mercurial > trustbridge
changeset 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 | 20f81c195cc4 |
children | d1812e171d0c |
files | ui/installwrapper.cpp |
diffstat | 1 files changed, 6 insertions(+), 1 deletions(-) [+] |
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());