Index: chrome/installer/util/install_util.cc |
diff --git a/chrome/installer/util/install_util.cc b/chrome/installer/util/install_util.cc |
index b5ff91cf3aaba8fb754753d613c26b1899e8fa45..2d821972516c305ebf3e3f2cffee927c647a7e55 100644 |
--- a/chrome/installer/util/install_util.cc |
+++ b/chrome/installer/util/install_util.cc |
@@ -13,6 +13,7 @@ |
#include <algorithm> |
+#include "base/base_paths_win.h" |
#include "base/command_line.h" |
#include "base/environment.h" |
#include "base/files/file_util.h" |
@@ -385,15 +386,17 @@ bool InstallUtil::IsPerUserInstall(const base::FilePath& exe_path) { |
program_files_path = |
base::FilePath(base::UTF8ToWide(env_program_files_path)); |
} else { |
- const int kProgramFilesKey = |
+ // We don't use PathService here so this can be used early in startup. |
+ // See http://crbug.com/564398. |
+ bool result = |
#if defined(_WIN64) |
- // TODO(wfh): Revise this when Chrome is/can be installed in the 64-bit |
- // program files directory. |
- base::DIR_PROGRAM_FILESX86; |
+ // TODO(wfh): Revise this when Chrome is/can be installed in the 64-bit |
+ // program files directory. |
+ GetProgramFilesX86(&program_files_path); |
#else |
- base::DIR_PROGRAM_FILES; |
+ GetProgramFiles(&program_files_path); |
#endif |
- if (!PathService::Get(kProgramFilesKey, &program_files_path)) { |
+ if (!result) { |
NOTREACHED(); |
return true; |
} |
@@ -428,8 +431,11 @@ bool CheckIsChromeSxSProcess() { |
return true; |
// Also return true if we are running from Chrome SxS installed path. |
- base::FilePath exe_dir; |
- PathService::Get(base::DIR_EXE, &exe_dir); |
+ // We don't use PathService here so that this can be used very early in |
+ // startup. See http://crbug.com/564398. |
+ base::FilePath exe_file; |
+ DCHECK(GetFileExe(&exe_file)); |
+ base::FilePath exe_dir = exe_file.DirName(); |
base::string16 chrome_sxs_dir(installer::kGoogleChromeInstallSubDir2); |
chrome_sxs_dir.append(installer::kSxSSuffix); |