| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "chrome/test/mini_installer_test/chrome_mini_installer.h" | 5 #include "chrome/test/mini_installer_test/chrome_mini_installer.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/platform_thread.h" | 9 #include "base/platform_thread.h" |
| 10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
| (...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 return L""; | 499 return L""; |
| 500 } | 500 } |
| 501 printf("uninstall path is %ls\n", path.c_str()); | 501 printf("uninstall path is %ls\n", path.c_str()); |
| 502 return path; | 502 return path; |
| 503 } | 503 } |
| 504 | 504 |
| 505 // Returns Chrome pv registry key value | 505 // Returns Chrome pv registry key value |
| 506 bool ChromeMiniInstaller::GetChromeVersionFromRegistry( | 506 bool ChromeMiniInstaller::GetChromeVersionFromRegistry( |
| 507 std::wstring* build_key_value) { | 507 std::wstring* build_key_value) { |
| 508 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); | 508 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); |
| 509 RegKey key(GetRootRegistryKey(), dist->GetVersionKey().c_str()); | 509 RegKey key(GetRootRegistryKey(), dist->GetVersionKey().c_str(), KEY_READ); |
| 510 if (!key.ReadValue(L"pv", build_key_value)) { | 510 if (!key.ReadValue(L"pv", build_key_value)) { |
| 511 printf("registry key not found\n"); | 511 printf("registry key not found\n"); |
| 512 return false; | 512 return false; |
| 513 } | 513 } |
| 514 printf("Build key value is %ls\n\n", build_key_value->c_str()); | 514 printf("Build key value is %ls\n\n", build_key_value->c_str()); |
| 515 return true; | 515 return true; |
| 516 } | 516 } |
| 517 | 517 |
| 518 // Get HKEY based on install type. | 518 // Get HKEY based on install type. |
| 519 HKEY ChromeMiniInstaller::GetRootRegistryKey() { | 519 HKEY ChromeMiniInstaller::GetRootRegistryKey() { |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 653 // This method will verify if the installed build is correct. | 653 // This method will verify if the installed build is correct. |
| 654 bool ChromeMiniInstaller::VerifyStandaloneInstall() { | 654 bool ChromeMiniInstaller::VerifyStandaloneInstall() { |
| 655 std::wstring reg_key_value_returned, standalone_installer_version; | 655 std::wstring reg_key_value_returned, standalone_installer_version; |
| 656 MiniInstallerTestUtil::GetStandaloneVersion(&standalone_installer_version); | 656 MiniInstallerTestUtil::GetStandaloneVersion(&standalone_installer_version); |
| 657 GetChromeVersionFromRegistry(®_key_value_returned); | 657 GetChromeVersionFromRegistry(®_key_value_returned); |
| 658 if (standalone_installer_version.compare(reg_key_value_returned) == 0) | 658 if (standalone_installer_version.compare(reg_key_value_returned) == 0) |
| 659 return true; | 659 return true; |
| 660 else | 660 else |
| 661 return false; | 661 return false; |
| 662 } | 662 } |
| OLD | NEW |