diff options
author | kuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-15 22:58:02 +0000 |
---|---|---|
committer | kuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-15 22:58:02 +0000 |
commit | 3216aa820e40c3a99374961546b0030da375a164 (patch) | |
tree | ed9d4de68bbd3d0e202e7ec96c3911e48ed4d66a /chrome/installer/util/shell_util.cc | |
parent | bfbafe26d2d97f378da686f2a64016ac25562c16 (diff) | |
download | chromium_src-3216aa820e40c3a99374961546b0030da375a164.zip chromium_src-3216aa820e40c3a99374961546b0030da375a164.tar.gz chromium_src-3216aa820e40c3a99374961546b0030da375a164.tar.bz2 |
While doing system level install on Vista, if installer is not running
as admin already, relaunch it as admin (that will bring up Vista
elevation dialog).
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3433 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer/util/shell_util.cc')
-rw-r--r-- | chrome/installer/util/shell_util.cc | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/chrome/installer/util/shell_util.cc b/chrome/installer/util/shell_util.cc index e0ab52f..9e4215f 100644 --- a/chrome/installer/util/shell_util.cc +++ b/chrome/installer/util/shell_util.cc @@ -24,6 +24,7 @@ #include "chrome/common/chrome_switches.h" #include "chrome/installer/util/browser_distribution.h" #include "chrome/installer/util/create_reg_key_work_item.h" +#include "chrome/installer/util/install_util.h" #include "chrome/installer/util/l10n_string_util.h" #include "chrome/installer/util/set_reg_value_work_item.h" #include "chrome/installer/util/util_constants.h" @@ -235,23 +236,13 @@ ShellUtil::RegisterStatus RegisterOnVista(const std::wstring& chrome_exe, TrimString(exe_path, L" \"", &exe_path); } if (file_util::PathExists(exe_path)) { - SHELLEXECUTEINFO info = {0}; - info.cbSize = sizeof(SHELLEXECUTEINFO); - info.fMask = SEE_MASK_NOCLOSEPROCESS; - info.lpVerb = L"runas"; - info.lpFile = exe_path.c_str(); std::wstring params(L"--"); params.append(installer_util::switches::kRegisterChromeBrowser); params.append(L"=\"" + chrome_exe + L"\""); - info.lpParameters = params.c_str(); - info.nShow = SW_SHOW; - if (::ShellExecuteEx(&info)) { - ::WaitForSingleObject(info.hProcess, INFINITE); - DWORD ret_val = ShellUtil::SUCCESS; - if (::GetExitCodeProcess(info.hProcess, &ret_val) && - (ret_val == ShellUtil::SUCCESS)) - return ShellUtil::SUCCESS; - } + DWORD ret_val = ShellUtil::SUCCESS; + InstallUtil::ExecuteExeAsAdmin(exe_path, params, &ret_val); + if (ret_val == ShellUtil::SUCCESS) + return ShellUtil::SUCCESS; } } return ShellUtil::FAILURE; |