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 "base/at_exit.h" | 10 #include "base/at_exit.h" |
(...skipping 1152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1163 } | 1163 } |
1164 installer::InstallStatus tmp = installer::UNKNOWN_STATUS; | 1164 installer::InstallStatus tmp = installer::UNKNOWN_STATUS; |
1165 const Product* chrome_install = | 1165 const Product* chrome_install = |
1166 installer_state->FindProduct(BrowserDistribution::CHROME_BROWSER); | 1166 installer_state->FindProduct(BrowserDistribution::CHROME_BROWSER); |
1167 DCHECK(chrome_install); | 1167 DCHECK(chrome_install); |
1168 if (chrome_install) { | 1168 if (chrome_install) { |
1169 installer::DeleteChromeRegistrationKeys(chrome_install->distribution(), | 1169 installer::DeleteChromeRegistrationKeys(chrome_install->distribution(), |
1170 HKEY_LOCAL_MACHINE, suffix, installer_state->target_path(), &tmp); | 1170 HKEY_LOCAL_MACHINE, suffix, installer_state->target_path(), &tmp); |
1171 } | 1171 } |
1172 *exit_code = tmp; | 1172 *exit_code = tmp; |
1173 } else if (cmd_line.HasSwitch(installer::switches::kOnOsUpgrade)) { | |
1174 handled = false; | |
grt (UTC plus 2)
2012/08/30 04:15:25
i think it's simpler to only set |handled| to fals
huangs
2012/08/30 17:13:07
Done.
| |
1175 if (cmd_line.HasSwitch(installer::switches::kChrome)) { | |
grt (UTC plus 2)
2012/08/30 04:15:25
--chrome won't be on the command-line in all cases
huangs
2012/08/30 17:13:07
Done.
| |
1176 if (installer::OnOsUpgrade(original_state, *installer_state, | |
grt (UTC plus 2)
2012/08/30 04:15:25
i think gab, you, and i need to discuss this in pe
grt (UTC plus 2)
2012/08/30 04:15:25
this needs to be:
*exit_code = !installer::OnOsU
gab
2012/08/30 14:24:32
How does this not apply to Chromium?
I agree it o
huangs
2012/08/30 17:13:07
Renamed to HandleOsUpgradeForBrowser(), per discus
huangs
2012/08/30 17:13:07
On failure, then exit_code == 1, which will be ret
| |
1177 cmd_line.GetProgram())) { | |
1178 *exit_code = 0; // Successful. | |
1179 } | |
1180 handled = true; | |
grt (UTC plus 2)
2012/08/30 04:15:25
and remove this
huangs
2012/08/30 17:13:07
Done.
| |
1181 } | |
grt (UTC plus 2)
2012/08/30 04:15:25
and change this to:
} else {
handled = false;
}
gab
2012/08/30 14:24:32
Hmmmm, |handled| should not be touched by the hand
grt (UTC plus 2)
2012/08/30 17:06:08
@gab's right. do what he says.
huangs
2012/08/30 17:13:07
Done.
huangs
2012/08/30 17:13:07
Ah. Replacing this with
*exit_code = installer::U
| |
1173 } else if (cmd_line.HasSwitch(installer::switches::kInactiveUserToast)) { | 1182 } else if (cmd_line.HasSwitch(installer::switches::kInactiveUserToast)) { |
1174 // Launch the inactive user toast experiment. | 1183 // Launch the inactive user toast experiment. |
1175 int flavor = -1; | 1184 int flavor = -1; |
1176 base::StringToInt(cmd_line.GetSwitchValueNative( | 1185 base::StringToInt(cmd_line.GetSwitchValueNative( |
1177 installer::switches::kInactiveUserToast), &flavor); | 1186 installer::switches::kInactiveUserToast), &flavor); |
1178 std::string experiment_group = | 1187 std::string experiment_group = |
1179 cmd_line.GetSwitchValueASCII(installer::switches::kExperimentGroup); | 1188 cmd_line.GetSwitchValueASCII(installer::switches::kExperimentGroup); |
1180 DCHECK_NE(-1, flavor); | 1189 DCHECK_NE(-1, flavor); |
1181 if (flavor == -1) { | 1190 if (flavor == -1) { |
1182 *exit_code = installer::UNKNOWN_STATUS; | 1191 *exit_code = installer::UNKNOWN_STATUS; |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1499 if (!(installer_state.is_msi() && is_uninstall)) | 1508 if (!(installer_state.is_msi() && is_uninstall)) |
1500 // Note that we allow the status installer::UNINSTALL_REQUIRES_REBOOT | 1509 // Note that we allow the status installer::UNINSTALL_REQUIRES_REBOOT |
1501 // to pass through, since this is only returned on uninstall which is | 1510 // to pass through, since this is only returned on uninstall which is |
1502 // never invoked directly by Google Update. | 1511 // never invoked directly by Google Update. |
1503 return_code = InstallUtil::GetInstallReturnCode(install_status); | 1512 return_code = InstallUtil::GetInstallReturnCode(install_status); |
1504 | 1513 |
1505 VLOG(1) << "Installation complete, returning: " << return_code; | 1514 VLOG(1) << "Installation complete, returning: " << return_code; |
1506 | 1515 |
1507 return return_code; | 1516 return return_code; |
1508 } | 1517 } |
OLD | NEW |