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 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 370 FilePath::CompareEqualIgnoreCase(exe_dir.DirName().BaseName().value(), | 370 FilePath::CompareEqualIgnoreCase(exe_dir.DirName().BaseName().value(), |
| 371 chrome_sxs_dir); | 371 chrome_sxs_dir); |
| 372 } | 372 } |
| 373 | 373 |
| 374 bool InstallUtil::IsChromeSxSProcess() { | 374 bool InstallUtil::IsChromeSxSProcess() { |
| 375 static bool sxs = CheckIsChromeSxSProcess(); | 375 static bool sxs = CheckIsChromeSxSProcess(); |
| 376 return sxs; | 376 return sxs; |
| 377 } | 377 } |
| 378 | 378 |
| 379 bool InstallUtil::GetSentinelFilePath(const FilePath::CharType* file, | 379 bool InstallUtil::GetSentinelFilePath(const FilePath::CharType* file, |
| 380 bool system_install, | |
| 380 BrowserDistribution* dist, | 381 BrowserDistribution* dist, |
| 381 FilePath* path) { | 382 FilePath* path) { |
| 382 FilePath exe_path; | 383 if (!system_install) { |
| 383 if (!PathService::Get(base::DIR_EXE, &exe_path)) | 384 *path = installer::GetChromeInstallPath(false, dist); |
|
grt (UTC plus 2)
2013/01/02 17:59:33
This has a different subtle flaw than the old one
gab
2013/01/02 21:15:48
Ah! Good catch :)! Fixed both now I think!
| |
| 384 return false; | |
| 385 | |
| 386 if (IsPerUserInstall(exe_path.value().c_str())) { | |
| 387 *path = exe_path; | |
| 388 } else { | 385 } else { |
| 389 std::vector<FilePath> user_data_dir_paths; | 386 std::vector<FilePath> user_data_dir_paths; |
| 390 installer::GetChromeUserDataPaths(dist, &user_data_dir_paths); | 387 installer::GetChromeUserDataPaths(dist, &user_data_dir_paths); |
| 391 | 388 |
| 392 if (!user_data_dir_paths.empty()) | 389 if (!user_data_dir_paths.empty()) |
| 393 *path = user_data_dir_paths[0]; | 390 *path = user_data_dir_paths[0]; |
| 394 else | 391 else |
| 395 return false; | 392 return false; |
| 396 } | 393 } |
| 397 | 394 |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 581 // Open the program and see if it references the expected file. | 578 // Open the program and see if it references the expected file. |
| 582 base::win::ScopedHandle handle; | 579 base::win::ScopedHandle handle; |
| 583 BY_HANDLE_FILE_INFORMATION info = {}; | 580 BY_HANDLE_FILE_INFORMATION info = {}; |
| 584 | 581 |
| 585 return (OpenForInfo(program, &handle) && | 582 return (OpenForInfo(program, &handle) && |
| 586 GetInfo(handle, &info) && | 583 GetInfo(handle, &info) && |
| 587 info.dwVolumeSerialNumber == file_info_.dwVolumeSerialNumber && | 584 info.dwVolumeSerialNumber == file_info_.dwVolumeSerialNumber && |
| 588 info.nFileIndexHigh == file_info_.nFileIndexHigh && | 585 info.nFileIndexHigh == file_info_.nFileIndexHigh && |
| 589 info.nFileIndexLow == file_info_.nFileIndexLow); | 586 info.nFileIndexLow == file_info_.nFileIndexLow); |
| 590 } | 587 } |
| OLD | NEW |