| 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 // This file defines specific implementation of BrowserDistribution class for | 5 // This file defines specific implementation of BrowserDistribution class for |
| 6 // Google Chrome. | 6 // Google Chrome. |
| 7 | 7 |
| 8 #include "chrome/installer/util/google_chrome_distribution.h" | 8 #include "chrome/installer/util/google_chrome_distribution.h" |
| 9 | 9 |
| 10 #include <windows.h> | 10 #include <windows.h> |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 #include "chrome/installer/util/wmi.h" | 42 #include "chrome/installer/util/wmi.h" |
| 43 | 43 |
| 44 #include "installer_util_strings.h" // NOLINT | 44 #include "installer_util_strings.h" // NOLINT |
| 45 | 45 |
| 46 #pragma comment(lib, "wtsapi32.lib") | 46 #pragma comment(lib, "wtsapi32.lib") |
| 47 | 47 |
| 48 namespace { | 48 namespace { |
| 49 | 49 |
| 50 const wchar_t kChromeGuid[] = L"{8A69D345-D564-463c-AFF1-A69D9E530F96}"; | 50 const wchar_t kChromeGuid[] = L"{8A69D345-D564-463c-AFF1-A69D9E530F96}"; |
| 51 const wchar_t kBrowserAppId[] = L"Chrome"; | 51 const wchar_t kBrowserAppId[] = L"Chrome"; |
| 52 const wchar_t kCommandExecuteImplUuid[] = |
| 53 L"{5C65F4B0-3651-4514-B207-D10CB699B14B}"; |
| 54 const wchar_t kDelegateExecuteLibUuid[] = |
| 55 L"{4E805ED8-EBA0-4601-9681-12815A56EBFD}"; |
| 56 const wchar_t kDelegateExecuteLibVersion[] = L"1.0"; |
| 57 const wchar_t kICommandExecuteImplUuid[] = |
| 58 L"{0BA0D4E9-2259-4963-B9AE-A839F7CB7544}"; |
| 52 | 59 |
| 53 // The following strings are the possible outcomes of the toast experiment | 60 // The following strings are the possible outcomes of the toast experiment |
| 54 // as recorded in the |client| field. | 61 // as recorded in the |client| field. |
| 55 const wchar_t kToastExpControlGroup[] = L"01"; | 62 const wchar_t kToastExpControlGroup[] = L"01"; |
| 56 const wchar_t kToastExpCancelGroup[] = L"02"; | 63 const wchar_t kToastExpCancelGroup[] = L"02"; |
| 57 const wchar_t kToastExpUninstallGroup[] = L"04"; | 64 const wchar_t kToastExpUninstallGroup[] = L"04"; |
| 58 const wchar_t kToastExpTriesOkGroup[] = L"18"; | 65 const wchar_t kToastExpTriesOkGroup[] = L"18"; |
| 59 const wchar_t kToastExpTriesErrorGroup[] = L"28"; | 66 const wchar_t kToastExpTriesErrorGroup[] = L"28"; |
| 60 const wchar_t kToastActiveGroup[] = L"40"; | 67 const wchar_t kToastActiveGroup[] = L"40"; |
| 61 const wchar_t kToastUDDirFailure[] = L"40"; | 68 const wchar_t kToastUDDirFailure[] = L"40"; |
| (...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 L"Google Chrome"; | 526 L"Google Chrome"; |
| 520 } | 527 } |
| 521 | 528 |
| 522 std::wstring GoogleChromeDistribution::GetVersionKey() { | 529 std::wstring GoogleChromeDistribution::GetVersionKey() { |
| 523 std::wstring key(google_update::kRegPathClients); | 530 std::wstring key(google_update::kRegPathClients); |
| 524 key.append(L"\\"); | 531 key.append(L"\\"); |
| 525 key.append(product_guid()); | 532 key.append(product_guid()); |
| 526 return key; | 533 return key; |
| 527 } | 534 } |
| 528 | 535 |
| 536 bool GoogleChromeDistribution::GetDelegateExecuteHandlerData( |
| 537 string16* handler_class_uuid, |
| 538 string16* type_lib_uuid, |
| 539 string16* type_lib_version, |
| 540 string16* interface_uuid) { |
| 541 *handler_class_uuid = kCommandExecuteImplUuid; |
| 542 *type_lib_uuid = kDelegateExecuteLibUuid; |
| 543 *type_lib_version = kDelegateExecuteLibVersion; |
| 544 *interface_uuid = kICommandExecuteImplUuid; |
| 545 return true; |
| 546 } |
| 547 |
| 529 // This method checks if we need to change "ap" key in Google Update to try | 548 // This method checks if we need to change "ap" key in Google Update to try |
| 530 // full installer as fall back method in case incremental installer fails. | 549 // full installer as fall back method in case incremental installer fails. |
| 531 // - If incremental installer fails we append a magic string ("-full"), if | 550 // - If incremental installer fails we append a magic string ("-full"), if |
| 532 // it is not present already, so that Google Update server next time will send | 551 // it is not present already, so that Google Update server next time will send |
| 533 // full installer to update Chrome on the local machine | 552 // full installer to update Chrome on the local machine |
| 534 // - If we are currently running full installer, we remove this magic | 553 // - If we are currently running full installer, we remove this magic |
| 535 // string (if it is present) regardless of whether installer failed or not. | 554 // string (if it is present) regardless of whether installer failed or not. |
| 536 // There is no fall-back for full installer :) | 555 // There is no fall-back for full installer :) |
| 537 void GoogleChromeDistribution::UpdateInstallStatus(bool system_install, | 556 void GoogleChromeDistribution::UpdateInstallStatus(bool system_install, |
| 538 installer::ArchiveType archive_type, | 557 installer::ArchiveType archive_type, |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 819 // we waited for chrome to exit so the uninstall would not detect chrome | 838 // we waited for chrome to exit so the uninstall would not detect chrome |
| 820 // running. | 839 // running. |
| 821 bool system_level_toast = CommandLine::ForCurrentProcess()->HasSwitch( | 840 bool system_level_toast = CommandLine::ForCurrentProcess()->HasSwitch( |
| 822 installer::switches::kSystemLevelToast); | 841 installer::switches::kSystemLevelToast); |
| 823 | 842 |
| 824 CommandLine cmd(InstallUtil::GetChromeUninstallCmd(system_level_toast, | 843 CommandLine cmd(InstallUtil::GetChromeUninstallCmd(system_level_toast, |
| 825 GetType())); | 844 GetType())); |
| 826 base::LaunchProcess(cmd, base::LaunchOptions(), NULL); | 845 base::LaunchProcess(cmd, base::LaunchOptions(), NULL); |
| 827 } | 846 } |
| 828 #endif | 847 #endif |
| OLD | NEW |