diff options
author | robertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-31 15:57:46 +0000 |
---|---|---|
committer | robertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-31 15:57:46 +0000 |
commit | 729c242feefd19a011364d9e211a22bc8c6c35aa (patch) | |
tree | 3d0863488b38f08b03dfb40cf746a4130207332b /chrome/installer | |
parent | ccaba28b6da8d80f39cff8131090e279df808050 (diff) | |
download | chromium_src-729c242feefd19a011364d9e211a22bc8c6c35aa.zip chromium_src-729c242feefd19a011364d9e211a22bc8c6c35aa.tar.gz chromium_src-729c242feefd19a011364d9e211a22bc8c6c35aa.tar.bz2 |
Alter the installer policy check to allow System-level installations to be installed on top of user-level installations.
Remove a now-unused installer string.
BUG=73253
TEST=Install user-level Chrome at version X. Install system-level install at the same version. System level install succeeds.
Review URL: http://codereview.chromium.org/6726032
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80005 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer')
-rw-r--r-- | chrome/installer/setup/setup_main.cc | 29 | ||||
-rwxr-xr-x | chrome/installer/util/prebuild/create_string_rc.py | 1 | ||||
-rw-r--r-- | chrome/installer/util/util_constants.h | 7 |
3 files changed, 20 insertions, 17 deletions
diff --git a/chrome/installer/setup/setup_main.cc b/chrome/installer/setup/setup_main.cc index 65d8a3ee..87cf8a5 100644 --- a/chrome/installer/setup/setup_main.cc +++ b/chrome/installer/setup/setup_main.cc @@ -400,14 +400,15 @@ bool CheckPreInstallConditions(const InstallationState& original_state, } } - // Check to avoid simultaneous per-user and per-machine installs. + // Check to avoid attempting to lay down a user-level installation on top + // of a system-level one. const ProductState* other_state = original_state.GetProductState(!system_level, browser_dist->GetType()); - if (other_state != NULL) { + if (other_state != NULL && !system_level) { LOG(ERROR) << "Already installed version " << other_state->version().GetString() << " conflicts with the current install mode."; - if (!system_level && is_first_install && product->is_chrome()) { + 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. @@ -417,8 +418,10 @@ bool CheckPreInstallConditions(const InstallationState& original_state, // If we failed to construct install path. Give up. *status = installer::OS_ERROR; InstallUtil::WriteInstallerResult(system_level, - installer_state->state_key(), *status, IDS_INSTALL_OS_ERROR_BASE, - NULL); + installer_state->state_key(), + *status, + IDS_INSTALL_OS_ERROR_BASE, + NULL); } else { *status = installer::EXISTING_VERSION_LAUNCHED; chrome_exe = chrome_exe.Append(installer::kChromeExe); @@ -432,20 +435,14 @@ bool CheckPreInstallConditions(const InstallationState& original_state, return false; } - // If the following compile assert fires it means that the InstallStatus - // enumeration changed which will break the contract between the old - // chrome installed and the new setup.exe that is trying to upgrade. - COMPILE_ASSERT(installer::CONFLICTING_CHANNEL_EXISTS == 39, - dont_change_enum); - // This is an update, not an install. Omaha should know the difference // and not show a dialog. - *status = system_level ? installer::USER_LEVEL_INSTALL_EXISTS : - installer::SYSTEM_LEVEL_INSTALL_EXISTS; - int str_id = system_level ? IDS_INSTALL_USER_LEVEL_EXISTS_BASE : - IDS_INSTALL_SYSTEM_LEVEL_EXISTS_BASE; + *status = installer::SYSTEM_LEVEL_INSTALL_EXISTS; InstallUtil::WriteInstallerResult(system_level, - installer_state->state_key(), *status, str_id, NULL); + installer_state->state_key(), + *status, + IDS_INSTALL_SYSTEM_LEVEL_EXISTS_BASE, + NULL); return false; } } diff --git a/chrome/installer/util/prebuild/create_string_rc.py b/chrome/installer/util/prebuild/create_string_rc.py index 187e22d..00872bf 100755 --- a/chrome/installer/util/prebuild/create_string_rc.py +++ b/chrome/installer/util/prebuild/create_string_rc.py @@ -50,7 +50,6 @@ kStringIds = [ 'IDS_ABOUT_VERSION_COMPANY_NAME', 'IDS_INSTALL_HIGHER_VERSION', 'IDS_INSTALL_HIGHER_VERSION_CF', - 'IDS_INSTALL_USER_LEVEL_EXISTS', 'IDS_INSTALL_SYSTEM_LEVEL_EXISTS', 'IDS_INSTALL_FAILED', 'IDS_SAME_VERSION_REPAIR_FAILED', diff --git a/chrome/installer/util/util_constants.h b/chrome/installer/util/util_constants.h index 925110b..c8bcc3d 100644 --- a/chrome/installer/util/util_constants.h +++ b/chrome/installer/util/util_constants.h @@ -75,6 +75,13 @@ enum InstallStatus { // command line. }; + +// If the following compile assert fires it means that the InstallStatus +// enumeration changed which will break the contract between the old +// chrome installed and the new setup.exe that is trying to upgrade. +COMPILE_ASSERT(installer::CONFLICTING_CHANNEL_EXISTS == 39, + dont_change_enum); + // The type of an update archive. enum ArchiveType { UNKNOWN_ARCHIVE_TYPE, // Unknown or uninitialized. |