mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-09-10 03:54:54 -06:00
Bazaar/SysExec : fixed SysXXXAdmin() environment passing when app is already in elevated mode
git-svn-id: svn://ultimatepp.org/upp/trunk@3080 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
f59da848b5
commit
6c1daadc05
3 changed files with 91 additions and 2 deletions
|
|
@ -237,7 +237,10 @@ bool SysStartAdmin(String const &password, String const &command, String const &
|
|||
return SudoExec("root", password, command + " " + args, Environ, false);
|
||||
#else
|
||||
// on windows, no pass should be needed, it'll display the dialog automatically
|
||||
return ShellExec(command + " " + args, Environ, false);
|
||||
if(IsUserAdministrator())
|
||||
return SysStart(command, args, Environ);
|
||||
else
|
||||
return ShellExec(command + " " + args, Environ, false);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
@ -258,7 +261,10 @@ bool SysExecAdmin(String const &password, String const &command, String const &a
|
|||
return SudoExec("root", password, command + " " + args, Environ, true);
|
||||
#else
|
||||
// on windows, no pass should be needed, it'll display the dialog automatically
|
||||
return ShellExec(command + " " + args, Environ, true);
|
||||
if(IsUserAdministrator())
|
||||
return SysExec(command, args, Environ);
|
||||
else
|
||||
return ShellExec(command + " " + args, Environ, true);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue