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 #include <windows.h> | 5 #include <windows.h> |
6 #include <msi.h> | 6 #include <msi.h> |
7 #include <shellapi.h> | 7 #include <shellapi.h> |
8 #include <shlobj.h> | 8 #include <shlobj.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 1562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1573 pipe_name += user_sid; | 1573 pipe_name += user_sid; |
1574 | 1574 |
1575 google_breakpad::ExceptionHandler* breakpad = | 1575 google_breakpad::ExceptionHandler* breakpad = |
1576 new google_breakpad::ExceptionHandler( | 1576 new google_breakpad::ExceptionHandler( |
1577 temp_directory.value(), NULL, NULL, NULL, | 1577 temp_directory.value(), NULL, NULL, NULL, |
1578 google_breakpad::ExceptionHandler::HANDLER_ALL, kLargerDumpType, | 1578 google_breakpad::ExceptionHandler::HANDLER_ALL, kLargerDumpType, |
1579 pipe_name.c_str(), GetCustomInfo(exe_path)); | 1579 pipe_name.c_str(), GetCustomInfo(exe_path)); |
1580 return breakpad; | 1580 return breakpad; |
1581 } | 1581 } |
1582 | 1582 |
1583 // We renamed "Google Chrome App Host" to "Google Chrome App Launcher", | |
1584 // and need to do the same in the Windows\CurrentVersion\Uninstall registry key. | |
1585 // The addition / removal of the new key is handled elsewhere. | |
1586 // It remains to remove the old key where appropriate. | |
1587 // TODO(huangs): Remove this in early March. | |
1588 void RemoveDeprecatedAppHostUninstallEntry( | |
1589 const InstallerState& installer_state) { | |
1590 const Product* app_host = | |
1591 installer_state.FindProduct(BrowserDistribution::CHROME_APP_HOST); | |
1592 if (app_host) { | |
1593 const string16 kDeprecatedUninstallRegPath(L"Software\\Microsoft\\Windows\\" | |
1594 L"CurrentVersion\\Uninstall\\Google Chrome App Host"); | |
1595 InstallUtil::DeleteRegistryKey(installer_state.root_key(), | |
1596 kDeprecatedUninstallRegPath); | |
1597 } | |
1598 } | |
1599 | |
1600 | |
1601 } // namespace | 1583 } // namespace |
1602 | 1584 |
1603 int WINAPI wWinMain(HINSTANCE instance, HINSTANCE prev_instance, | 1585 int WINAPI wWinMain(HINSTANCE instance, HINSTANCE prev_instance, |
1604 wchar_t* command_line, int show_command) { | 1586 wchar_t* command_line, int show_command) { |
1605 // The exit manager is in charge of calling the dtors of singletons. | 1587 // The exit manager is in charge of calling the dtors of singletons. |
1606 base::AtExitManager exit_manager; | 1588 base::AtExitManager exit_manager; |
1607 CommandLine::Init(0, NULL); | 1589 CommandLine::Init(0, NULL); |
1608 | 1590 |
1609 const MasterPreferences& prefs = MasterPreferences::ForCurrentProcess(); | 1591 const MasterPreferences& prefs = MasterPreferences::ForCurrentProcess(); |
1610 installer::InitInstallerLogging(prefs); | 1592 installer::InitInstallerLogging(prefs); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1694 // If --uninstall option is given, uninstall the identified product(s) | 1676 // If --uninstall option is given, uninstall the identified product(s) |
1695 if (is_uninstall) { | 1677 if (is_uninstall) { |
1696 install_status = | 1678 install_status = |
1697 UninstallProducts(original_state, installer_state, cmd_line); | 1679 UninstallProducts(original_state, installer_state, cmd_line); |
1698 } else { | 1680 } else { |
1699 // If --uninstall option is not specified, we assume it is install case. | 1681 // If --uninstall option is not specified, we assume it is install case. |
1700 install_status = | 1682 install_status = |
1701 InstallProducts(original_state, cmd_line, prefs, &installer_state); | 1683 InstallProducts(original_state, cmd_line, prefs, &installer_state); |
1702 } | 1684 } |
1703 | 1685 |
1704 // TODO(huangs): Remove this in early March. | |
1705 if (!InstallUtil::GetInstallReturnCode(install_status)) | |
1706 RemoveDeprecatedAppHostUninstallEntry(installer_state); | |
1707 | |
1708 | |
1709 // Validate that the machine is now in a good state following the operation. | 1686 // Validate that the machine is now in a good state following the operation. |
1710 // TODO(grt): change this to log at DFATAL once we're convinced that the | 1687 // TODO(grt): change this to log at DFATAL once we're convinced that the |
1711 // validator handles all cases properly. | 1688 // validator handles all cases properly. |
1712 InstallationValidator::InstallationType installation_type = | 1689 InstallationValidator::InstallationType installation_type = |
1713 InstallationValidator::NO_PRODUCTS; | 1690 InstallationValidator::NO_PRODUCTS; |
1714 LOG_IF(ERROR, | 1691 LOG_IF(ERROR, |
1715 !InstallationValidator::ValidateInstallationType(system_install, | 1692 !InstallationValidator::ValidateInstallationType(system_install, |
1716 &installation_type)); | 1693 &installation_type)); |
1717 | 1694 |
1718 const Product* cf_install = | 1695 const Product* cf_install = |
(...skipping 30 matching lines...) Expand all Loading... |
1749 if (!(installer_state.is_msi() && is_uninstall)) | 1726 if (!(installer_state.is_msi() && is_uninstall)) |
1750 // Note that we allow the status installer::UNINSTALL_REQUIRES_REBOOT | 1727 // Note that we allow the status installer::UNINSTALL_REQUIRES_REBOOT |
1751 // to pass through, since this is only returned on uninstall which is | 1728 // to pass through, since this is only returned on uninstall which is |
1752 // never invoked directly by Google Update. | 1729 // never invoked directly by Google Update. |
1753 return_code = InstallUtil::GetInstallReturnCode(install_status); | 1730 return_code = InstallUtil::GetInstallReturnCode(install_status); |
1754 | 1731 |
1755 VLOG(1) << "Installation complete, returning: " << return_code; | 1732 VLOG(1) << "Installation complete, returning: " << return_code; |
1756 | 1733 |
1757 return return_code; | 1734 return return_code; |
1758 } | 1735 } |
OLD | NEW |