Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 // | 4 // |
| 5 // See the corresponding header file for description of the functions in this | 5 // See the corresponding header file for description of the functions in this |
| 6 // file. | 6 // file. |
| 7 | 7 |
| 8 #include "chrome/installer/util/install_util.h" | 8 #include "chrome/installer/util/install_util.h" |
| 9 | 9 |
| 10 #include <shellapi.h> | 10 #include <shellapi.h> |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 21 #include "base/platform_file.h" | 21 #include "base/platform_file.h" |
| 22 #include "base/process/launch.h" | 22 #include "base/process/launch.h" |
| 23 #include "base/strings/string_util.h" | 23 #include "base/strings/string_util.h" |
| 24 #include "base/strings/utf_string_conversions.h" | 24 #include "base/strings/utf_string_conversions.h" |
| 25 #include "base/sys_info.h" | 25 #include "base/sys_info.h" |
| 26 #include "base/values.h" | 26 #include "base/values.h" |
| 27 #include "base/version.h" | 27 #include "base/version.h" |
| 28 #include "base/win/metro.h" | 28 #include "base/win/metro.h" |
| 29 #include "base/win/registry.h" | 29 #include "base/win/registry.h" |
| 30 #include "base/win/windows_version.h" | 30 #include "base/win/windows_version.h" |
| 31 #include "chrome/common/chrome_constants.h" | |
| 32 #include "chrome/common/chrome_paths.h" | |
| 31 #include "chrome/installer/util/browser_distribution.h" | 33 #include "chrome/installer/util/browser_distribution.h" |
| 32 #include "chrome/installer/util/google_update_constants.h" | 34 #include "chrome/installer/util/google_update_constants.h" |
| 33 #include "chrome/installer/util/helper.h" | 35 #include "chrome/installer/util/helper.h" |
| 34 #include "chrome/installer/util/installation_state.h" | 36 #include "chrome/installer/util/installation_state.h" |
| 35 #include "chrome/installer/util/l10n_string_util.h" | 37 #include "chrome/installer/util/l10n_string_util.h" |
| 36 #include "chrome/installer/util/util_constants.h" | 38 #include "chrome/installer/util/util_constants.h" |
| 37 #include "chrome/installer/util/work_item_list.h" | 39 #include "chrome/installer/util/work_item_list.h" |
| 38 | 40 |
| 39 using base::win::RegKey; | 41 using base::win::RegKey; |
| 40 using installer::ProductState; | 42 using installer::ProductState; |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 392 } | 394 } |
| 393 | 395 |
| 394 return false; | 396 return false; |
| 395 } | 397 } |
| 396 | 398 |
| 397 bool InstallUtil::IsChromeSxSProcess() { | 399 bool InstallUtil::IsChromeSxSProcess() { |
| 398 static bool sxs = CheckIsChromeSxSProcess(); | 400 static bool sxs = CheckIsChromeSxSProcess(); |
| 399 return sxs; | 401 return sxs; |
| 400 } | 402 } |
| 401 | 403 |
| 402 bool InstallUtil::GetSentinelFilePath( | 404 // static |
| 403 const base::FilePath::CharType* file, | 405 bool InstallUtil::IsFirstRunSentinelPresent() { |
| 404 BrowserDistribution* dist, | 406 base::FilePath user_data_dir; |
|
grt (UTC plus 2)
2014/03/27 15:35:20
please add something like:
// This duplicates po
msw
2014/03/28 00:04:11
Done (added a simple TODO).
| |
| 405 base::FilePath* path) { | 407 return !PathService::Get(chrome::DIR_USER_DATA, &user_data_dir) || |
| 408 base::PathExists(user_data_dir.Append(chrome::kFirstRunSentinel)); | |
| 409 } | |
| 410 | |
| 411 // static | |
| 412 bool InstallUtil::GetSentinelFilePath(const base::FilePath::CharType* file, | |
|
grt (UTC plus 2)
2014/03/27 15:35:20
this function is now only used to get the path for
msw
2014/03/28 00:04:11
Yup, I'll follow up this CL with similar changes f
| |
| 413 BrowserDistribution* dist, | |
| 414 base::FilePath* path) { | |
| 415 // TODO(msw): Use PathService to obtain the correct DIR_USER_DATA. | |
| 406 std::vector<base::FilePath> user_data_dir_paths; | 416 std::vector<base::FilePath> user_data_dir_paths; |
| 407 installer::GetChromeUserDataPaths(dist, &user_data_dir_paths); | 417 installer::GetChromeUserDataPaths(dist, &user_data_dir_paths); |
| 408 | 418 |
| 409 if (user_data_dir_paths.empty()) | 419 if (user_data_dir_paths.empty()) |
| 410 return false; | 420 return false; |
| 411 *path = user_data_dir_paths[0].Append(file); | 421 *path = user_data_dir_paths[0].Append(file); |
| 412 return true; | 422 return true; |
| 413 } | 423 } |
| 414 | 424 |
| 415 // This method tries to delete a registry key and logs an error message | 425 // This method tries to delete a registry key and logs an error message |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 599 // Open the program and see if it references the expected file. | 609 // Open the program and see if it references the expected file. |
| 600 base::File file; | 610 base::File file; |
| 601 BY_HANDLE_FILE_INFORMATION info = {}; | 611 BY_HANDLE_FILE_INFORMATION info = {}; |
| 602 | 612 |
| 603 return (OpenForInfo(path, &file) && | 613 return (OpenForInfo(path, &file) && |
| 604 GetInfo(file, &info) && | 614 GetInfo(file, &info) && |
| 605 info.dwVolumeSerialNumber == file_info_.dwVolumeSerialNumber && | 615 info.dwVolumeSerialNumber == file_info_.dwVolumeSerialNumber && |
| 606 info.nFileIndexHigh == file_info_.nFileIndexHigh && | 616 info.nFileIndexHigh == file_info_.nFileIndexHigh && |
| 607 info.nFileIndexLow == file_info_.nFileIndexLow); | 617 info.nFileIndexLow == file_info_.nFileIndexLow); |
| 608 } | 618 } |
| OLD | NEW |