diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-04 23:38:32 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-04 23:38:32 +0000 |
commit | 48d4387babfc1e9a78028bce546bdccddb2e542b (patch) | |
tree | 6283b88d67a92b63d1e6db74862dbdf58de23e7e /chrome/app/client_util.cc | |
parent | aaa73ccc7ba5a44ce12160bfbb17a04743c2add5 (diff) | |
download | chromium_src-48d4387babfc1e9a78028bce546bdccddb2e542b.zip chromium_src-48d4387babfc1e9a78028bce546bdccddb2e542b.tar.gz chromium_src-48d4387babfc1e9a78028bce546bdccddb2e542b.tar.bz2 |
This fixes the following bugs1. http://b/issue?id=1447957 For machine installs we need to use a different version of the Omaha updater.2. http://b/issue?id=1447951 For Vista we need to elevate while performing the update operation. This only applies to machine installs. Update checks also instantiate the same COM object. However it does not need elevation.Bug=1447957, 1447951R=finnur, kuchhal
Review URL: http://codereview.chromium.org/8221
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4705 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/app/client_util.cc')
-rw-r--r-- | chrome/app/client_util.cc | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/chrome/app/client_util.cc b/chrome/app/client_util.cc index 333a525..a8841cd 100644 --- a/chrome/app/client_util.cc +++ b/chrome/app/client_util.cc @@ -3,8 +3,7 @@ // found in the LICENSE file. #include "chrome/app/client_util.h" - -#include <shlobj.h> +#include "chrome/installer/util/install_util.h" namespace client_util { const wchar_t kProductVersionKey[] = L"pv"; @@ -17,7 +16,7 @@ bool FileExists(const wchar_t* const file_path) { bool GetChromiumVersion(const wchar_t* const exe_path, const wchar_t* const reg_key_path, wchar_t** version) { - HKEY reg_root = IsUserModeInstall(exe_path) ? HKEY_CURRENT_USER : + HKEY reg_root = InstallUtil::IsPerUserInstall(exe_path) ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE; HKEY reg_key; if (::RegOpenKeyEx(reg_root, reg_key_path, 0, @@ -69,15 +68,5 @@ void GetExecutablePath(wchar_t* exe_path) { } } -bool IsUserModeInstall(const wchar_t* const exe_path) { - wchar_t buffer[MAX_PATH] = {0}; - if (!FAILED(SHGetFolderPath(NULL, CSIDL_PROGRAM_FILES, NULL, - SHGFP_TYPE_CURRENT, buffer))) { - if (exe_path == wcsstr(exe_path, buffer)) { - return false; - } - } - return true; -} } // namespace client_util |