diff options
-rw-r--r-- | chrome/app/chromium_strings.grd | 7 | ||||
-rw-r--r-- | chrome/app/google_chrome_strings.grd | 7 | ||||
-rw-r--r-- | chrome/installer/setup/setup_main.cc | 43 | ||||
-rwxr-xr-x | chrome/installer/util/prebuild/create_string_rc.py | 1 |
4 files changed, 41 insertions, 17 deletions
diff --git a/chrome/app/chromium_strings.grd b/chrome/app/chromium_strings.grd index 42127a9..0ad1ad1 100644 --- a/chrome/app/chromium_strings.grd +++ b/chrome/app/chromium_strings.grd @@ -420,10 +420,13 @@ be available for now. --> An administrator has installed Chromium on this system, and it is available for all users. The system-level Chromium will replace your user-level installation now. </message> <message name="IDS_INSTALL_HIGHER_VERSION" desc="Error displayed when higher version already exists."> - This computer already has a more recent version of Chromium. If the software is not working, please uninstall Chromium and download it again. + This computer already has a more recent version of Chromium. If the software is not working, please uninstall Chromium and try again. </message> <message name="IDS_INSTALL_HIGHER_VERSION_CF" desc="Error displayed when higher version already exists."> - This computer already has a more recent version of Chromium Frame. If the software is not working, please uninstall Chromium Frame and download it again. + This computer already has a more recent version of Chromium Frame. If the software is not working, please uninstall Chromium Frame and try again. + </message> + <message name="IDS_INSTALL_HIGHER_VERSION_CB_CF" desc="Error displayed when higher version of Chromium and Chromium Frame already exists"> + This computer already has a more recent version of Chromium and Chromium Frame. If the software is not working, please uninstall both Chromium and Chromium Frame and try again. </message> <message name="IDS_INSTALL_SYSTEM_LEVEL_EXISTS" desc="Error displayed during user level install if system level Chromium is already installed."> Chromium is already installed and available to all users of this computer. If you want to install Chromium at the user level, you must first uninstall the system-level version installed by an administrator. diff --git a/chrome/app/google_chrome_strings.grd b/chrome/app/google_chrome_strings.grd index 271d509..e8ed900 100644 --- a/chrome/app/google_chrome_strings.grd +++ b/chrome/app/google_chrome_strings.grd @@ -398,10 +398,13 @@ Chrome supports. --> An administrator has installed Google Chrome on this system, and it is available for all users. The system-level Google Chrome will replace your user-level installation now. </message> <message name="IDS_INSTALL_HIGHER_VERSION" desc="Error displayed when higher version already exists."> - This computer already has a more recent version of Google Chrome. If the software is not working, please uninstall Google Chrome and download it again. + This computer already has a more recent version of Google Chrome. If the software is not working, please uninstall Google Chrome and try again. </message> <message name="IDS_INSTALL_HIGHER_VERSION_CF" desc="Error displayed when higher version of Chrome Frame already exists"> - This computer already has a more recent version of Google Chrome Frame. If the software is not working, please uninstall Google Chrome Frame and download it again. + This computer already has a more recent version of Google Chrome Frame. If the software is not working, please uninstall Google Chrome Frame and try again. + </message> + <message name="IDS_INSTALL_HIGHER_VERSION_CB_CF" desc="Error displayed when higher version of Chrome and Chrome Frame already exists"> + This computer already has a more recent version of Google Chrome and Google Chrome Frame. If the software is not working, please uninstall both Google Chrome and Google Chrome Frame and try again. </message> <message name="IDS_INSTALL_SYSTEM_LEVEL_EXISTS" desc="Error displayed during user level install if system level Chromium is already installed."> Google Chrome is already installed and available to all users of this computer. If you want to install Google Chrome at the user level, you must first uninstall the system-level version installed by an administrator. diff --git a/chrome/installer/setup/setup_main.cc b/chrome/installer/setup/setup_main.cc index b856d5d..4769337 100644 --- a/chrome/installer/setup/setup_main.cc +++ b/chrome/installer/setup/setup_main.cc @@ -597,6 +597,10 @@ installer::InstallStatus InstallProductsHelper( // (or rather must) be upgraded. VLOG(1) << "version to install: " << installer_version->GetString(); bool proceed_with_installation = true; + uint32 higher_products = 0; + COMPILE_ASSERT( + sizeof(higher_products) * 8 > BrowserDistribution::NUM_TYPES, + too_many_distribution_types_); for (size_t i = 0; i < installer_state.products().size(); ++i) { const Product* product = installer_state.products()[i]; const ProductState* product_state = @@ -604,22 +608,35 @@ installer::InstallStatus InstallProductsHelper( product->distribution()->GetType()); if (product_state != NULL && (product_state->version().CompareTo(*installer_version) > 0)) { - LOG(ERROR) << "Higher version is already installed."; - proceed_with_installation = false; - install_status = installer::HIGHER_VERSION_EXISTS; - - if (product->is_chrome()) { - // TODO(robertshield): We should take the installer result text - // strings from the Product. - installer_state.WriteInstallerResult(install_status, - IDS_INSTALL_HIGHER_VERSION_BASE, NULL); - } else { - installer_state.WriteInstallerResult(install_status, - IDS_INSTALL_HIGHER_VERSION_CF_BASE, NULL); - } + LOG(ERROR) << "Higher version of " + << product->distribution()->GetAppShortCutName() + << " is already installed."; + higher_products |= (1 << product->distribution()->GetType()); } } + if (higher_products != 0) { + COMPILE_ASSERT(BrowserDistribution::NUM_TYPES == 3, + add_support_for_new_products_here_); + const uint32 kBrowserBit = 1 << BrowserDistribution::CHROME_BROWSER; + const uint32 kGCFBit = 1 << BrowserDistribution::CHROME_FRAME; + int message_id = 0; + + proceed_with_installation = false; + install_status = installer::HIGHER_VERSION_EXISTS; + if ((higher_products & kBrowserBit) != 0) { + if ((higher_products & kGCFBit) != 0) + message_id = IDS_INSTALL_HIGHER_VERSION_CB_CF_BASE; + else + message_id = IDS_INSTALL_HIGHER_VERSION_BASE; + } else { + DCHECK(higher_products == kGCFBit); + message_id = IDS_INSTALL_HIGHER_VERSION_CF_BASE; + } + + installer_state.WriteInstallerResult(install_status, message_id, NULL); + } + proceed_with_installation = proceed_with_installation && CheckGroupPolicySettings(original_state, installer_state, diff --git a/chrome/installer/util/prebuild/create_string_rc.py b/chrome/installer/util/prebuild/create_string_rc.py index f7bb453..66ba3c5 100755 --- a/chrome/installer/util/prebuild/create_string_rc.py +++ b/chrome/installer/util/prebuild/create_string_rc.py @@ -50,6 +50,7 @@ kStringIds = [ 'IDS_ABOUT_VERSION_COMPANY_NAME', 'IDS_INSTALL_HIGHER_VERSION', 'IDS_INSTALL_HIGHER_VERSION_CF', + 'IDS_INSTALL_HIGHER_VERSION_CB_CF', 'IDS_INSTALL_SYSTEM_LEVEL_EXISTS', 'IDS_INSTALL_FAILED', 'IDS_SAME_VERSION_REPAIR_FAILED', |