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:
micio 2011-01-24 16:20:38 +00:00
parent f59da848b5
commit 6c1daadc05
3 changed files with 91 additions and 2 deletions

View file

@ -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
}