diff options
author | robertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-22 19:57:18 +0000 |
---|---|---|
committer | robertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-22 19:57:18 +0000 |
commit | 74f7446348778a347443f23b010dca20929a4ed0 (patch) | |
tree | 3c92c7b30e59750b5faea49495fca14d2a2e3881 /chrome | |
parent | c619407508e77a4ec06f5f7dc121c115e4b1469b (diff) | |
download | chromium_src-74f7446348778a347443f23b010dca20929a4ed0.zip chromium_src-74f7446348778a347443f23b010dca20929a4ed0.tar.gz chromium_src-74f7446348778a347443f23b010dca20929a4ed0.tar.bz2 |
Clear up the "-full" Omaha ap key value left by the mini_installer when running a Chrome Frame install.
BUG=http://crbug.com/24033
TEST=Post installation, there is no -full ap value in the Omaha key.
Review URL: http://codereview.chromium.org/306034
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29800 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/installer/util/chrome_frame_distribution.cc | 31 | ||||
-rw-r--r-- | chrome/installer/util/chrome_frame_distribution.h | 6 |
2 files changed, 37 insertions, 0 deletions
diff --git a/chrome/installer/util/chrome_frame_distribution.cc b/chrome/installer/util/chrome_frame_distribution.cc index 124edd3..7204a72 100644 --- a/chrome/installer/util/chrome_frame_distribution.cc +++ b/chrome/installer/util/chrome_frame_distribution.cc @@ -9,6 +9,12 @@ #include "chrome/installer/util/chrome_frame_distribution.h" +#include <string> +#include <windows.h> + +#include "base/logging.h" +#include "base/registry.h" +#include "base/string_util.h" #include "chrome/installer/util/l10n_string_util.h" #include "chrome/installer/util/google_update_constants.h" @@ -86,3 +92,28 @@ int ChromeFrameDistribution::GetInstallReturnCode( return status; } } + +void ChromeFrameDistribution::UpdateDiffInstallStatus(bool system_install, + bool incremental_install, installer_util::InstallStatus install_status) { + HKEY reg_root = (system_install) ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; + RegKey key; + std::wstring ap_key_value; + std::wstring reg_key(google_update::kRegPathClientState); + reg_key.append(L"\\"); + reg_key.append(google_update::kChromeGuid); + if (!key.Open(reg_root, reg_key.c_str(), KEY_ALL_ACCESS) || + !key.ReadValue(google_update::kRegApField, &ap_key_value)) { + LOG(INFO) << "Application key not found."; + } else { + const char kMagicSuffix[] = "-full"; + if (LowerCaseEqualsASCII(ap_key_value, kMagicSuffix)) { + key.DeleteValue(google_update::kRegApField); + } else { + size_t pos = ap_key_value.find(ASCIIToWide(kMagicSuffix)); + if (pos != std::wstring::npos) { + ap_key_value.erase(pos, strlen(kMagicSuffix)); + key.WriteValue(google_update::kRegApField, ap_key_value.c_str()); + } + } + } +} diff --git a/chrome/installer/util/chrome_frame_distribution.h b/chrome/installer/util/chrome_frame_distribution.h index 98a250d..ac6eaa8 100644 --- a/chrome/installer/util/chrome_frame_distribution.h +++ b/chrome/installer/util/chrome_frame_distribution.h @@ -39,6 +39,12 @@ class ChromeFrameDistribution : public BrowserDistribution { virtual int GetInstallReturnCode(installer_util::InstallStatus status); + // This is the point at which the Google Chrome installer removes the Google + // Update ap value. We implement this simply to have the same behaviour re. + // the ap value. + virtual void UpdateDiffInstallStatus(bool system_install, + bool incremental_install, installer_util::InstallStatus install_status); + private: friend class BrowserDistribution; |