| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 23 matching lines...) Expand all Loading... |
| 34 #include "chrome/installer/setup/uninstall.h" | 34 #include "chrome/installer/setup/uninstall.h" |
| 35 #include "chrome/installer/util/browser_distribution.h" | 35 #include "chrome/installer/util/browser_distribution.h" |
| 36 #include "chrome/installer/util/channel_info.h" | 36 #include "chrome/installer/util/channel_info.h" |
| 37 #include "chrome/installer/util/delete_after_reboot_helper.h" | 37 #include "chrome/installer/util/delete_after_reboot_helper.h" |
| 38 #include "chrome/installer/util/delete_tree_work_item.h" | 38 #include "chrome/installer/util/delete_tree_work_item.h" |
| 39 #include "chrome/installer/util/google_update_settings.h" | 39 #include "chrome/installer/util/google_update_settings.h" |
| 40 #include "chrome/installer/util/google_update_constants.h" | 40 #include "chrome/installer/util/google_update_constants.h" |
| 41 #include "chrome/installer/util/helper.h" | 41 #include "chrome/installer/util/helper.h" |
| 42 #include "chrome/installer/util/html_dialog.h" | 42 #include "chrome/installer/util/html_dialog.h" |
| 43 #include "chrome/installer/util/install_util.h" | 43 #include "chrome/installer/util/install_util.h" |
| 44 #include "chrome/installer/util/installation_validator.h" |
| 44 #include "chrome/installer/util/installer_state.h" | 45 #include "chrome/installer/util/installer_state.h" |
| 45 #include "chrome/installer/util/installation_state.h" | 46 #include "chrome/installer/util/installation_state.h" |
| 46 #include "chrome/installer/util/l10n_string_util.h" | 47 #include "chrome/installer/util/l10n_string_util.h" |
| 47 #include "chrome/installer/util/logging_installer.h" | 48 #include "chrome/installer/util/logging_installer.h" |
| 48 #include "chrome/installer/util/lzma_util.h" | 49 #include "chrome/installer/util/lzma_util.h" |
| 49 #include "chrome/installer/util/master_preferences.h" | 50 #include "chrome/installer/util/master_preferences.h" |
| 50 #include "chrome/installer/util/master_preferences_constants.h" | 51 #include "chrome/installer/util/master_preferences_constants.h" |
| 51 #include "chrome/installer/util/shell_util.h" | 52 #include "chrome/installer/util/shell_util.h" |
| 52 #include "chrome/installer/util/util_constants.h" | 53 #include "chrome/installer/util/util_constants.h" |
| 53 | 54 |
| 54 #include "installer_util_strings.h" // NOLINT | 55 #include "installer_util_strings.h" // NOLINT |
| 55 | 56 |
| 56 using installer::InstallerState; | 57 using installer::InstallerState; |
| 57 using installer::InstallationState; | 58 using installer::InstallationState; |
| 59 using installer::InstallationValidator; |
| 58 using installer::Product; | 60 using installer::Product; |
| 59 using installer::ProductState; | 61 using installer::ProductState; |
| 60 using installer::Products; | 62 using installer::Products; |
| 61 using installer::MasterPreferences; | 63 using installer::MasterPreferences; |
| 62 | 64 |
| 63 const wchar_t kChromePipeName[] = L"\\\\.\\pipe\\ChromeCrashServices"; | 65 const wchar_t kChromePipeName[] = L"\\\\.\\pipe\\ChromeCrashServices"; |
| 64 const wchar_t kGoogleUpdatePipeName[] = L"\\\\.\\pipe\\GoogleCrashServices\\"; | 66 const wchar_t kGoogleUpdatePipeName[] = L"\\\\.\\pipe\\GoogleCrashServices\\"; |
| 65 const wchar_t kSystemPrincipalSid[] = L"S-1-5-18"; | 67 const wchar_t kSystemPrincipalSid[] = L"S-1-5-18"; |
| 66 | 68 |
| 67 const MINIDUMP_TYPE kLargerDumpType = static_cast<MINIDUMP_TYPE>( | 69 const MINIDUMP_TYPE kLargerDumpType = static_cast<MINIDUMP_TYPE>( |
| (...skipping 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1113 install_status = UninstallProduct(original_state, installer_state, | 1115 install_status = UninstallProduct(original_state, installer_state, |
| 1114 cmd_line, *products[i]); | 1116 cmd_line, *products[i]); |
| 1115 } | 1117 } |
| 1116 } else { | 1118 } else { |
| 1117 // If --uninstall option is not specified, we assume it is install case. | 1119 // If --uninstall option is not specified, we assume it is install case. |
| 1118 VLOG(1) << "Installing to " << installer_state.target_path().value(); | 1120 VLOG(1) << "Installing to " << installer_state.target_path().value(); |
| 1119 install_status = InstallProducts(original_state, cmd_line, prefs, | 1121 install_status = InstallProducts(original_state, cmd_line, prefs, |
| 1120 &installer_state); | 1122 &installer_state); |
| 1121 } | 1123 } |
| 1122 | 1124 |
| 1125 // Validate that the machine is now in a good state following the operation. |
| 1126 // TODO(grt): change this to log at DFATAL once we're convinced that the |
| 1127 // validator handles all cases properly. |
| 1128 InstallationValidator::InstallationType installation_type = |
| 1129 InstallationValidator::NO_PRODUCTS; |
| 1130 LOG_IF(ERROR, |
| 1131 !InstallationValidator::ValidateInstallationType(system_install, |
| 1132 &installation_type)); |
| 1133 |
| 1123 const Product* cf_install = | 1134 const Product* cf_install = |
| 1124 installer_state.FindProduct(BrowserDistribution::CHROME_FRAME); | 1135 installer_state.FindProduct(BrowserDistribution::CHROME_FRAME); |
| 1125 | 1136 |
| 1126 if (cf_install && | 1137 if (cf_install && |
| 1127 !cmd_line.HasSwitch(installer::switches::kForceUninstall)) { | 1138 !cmd_line.HasSwitch(installer::switches::kForceUninstall)) { |
| 1128 if (install_status == installer::UNINSTALL_REQUIRES_REBOOT) { | 1139 if (install_status == installer::UNINSTALL_REQUIRES_REBOOT) { |
| 1129 ShowRebootDialog(); | 1140 ShowRebootDialog(); |
| 1130 } else if (is_uninstall) { | 1141 } else if (is_uninstall) { |
| 1131 // Only show the message box if Chrome Frame was the only product being | 1142 // Only show the message box if Chrome Frame was the only product being |
| 1132 // uninstalled. | 1143 // uninstalled. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 1147 if (!(installer_state.is_msi() && is_uninstall)) | 1158 if (!(installer_state.is_msi() && is_uninstall)) |
| 1148 // Note that we allow the status installer::UNINSTALL_REQUIRES_REBOOT | 1159 // Note that we allow the status installer::UNINSTALL_REQUIRES_REBOOT |
| 1149 // to pass through, since this is only returned on uninstall which is | 1160 // to pass through, since this is only returned on uninstall which is |
| 1150 // never invoked directly by Google Update. | 1161 // never invoked directly by Google Update. |
| 1151 return_code = InstallUtil::GetInstallReturnCode(install_status); | 1162 return_code = InstallUtil::GetInstallReturnCode(install_status); |
| 1152 | 1163 |
| 1153 VLOG(1) << "Installation complete, returning: " << return_code; | 1164 VLOG(1) << "Installation complete, returning: " << return_code; |
| 1154 | 1165 |
| 1155 return return_code; | 1166 return return_code; |
| 1156 } | 1167 } |
| OLD | NEW |