summaryrefslogtreecommitdiffstats
path: root/chrome/installer/util/google_chrome_distribution.cc
diff options
context:
space:
mode:
authorkuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-09 23:07:24 +0000
committerkuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-09 23:07:24 +0000
commitd9b168764a9e7ad7dcd2561791041f660a54cdde (patch)
treef7815b644713f5486cf582eba7101d88198e1c7e /chrome/installer/util/google_chrome_distribution.cc
parent93bfaa60ad72df01797729ecb8cfd4a35b9d401d (diff)
downloadchromium_src-d9b168764a9e7ad7dcd2561791041f660a54cdde.zip
chromium_src-d9b168764a9e7ad7dcd2561791041f660a54cdde.tar.gz
chromium_src-d9b168764a9e7ad7dcd2561791041f660a54cdde.tar.bz2
Create "ap" key to fallback on full installer even if the key didnt exist (for Google Chrome only).
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1943 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer/util/google_chrome_distribution.cc')
-rw-r--r--chrome/installer/util/google_chrome_distribution.cc29
1 files changed, 19 insertions, 10 deletions
diff --git a/chrome/installer/util/google_chrome_distribution.cc b/chrome/installer/util/google_chrome_distribution.cc
index 443ba43..e9c7b01 100644
--- a/chrome/installer/util/google_chrome_distribution.cc
+++ b/chrome/installer/util/google_chrome_distribution.cc
@@ -177,16 +177,25 @@ void GoogleChromeDistribution::UpdateDiffInstallStatus(bool system_install,
RegKey key;
std::wstring ap_key_value;
- std::wstring chrome_google_update_state_key(
- google_update::kRegPathClientState);
- chrome_google_update_state_key.append(L"\\");
- chrome_google_update_state_key.append(google_update::kChromeGuid);
- if (!key.Open(reg_root, chrome_google_update_state_key.c_str(),
- KEY_ALL_ACCESS) || !key.ReadValue(google_update::kRegApFieldName,
- &ap_key_value)) {
- LOG(INFO) << "Application key not found. Returning without changing it.";
- key.Close();
- return;
+ 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::kRegApFieldName, &ap_key_value)) {
+ LOG(INFO) << "Application key not found.";
+ if (!incremental_install || !GetInstallReturnCode(install_status)) {
+ LOG(INFO) << "Returning without changing application key.";
+ key.Close();
+ return;
+ } else if (!key.Valid()) {
+ reg_key.assign(google_update::kRegPathClientState);
+ if (!key.Open(reg_root, reg_key.c_str(), KEY_ALL_ACCESS) ||
+ !key.CreateKey(google_update::kChromeGuid, KEY_ALL_ACCESS)) {
+ LOG(ERROR) << "Failed to create application key.";
+ key.Close();
+ return;
+ }
+ }
}
std::wstring new_value = GoogleChromeDistribution::GetNewGoogleUpdateApKey(