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 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 | 378 |
379 bool InstallUtil::GetSentinelFilePath(const base::FilePath::CharType* file, | 379 bool InstallUtil::GetSentinelFilePath(const base::FilePath::CharType* file, |
380 BrowserDistribution* dist, | 380 BrowserDistribution* dist, |
381 base::FilePath* path) { | 381 base::FilePath* path) { |
382 base::FilePath exe_path; | 382 base::FilePath exe_path; |
383 if (!PathService::Get(base::DIR_EXE, &exe_path)) | 383 if (!PathService::Get(base::DIR_EXE, &exe_path)) |
384 return false; | 384 return false; |
385 | 385 |
386 if (IsPerUserInstall(exe_path.value().c_str())) { | 386 if (IsPerUserInstall(exe_path.value().c_str())) { |
387 const base::FilePath maybe_product_dir(exe_path.DirName().DirName()); | 387 const base::FilePath maybe_product_dir(exe_path.DirName().DirName()); |
388 if (file_util::PathExists(exe_path.Append(installer::kChromeExe))) { | 388 if (base::PathExists(exe_path.Append(installer::kChromeExe))) { |
389 // DIR_EXE is most likely Chrome's directory in which case |exe_path| is | 389 // DIR_EXE is most likely Chrome's directory in which case |exe_path| is |
390 // the user-level sentinel path. | 390 // the user-level sentinel path. |
391 *path = exe_path; | 391 *path = exe_path; |
392 } else if (file_util::PathExists( | 392 } else if (base::PathExists( |
393 maybe_product_dir.Append(installer::kChromeExe))) { | 393 maybe_product_dir.Append(installer::kChromeExe))) { |
394 // DIR_EXE can also be the Installer directory if this is called from a | 394 // DIR_EXE can also be the Installer directory if this is called from a |
395 // setup.exe running from Application\<version>\Installer (see | 395 // setup.exe running from Application\<version>\Installer (see |
396 // InstallerState::GetInstallerDirectory) in which case Chrome's directory | 396 // InstallerState::GetInstallerDirectory) in which case Chrome's directory |
397 // is two levels up. | 397 // is two levels up. |
398 *path = maybe_product_dir; | 398 *path = maybe_product_dir; |
399 } else { | 399 } else { |
400 NOTREACHED(); | 400 NOTREACHED(); |
401 return false; | 401 return false; |
402 } | 402 } |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
603 // Open the program and see if it references the expected file. | 603 // Open the program and see if it references the expected file. |
604 base::win::ScopedHandle handle; | 604 base::win::ScopedHandle handle; |
605 BY_HANDLE_FILE_INFORMATION info = {}; | 605 BY_HANDLE_FILE_INFORMATION info = {}; |
606 | 606 |
607 return (OpenForInfo(path, &handle) && | 607 return (OpenForInfo(path, &handle) && |
608 GetInfo(handle, &info) && | 608 GetInfo(handle, &info) && |
609 info.dwVolumeSerialNumber == file_info_.dwVolumeSerialNumber && | 609 info.dwVolumeSerialNumber == file_info_.dwVolumeSerialNumber && |
610 info.nFileIndexHigh == file_info_.nFileIndexHigh && | 610 info.nFileIndexHigh == file_info_.nFileIndexHigh && |
611 info.nFileIndexLow == file_info_.nFileIndexLow); | 611 info.nFileIndexLow == file_info_.nFileIndexLow); |
612 } | 612 } |
OLD | NEW |