diff options
author | grt <grt@chromium.org> | 2015-02-16 13:32:19 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-02-16 21:32:57 +0000 |
commit | b9f50bea0c513a6c3c6983e94d021ca40ea790aa (patch) | |
tree | 541166547805b6e26c9de22848c41f5d1d65da63 /chrome/installer | |
parent | d09e1d96a90e5a46e28a5cbb233feda986fa10d3 (diff) | |
download | chromium_src-b9f50bea0c513a6c3c6983e94d021ca40ea790aa.zip chromium_src-b9f50bea0c513a6c3c6983e94d021ca40ea790aa.tar.gz chromium_src-b9f50bea0c513a6c3c6983e94d021ca40ea790aa.tar.bz2 |
Remove the inconsistent group policy check in the installer.
Leave it to Google Update to decide how to interpret Group Policy
settings.
Also update the style of the InstallStatus enum so that
the values are explicit, thereby removing the need for
compile asserts.
BUG=none
Review URL: https://codereview.chromium.org/906433003
Cr-Commit-Position: refs/heads/master@{#316507}
Diffstat (limited to 'chrome/installer')
-rw-r--r-- | chrome/installer/setup/setup_main.cc | 82 | ||||
-rwxr-xr-x | chrome/installer/util/prebuild/create_string_rc.py | 1 | ||||
-rw-r--r-- | chrome/installer/util/util_constants.h | 163 |
3 files changed, 75 insertions, 171 deletions
diff --git a/chrome/installer/setup/setup_main.cc b/chrome/installer/setup/setup_main.cc index 6be142b..ea96967 100644 --- a/chrome/installer/setup/setup_main.cc +++ b/chrome/installer/setup/setup_main.cc @@ -293,83 +293,6 @@ installer::InstallStatus RenameChromeExecutables( return ret; } -// For each product that is being updated (i.e., already installed at an earlier -// version), see if that product has an update policy override that differs from -// that for the binaries. If any are found, fail with an error indicating that -// the Group Policy settings are in an inconsistent state. Do not do this test -// for same-version installs, since it would be unkind to block attempts to -// repair a corrupt installation. This function returns false when installation -// should be halted, in which case |status| contains the relevant exit code and -// the proper installer result has been written to the registry. -bool CheckGroupPolicySettings(const InstallationState& original_state, - const InstallerState& installer_state, - const Version& new_version, - installer::InstallStatus* status) { -#if !defined(GOOGLE_CHROME_BUILD) - // Chromium builds are not updated via Google Update, so there are no - // Group Policy settings to consult. - return true; -#else - DCHECK(status); - - // Single installs are always in good shape. - if (!installer_state.is_multi_install()) - return true; - - bool settings_are_valid = true; - const bool is_system_install = installer_state.system_install(); - BrowserDistribution* const binaries_dist = - installer_state.multi_package_binaries_distribution(); - - // Get the update policy for the binaries. - const GoogleUpdateSettings::UpdatePolicy binaries_policy = - GoogleUpdateSettings::GetAppUpdatePolicy(binaries_dist->GetAppGuid(), - NULL); - - // Check for differing update policies for all of the products being updated. - const Products& products = installer_state.products(); - Products::const_iterator scan = products.begin(); - for (Products::const_iterator end = products.end(); scan != end; ++scan) { - BrowserDistribution* dist = (*scan)->distribution(); - const ProductState* product_state = - original_state.GetProductState(is_system_install, dist->GetType()); - // Is an earlier version of this product already installed? - if (product_state != NULL && - product_state->version().CompareTo(new_version) < 0) { - bool is_overridden = false; - GoogleUpdateSettings::UpdatePolicy app_policy = - GoogleUpdateSettings::GetAppUpdatePolicy(dist->GetAppGuid(), - &is_overridden); - if (is_overridden && app_policy != binaries_policy) { - LOG(ERROR) << "Found legacy Group Policy setting for " - << dist->GetDisplayName() << " (value: " << app_policy - << ") that does not match the setting for " - << binaries_dist->GetDisplayName() - << " (value: " << binaries_policy << ")."; - settings_are_valid = false; - } - } - } - - if (!settings_are_valid) { - // TODO(grt): add " See http://goo.gl/+++ for details." to the end of this - // log message and to the IDS_INSTALL_INCONSISTENT_UPDATE_POLICY string once - // we have a help center article that explains why this error is being - // reported and how to resolve it. - LOG(ERROR) << "Cannot apply update on account of inconsistent " - "Google Update Group Policy settings. Use the Group Policy " - "Editor to set the update policy override for the " - << binaries_dist->GetDisplayName() - << " application and try again."; - *status = installer::INCONSISTENT_UPDATE_POLICY; - installer_state.WriteInstallerResult( - *status, IDS_INSTALL_INCONSISTENT_UPDATE_POLICY_BASE, NULL); - } - - return settings_are_valid; -#endif // defined(GOOGLE_CHROME_BUILD) -} - // If only the binaries are being updated, fail. // If any product is being installed in single-mode that already exists in // multi-mode, fail. @@ -1542,11 +1465,6 @@ InstallStatus InstallProductsHelper(const InstallationState& original_state, installer_state.WriteInstallerResult(install_status, message_id, NULL); } - proceed_with_installation = - proceed_with_installation && - CheckGroupPolicySettings(original_state, installer_state, - *installer_version, &install_status); - if (proceed_with_installation) { base::FilePath prefs_source_path(cmd_line.GetSwitchValueNative( switches::kInstallerData)); diff --git a/chrome/installer/util/prebuild/create_string_rc.py b/chrome/installer/util/prebuild/create_string_rc.py index 8c4bf22..fe9b6fe 100755 --- a/chrome/installer/util/prebuild/create_string_rc.py +++ b/chrome/installer/util/prebuild/create_string_rc.py @@ -64,7 +64,6 @@ STRING_IDS = [ 'IDS_INSTALL_INSUFFICIENT_RIGHTS', 'IDS_INSTALL_NO_PRODUCTS_TO_UPDATE', 'IDS_INSTALL_MULTI_INSTALLATION_EXISTS', - 'IDS_INSTALL_INCONSISTENT_UPDATE_POLICY', 'IDS_OEM_MAIN_SHORTCUT_NAME', 'IDS_SHORTCUT_TOOLTIP', 'IDS_SHORTCUT_NEW_WINDOW', diff --git a/chrome/installer/util/util_constants.h b/chrome/installer/util/util_constants.h index d4dc6862..5776ae7 100644 --- a/chrome/installer/util/util_constants.h +++ b/chrome/installer/util/util_constants.h @@ -12,97 +12,84 @@ namespace installer { -// Return status of installer +// Return status of installer. Values in this enum must not change. Always add +// to the end. When removing an unused value, retain the deprecated name and +// value in a comment for posterity's sake, but take the liberty of removing the +// old doc string. enum InstallStatus { - FIRST_INSTALL_SUCCESS, // 0. Successfully installed Chrome for the first time - INSTALL_REPAIRED, // 1. Same version reinstalled for repair - NEW_VERSION_UPDATED, // 2. Chrome successfully updated to new version - EXISTING_VERSION_LAUNCHED, // 3. No work done, just launched existing chrome - HIGHER_VERSION_EXISTS, // 4. Higher version of Chrome already exists - USER_LEVEL_INSTALL_EXISTS, // 5. User level install already exists - SYSTEM_LEVEL_INSTALL_EXISTS, // 6. Machine level install already exists - INSTALL_FAILED, // 7. Install/update failed - SETUP_PATCH_FAILED, // 8. Failed to patch setup.exe - OS_NOT_SUPPORTED, // 9. Current OS not supported - OS_ERROR, // 10. OS API call failed - TEMP_DIR_FAILED, // 11. Unable to get Temp directory - UNCOMPRESSION_FAILED, // 12. Failed to uncompress Chrome archive - INVALID_ARCHIVE, // 13. Something wrong with the installer archive - INSUFFICIENT_RIGHTS, // 14. User trying system level install is not Admin - CHROME_NOT_INSTALLED, // 15. Chrome not installed (returned in case of - // uninstall) - CHROME_RUNNING, // 16. Chrome currently running (when trying to - // uninstall) - UNINSTALL_CONFIRMED, // 17. User has confirmed Chrome uninstall - UNINSTALL_DELETE_PROFILE, // 18. User okayed uninstall and profile deletion. - UNINSTALL_SUCCESSFUL, // 19. Chrome successfully uninstalled - UNINSTALL_FAILED, // 20. Chrome uninstallation failed - UNINSTALL_CANCELLED, // 21. User cancelled Chrome uninstallation - UNKNOWN_STATUS, // 22. Unknown status (this should never happen) - RENAME_SUCCESSFUL, // 23. Rename of new_chrome.exe to chrome.exe worked - RENAME_FAILED, // 24. Rename of new_chrome.exe failed - EULA_REJECTED, // 25. EULA dialog was not accepted by user. - EULA_ACCEPTED, // 26. EULA dialog was accepted by user. - EULA_ACCEPTED_OPT_IN, // 27. EULA accepted with the crash option selected. - INSTALL_DIR_IN_USE, // 28. Installation directory is in use by another - // process - UNINSTALL_REQUIRES_REBOOT, // 29. Uninstallation required a reboot. - IN_USE_UPDATED, // 30. Chrome successfully updated but old version - // running - SAME_VERSION_REPAIR_FAILED, // 31. Chrome repair failed as Chrome was running - REENTRY_SYS_UPDATE, // 32. Setup has been re-launched as the interactive - // user - SXS_OPTION_NOT_SUPPORTED, // 33. The chrome-sxs option provided does not work - // with other command line options. - NON_MULTI_INSTALLATION_EXISTS, // 34. We tried to do a multi-install but - // failed because there's an existing - // installation of the same product on the - // system, but in 'single' mode. - MULTI_INSTALLATION_EXISTS, // 35. We tried to do a 'single' install but - // failed because there's an existing - // multi-install installation of the same product - // on the system. - READY_MODE_OPT_IN_FAILED, // 36. Failed to opt-into Chrome Frame. - READY_MODE_TEMP_OPT_OUT_FAILED, // 37. Failed to temporarily opt-out of - // Chrome Frame. - READY_MODE_END_TEMP_OPT_OUT_FAILED, // 38. Failed to end temporary opt-out - // of Chrome Frame. - CONFLICTING_CHANNEL_EXISTS, // 39. A multi-install product on a different - // update channel exists. - READY_MODE_REQUIRES_CHROME, // 40. Chrome Frame in ready-mode requires Chrome - APP_HOST_REQUIRES_MULTI_INSTALL, // 41. --multi-install was missing from the - // command line. - APPLY_DIFF_PATCH_FAILED, // 42. Failed to apply a diff patch. - INCONSISTENT_UPDATE_POLICY, // 43. Inconsistent update policy GP settings. - APP_HOST_REQUIRES_USER_LEVEL, // 44. --system-level is forbidden. - APP_HOST_REQUIRES_BINARIES, // 45. No Chrome binaries at either level. - INSTALL_OF_GOOGLE_UPDATE_FAILED, // 46. Failed to install Google Update. - INVALID_STATE_FOR_OPTION, // 47. A non-install option was called with an - // invalid installer state. - WAIT_FOR_EXISTING_FAILED, // 48. OS error waiting for existing setup.exe. - PATCH_INVALID_ARGUMENTS, // 49. The arguments of --patch were missing or - // they were invalid for any reason. - DIFF_PATCH_SOURCE_MISSING, // 50. No previous version archive found for - // differential update. - UNUSED_BINARIES, // 51. No multi-install products to update. The - // binaries will be uninstalled if they are not - // in use. - UNUSED_BINARIES_UNINSTALLED, // 52. The binaries were uninstalled. - UNSUPPORTED_OPTION, // 53. An unsupported legacy option was given. - CPU_NOT_SUPPORTED, // 54. Current OS not supported - REENABLE_UPDATES_SUCCEEDED, // 55. Autoupdates are now enabled. - REENABLE_UPDATES_FAILED, // 56. Autoupdates could not be enabled. - UNPACKING_FAILED, // 57. Unpacking the (possibly patched) - // uncompressed archive failed. - - // Friendly reminder: note the COMPILE_ASSERT below. + FIRST_INSTALL_SUCCESS = 0, // First install of Chrome succeeded. + INSTALL_REPAIRED = 1, // Same version reinstalled for repair. + NEW_VERSION_UPDATED = 2, // Chrome successfully updated to new version. + EXISTING_VERSION_LAUNCHED = 3, // No work done; launched existing Chrome. + HIGHER_VERSION_EXISTS = 4, // Higher version of Chrome already exists + USER_LEVEL_INSTALL_EXISTS = 5, // User level install already exists. + SYSTEM_LEVEL_INSTALL_EXISTS = 6, // Machine level install already exists. + INSTALL_FAILED = 7, // Install/update failed. + SETUP_PATCH_FAILED = 8, // Failed to patch setup.exe. + OS_NOT_SUPPORTED = 9, // Current OS not supported. + OS_ERROR = 10, // OS API call failed. + TEMP_DIR_FAILED = 11, // Unable to get Temp directory. + UNCOMPRESSION_FAILED = 12, // Failed to uncompress Chrome archive. + INVALID_ARCHIVE = 13, // Something wrong with the installer archive. + INSUFFICIENT_RIGHTS = 14, // User trying system level install is not Admin. + CHROME_NOT_INSTALLED = 15, // Chrome not installed (returned in case of + // uninstall). + CHROME_RUNNING = 16, // Chrome currently running (when trying to + // uninstall). + UNINSTALL_CONFIRMED = 17, // User has confirmed Chrome uninstall. + UNINSTALL_DELETE_PROFILE = 18, // User okayed uninstall and profile deletion. + UNINSTALL_SUCCESSFUL = 19, // Chrome successfully uninstalled. + UNINSTALL_FAILED = 20, // Chrome uninstallation failed. + UNINSTALL_CANCELLED = 21, // User cancelled Chrome uninstallation. + UNKNOWN_STATUS = 22, // Unknown status (this should never happen). + RENAME_SUCCESSFUL = 23, // Rename of new_chrome.exe to chrome.exe worked. + RENAME_FAILED = 24, // Rename of new_chrome.exe failed. + EULA_REJECTED = 25, // EULA dialog was not accepted by user. + EULA_ACCEPTED = 26, // EULA dialog was accepted by user. + EULA_ACCEPTED_OPT_IN = 27, // EULA accepted with the crash option selected. + INSTALL_DIR_IN_USE = 28, // Installation directory is in use by another + // process + UNINSTALL_REQUIRES_REBOOT = 29, // Uninstallation required a reboot. + IN_USE_UPDATED = 30, // Chrome successfully updated but old version + // running. + SAME_VERSION_REPAIR_FAILED = 31, // Chrome repair failed as Chrome was + // running. + REENTRY_SYS_UPDATE = 32, // Setup has been re-launched as the interactive + // user. + SXS_OPTION_NOT_SUPPORTED = 33, // The chrome-sxs option provided does not + // work with other command line options. + // NON_MULTI_INSTALLATION_EXISTS = 34, + // MULTI_INSTALLATION_EXISTS = 35, + // READY_MODE_OPT_IN_FAILED = 36, + // READY_MODE_TEMP_OPT_OUT_FAILED = 37, + // READY_MODE_END_TEMP_OPT_OUT_FAILED = 38, + // CONFLICTING_CHANNEL_EXISTS = 39, + // READY_MODE_REQUIRES_CHROME = 40, + // APP_HOST_REQUIRES_MULTI_INSTALL = 41, + APPLY_DIFF_PATCH_FAILED = 42, // Failed to apply a diff patch. + // INCONSISTENT_UPDATE_POLICY = 43, + // APP_HOST_REQUIRES_USER_LEVEL = 44, + // APP_HOST_REQUIRES_BINARIES = 45, + // INSTALL_OF_GOOGLE_UPDATE_FAILED = 46, + INVALID_STATE_FOR_OPTION = 47, // A non-install option was called with an + // invalid installer state. + WAIT_FOR_EXISTING_FAILED = 48, // OS error waiting for existing setup.exe. + PATCH_INVALID_ARGUMENTS = 49, // The arguments of --patch were missing or + // they were invalid for any reason. + DIFF_PATCH_SOURCE_MISSING = 50, // No previous version archive found for + // differential update. + UNUSED_BINARIES = 51, // No multi-install products to update. The + // binaries will be uninstalled if they are not + // in use. + UNUSED_BINARIES_UNINSTALLED = 52, // The binaries were uninstalled. + UNSUPPORTED_OPTION = 53, // An unsupported legacy option was given. + CPU_NOT_SUPPORTED = 54, // Current OS not supported + REENABLE_UPDATES_SUCCEEDED = 55, // Autoupdates are now enabled. + REENABLE_UPDATES_FAILED = 56, // Autoupdates could not be enabled. + UNPACKING_FAILED = 57, // Unpacking the (possibly patched) uncompressed + // archive failed. }; - -// Existing InstallStatus values must not change. Always add to the end. -COMPILE_ASSERT(installer::UNPACKING_FAILED == 57, - dont_change_enum); - // The type of an update archive. enum ArchiveType { UNKNOWN_ARCHIVE_TYPE, // Unknown or uninitialized. |