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 | |
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')
-rw-r--r-- | chrome/app/client_util.cc | 15 | ||||
-rw-r--r-- | chrome/app/client_util.h | 3 | ||||
-rw-r--r-- | chrome/app/google_update_client.cc | 3 |
3 files changed, 4 insertions, 17 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 diff --git a/chrome/app/client_util.h b/chrome/app/client_util.h index e4b479e..f0b75bb 100644 --- a/chrome/app/client_util.h +++ b/chrome/app/client_util.h @@ -40,9 +40,6 @@ std::wstring GetDLLPath(const std::wstring dll_name, // function. The buffer should already be allocated (ideally of MAX_PATH size). void GetExecutablePath(wchar_t* exe_path); -// Returns false if this is system level install (exe_path is same as -// Program Files path) else returns true. -bool IsUserModeInstall(const wchar_t* const exe_path); } // namespace client_util #endif // CHROME_APP_CLIENT_UTIL_H_ diff --git a/chrome/app/google_update_client.cc b/chrome/app/google_update_client.cc index b691ec5..8ae8aee 100644 --- a/chrome/app/google_update_client.cc +++ b/chrome/app/google_update_client.cc @@ -9,6 +9,7 @@ #include "chrome/app/client_util.h" #include "chrome/installer/util/google_update_constants.h" +#include "chrome/installer/util/install_util.h" namespace { const wchar_t kEnvProductVersionKey[] = L"CHROME_VERSION"; @@ -108,7 +109,7 @@ bool GoogleUpdateClient::Launch(HINSTANCE instance, bool GoogleUpdateClient::Init(const wchar_t* client_guid, const wchar_t* client_dll) { client_util::GetExecutablePath(dll_path_); - user_mode_ = client_util::IsUserModeInstall(dll_path_); + user_mode_ = InstallUtil::IsPerUserInstall(dll_path_); guid_.assign(client_guid); dll_.assign(client_dll); |