diff options
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); |