| 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 16 matching lines...) Expand all Loading... |
| 27 #include "base/strings/utf_string_conversions.h" | 27 #include "base/strings/utf_string_conversions.h" |
| 28 #include "base/sys_info.h" | 28 #include "base/sys_info.h" |
| 29 #include "base/values.h" | 29 #include "base/values.h" |
| 30 #include "base/version.h" | 30 #include "base/version.h" |
| 31 #include "base/win/registry.h" | 31 #include "base/win/registry.h" |
| 32 #include "base/win/windows_version.h" | 32 #include "base/win/windows_version.h" |
| 33 #include "chrome/common/chrome_constants.h" | 33 #include "chrome/common/chrome_constants.h" |
| 34 #include "chrome/common/chrome_paths.h" | 34 #include "chrome/common/chrome_paths.h" |
| 35 #include "chrome/installer/util/browser_distribution.h" | 35 #include "chrome/installer/util/browser_distribution.h" |
| 36 #include "chrome/installer/util/google_update_constants.h" | 36 #include "chrome/installer/util/google_update_constants.h" |
| 37 #include "chrome/installer/util/helper.h" | |
| 38 #include "chrome/installer/util/installation_state.h" | 37 #include "chrome/installer/util/installation_state.h" |
| 39 #include "chrome/installer/util/l10n_string_util.h" | 38 #include "chrome/installer/util/l10n_string_util.h" |
| 40 #include "chrome/installer/util/util_constants.h" | 39 #include "chrome/installer/util/util_constants.h" |
| 41 #include "chrome/installer/util/work_item_list.h" | 40 #include "chrome/installer/util/work_item_list.h" |
| 42 | 41 |
| 43 using base::win::RegKey; | 42 using base::win::RegKey; |
| 44 using installer::ProductState; | 43 using installer::ProductState; |
| 45 | 44 |
| 46 namespace { | 45 namespace { |
| 47 | 46 |
| (...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 | 559 |
| 561 // static | 560 // static |
| 562 void InstallUtil::AddUpdateDowngradeVersionItem( | 561 void InstallUtil::AddUpdateDowngradeVersionItem( |
| 563 bool system_install, | 562 bool system_install, |
| 564 const base::Version* current_version, | 563 const base::Version* current_version, |
| 565 const base::Version& new_version, | 564 const base::Version& new_version, |
| 566 const BrowserDistribution* dist, | 565 const BrowserDistribution* dist, |
| 567 WorkItemList* list) { | 566 WorkItemList* list) { |
| 568 DCHECK(list); | 567 DCHECK(list); |
| 569 DCHECK(dist); | 568 DCHECK(dist); |
| 570 DCHECK_EQ(BrowserDistribution::CHROME_BROWSER, dist->GetType()); | |
| 571 base::Version downgrade_version = GetDowngradeVersion(system_install, dist); | 569 base::Version downgrade_version = GetDowngradeVersion(system_install, dist); |
| 572 HKEY root = system_install ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; | 570 HKEY root = system_install ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; |
| 573 if (!current_version || | 571 if (!current_version || |
| 574 (*current_version <= new_version && | 572 (*current_version <= new_version && |
| 575 ((!downgrade_version.IsValid() || downgrade_version <= new_version)))) { | 573 ((!downgrade_version.IsValid() || downgrade_version <= new_version)))) { |
| 576 list->AddDeleteRegValueWorkItem(root, dist->GetStateKey(), KEY_WOW64_32KEY, | 574 list->AddDeleteRegValueWorkItem(root, dist->GetStateKey(), KEY_WOW64_32KEY, |
| 577 kRegDowngradeVersion); | 575 kRegDowngradeVersion); |
| 578 } else if (*current_version > new_version && !downgrade_version.IsValid()) { | 576 } else if (*current_version > new_version && !downgrade_version.IsValid()) { |
| 579 list->AddSetRegValueWorkItem( | 577 list->AddSetRegValueWorkItem( |
| 580 root, dist->GetStateKey(), KEY_WOW64_32KEY, kRegDowngradeVersion, | 578 root, dist->GetStateKey(), KEY_WOW64_32KEY, kRegDowngradeVersion, |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 629 // Open the program and see if it references the expected file. | 627 // Open the program and see if it references the expected file. |
| 630 base::File file; | 628 base::File file; |
| 631 BY_HANDLE_FILE_INFORMATION info = {}; | 629 BY_HANDLE_FILE_INFORMATION info = {}; |
| 632 | 630 |
| 633 return (OpenForInfo(path, &file) && | 631 return (OpenForInfo(path, &file) && |
| 634 GetInfo(file, &info) && | 632 GetInfo(file, &info) && |
| 635 info.dwVolumeSerialNumber == file_info_.dwVolumeSerialNumber && | 633 info.dwVolumeSerialNumber == file_info_.dwVolumeSerialNumber && |
| 636 info.nFileIndexHigh == file_info_.nFileIndexHigh && | 634 info.nFileIndexHigh == file_info_.nFileIndexHigh && |
| 637 info.nFileIndexLow == file_info_.nFileIndexLow); | 635 info.nFileIndexLow == file_info_.nFileIndexLow); |
| 638 } | 636 } |
| OLD | NEW |