Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3381)

Unified Diff: chrome/installer/setup/setup_main.cc

Issue 8570006: Allow updates to user-level products when system-level products are present. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/app/google_chrome_strings.grd ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/setup/setup_main.cc
diff --git a/chrome/installer/setup/setup_main.cc b/chrome/installer/setup/setup_main.cc
index fa7103f12aef23ce4a1b31e58204b71153f7c203..f70916b2dde73c19afe81a77ddb28ff73f2e170a 100644
--- a/chrome/installer/setup/setup_main.cc
+++ b/chrome/installer/setup/setup_main.cc
@@ -493,38 +493,41 @@ bool CheckPreInstallConditions(const InstallationState& original_state,
const ProductState* other_state =
original_state.GetProductState(!system_level, browser_dist->GetType());
if (other_state != NULL && !system_level) {
- LOG(ERROR) << "Already installed version "
- << other_state->version().GetString()
- << " conflicts with the current install mode.";
- if (is_first_install && product->is_chrome()) {
- // This is user-level install and there is a system-level chrome
- // installation. Instruct Google Update to launch the existing one.
- // There should be no error dialog.
- FilePath chrome_exe(installer::GetChromeInstallPath(!system_level,
- browser_dist));
- if (chrome_exe.empty()) {
- // If we failed to construct install path. Give up.
- *status = installer::OS_ERROR;
- installer_state->WriteInstallerResult(*status,
- IDS_INSTALL_OS_ERROR_BASE, NULL);
- } else {
- *status = installer::EXISTING_VERSION_LAUNCHED;
- chrome_exe = chrome_exe.Append(installer::kChromeExe);
- CommandLine cmd(chrome_exe);
- cmd.AppendSwitch(switches::kFirstRun);
- installer_state->WriteInstallerResult(*status, 0, NULL);
- VLOG(1) << "Launching existing system-level chrome instead.";
- base::LaunchProcess(cmd, base::LaunchOptions(), NULL);
+ if (is_first_install) {
+ // This is a user-level install and there is a system-level install of
+ // the product.
+ LOG(ERROR) << "Already installed version "
+ << other_state->version().GetString()
+ << " at system-level conflicts with this one at user-level.";
+ if (product->is_chrome()) {
+ // Instruct Google Update to launch the existing system-level Chrome.
+ // There should be no error dialog.
+ FilePath chrome_exe(installer::GetChromeInstallPath(!system_level,
+ browser_dist));
+ if (chrome_exe.empty()) {
+ // If we failed to construct install path. Give up.
+ *status = installer::OS_ERROR;
+ installer_state->WriteInstallerResult(*status,
+ IDS_INSTALL_OS_ERROR_BASE, NULL);
+ } else {
+ *status = installer::EXISTING_VERSION_LAUNCHED;
+ chrome_exe = chrome_exe.Append(installer::kChromeExe);
+ CommandLine cmd(chrome_exe);
+ cmd.AppendSwitch(switches::kFirstRun);
+ installer_state->WriteInstallerResult(*status, 0, NULL);
+ VLOG(1) << "Launching existing system-level chrome instead.";
+ base::LaunchProcess(cmd, base::LaunchOptions(), NULL);
+ }
+ return false;
}
+ // Display an error message for Chrome Frame.
robertshield 2011/11/15 18:58:27 Wrap lines 523 - 526 in an else block and deleting
+ *status = installer::SYSTEM_LEVEL_INSTALL_EXISTS;
+ installer_state->WriteInstallerResult(*status,
+ IDS_INSTALL_SYSTEM_LEVEL_EXISTS_BASE, NULL);
return false;
}
-
- // This is an update, not an install. Omaha should know the difference
- // and not show a dialog.
- *status = installer::SYSTEM_LEVEL_INSTALL_EXISTS;
- installer_state->WriteInstallerResult(*status,
- IDS_INSTALL_SYSTEM_LEVEL_EXISTS_BASE, NULL);
- return false;
+ // This is an update, not a new install. Allow it to take place so that
+ // out-of-date versions are not left around.
}
}
« no previous file with comments | « chrome/app/google_chrome_strings.grd ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698