Mercurial > trustbridge
diff ui/installwrapper.cpp @ 841:216a65d7fc4b
(issue66) Implement is_system_install and use it
This has completly different implementations for linux
and Windows. The commit also moves some code into util.c
for better reuse.
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Tue, 29 Jul 2014 18:12:57 +0200 |
parents | 51830f4912c2 |
children | b8ae69bcc540 |
line wrap: on
line diff
--- a/ui/installwrapper.cpp Tue Jul 29 13:15:32 2014 +0200 +++ b/ui/installwrapper.cpp Tue Jul 29 18:12:57 2014 +0200 @@ -96,7 +96,7 @@ shExecInfo.cbSize = sizeof(SHELLEXECUTEINFOW); shExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS; - if (!is_admin()) { + if (!is_admin() || !is_system_install()) { shExecInfo.lpVerb = L"open"; } else { shExecInfo.lpVerb = L"runas"; @@ -156,7 +156,7 @@ parameters << "list=" + mCertListFile << "choices=" + choicesFile.fileName(); bool sudo_started = false; - bool use_sudo = is_admin(); + bool use_sudo = is_admin() && is_system_install(); if (use_sudo) { QStringList sudoPrograms; sudoPrograms << "gksudo" << "kdesudo" << "sudo";