summaryrefslogtreecommitdiffstats
path: root/chrome/installer
diff options
context:
space:
mode:
authorrobertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-01 19:09:41 +0000
committerrobertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-01 19:09:41 +0000
commit06e6f87a7d99758524cefbd9d234b0635c420dbc (patch)
treed72cc2e2e116a2f8f77252a5c9510953a7540800 /chrome/installer
parent58531df60b957442c986f947e6e1566fd9cf6084 (diff)
downloadchromium_src-06e6f87a7d99758524cefbd9d234b0635c420dbc.zip
chromium_src-06e6f87a7d99758524cefbd9d234b0635c420dbc.tar.gz
chromium_src-06e6f87a7d99758524cefbd9d234b0635c420dbc.tar.bz2
Parameterize the Google Update appid at build time instead of hard coding it in the source.
Review URL: http://codereview.chromium.org/178011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25072 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer')
-rw-r--r--chrome/installer/installer.gyp1
-rwxr-xr-xchrome/installer/mini_installer.gyp2
-rw-r--r--chrome/installer/mini_installer/mini_installer.cc18
-rw-r--r--chrome/installer/mini_installer/mini_installer.h7
-rw-r--r--chrome/installer/util/google_update_constants.cc3
5 files changed, 23 insertions, 8 deletions
diff --git a/chrome/installer/installer.gyp b/chrome/installer/installer.gyp
index c501a59..2f684fa 100644
--- a/chrome/installer/installer.gyp
+++ b/chrome/installer/installer.gyp
@@ -16,6 +16,7 @@
'type': '<(library)',
'msvs_guid': 'EFBB1436-A63F-4CD8-9E99-B89226E782EC',
'dependencies': [
+ '../../app/app.gyp:app_id',
'installer_util_strings',
'../chrome.gyp:common',
'../chrome.gyp:chrome_resources',
diff --git a/chrome/installer/mini_installer.gyp b/chrome/installer/mini_installer.gyp
index 950f6da..229c994 100755
--- a/chrome/installer/mini_installer.gyp
+++ b/chrome/installer/mini_installer.gyp
@@ -18,6 +18,7 @@
'type': 'executable',
'msvs_guid': '24A5AC7C-280B-4899-9153-6BA570A081E7',
'dependencies': [
+ '../../app/app.gyp:app_id',
'../chrome.gyp:chrome',
'../chrome.gyp:chrome_dll',
'../chrome.gyp:default_extensions',
@@ -28,6 +29,7 @@
'../..',
'<(PRODUCT_DIR)',
'<(INTERMEDIATE_DIR)',
+ '<(SHARED_INTERMEDIATE_DIR)/chrome',
],
'sources': [
'mini_installer/chrome.release',
diff --git a/chrome/installer/mini_installer/mini_installer.cc b/chrome/installer/mini_installer/mini_installer.cc
index 6567086..ff913f2 100644
--- a/chrome/installer/mini_installer/mini_installer.cc
+++ b/chrome/installer/mini_installer/mini_installer.cc
@@ -35,6 +35,9 @@
#include "chrome/installer/mini_installer/mini_installer.h"
#include "chrome/installer/mini_installer/pe_resource.h"
+// Generated header that includes the Google Update id.
+#include "appid.h"
+
// Required linker symbol. See remarks above.
extern "C" unsigned int __sse2_available = 0;
@@ -148,7 +151,14 @@ bool ReadValueFromRegistry(HKEY root_key, const wchar_t *sub_key,
// flag is cleared by setup.exe at the end of install.
void SetFullInstallerFlag(HKEY root_key) {
HKEY key;
- if (::RegOpenKeyEx(root_key, kApRegistryKey, NULL,
+ wchar_t ap_registry_key[128];
+ if (!SafeStrCopy(ap_registry_key, _countof(ap_registry_key),
+ kApRegistryKeyBase) ||
+ !SafeStrCat(ap_registry_key, _countof(ap_registry_key),
+ google_update::kChromeGuid)) {
+ return;
+ }
+ if (::RegOpenKeyEx(root_key, ap_registry_key, NULL,
KEY_READ | KEY_SET_VALUE, &key) != ERROR_SUCCESS)
return;
@@ -238,7 +248,7 @@ BOOL CALLBACK OnResourceFound(HMODULE module, const wchar_t* type,
PEResource resource(name, type, module);
if ((!resource.IsValid()) ||
- (resource.Size() < 1 ) ||
+ (resource.Size() < 1) ||
(resource.Size() > kMaxResourceSize)) {
return FALSE;
}
@@ -251,7 +261,7 @@ BOOL CALLBACK OnResourceFound(HMODULE module, const wchar_t* type,
if (StrStartsWith(name, kChromePrefix)) {
if (!SafeStrCopy(ctx->chrome_resource_path,
- ctx->chrome_resource_path_size, full_path))
+ ctx->chrome_resource_path_size, full_path))
return FALSE;
} else if (StrStartsWith(name, kSetupPrefix)) {
if (!SafeStrCopy(ctx->setup_resource_path,
@@ -401,7 +411,7 @@ void AppendCommandLineFlags(wchar_t* buffer, int size) {
// Current executable name not in the command line so just append
// the whole command line.
cmd_to_append = cmd_line;
- } else if (args_num > 1 ) {
+ } else if (args_num > 1) {
wchar_t* tmp = StrStr(cmd_line, exe_name);
tmp = StrStr(tmp, L" ");
cmd_to_append = tmp;
diff --git a/chrome/installer/mini_installer/mini_installer.h b/chrome/installer/mini_installer/mini_installer.h
index fde3656..9cce8d2 100644
--- a/chrome/installer/mini_installer/mini_installer.h
+++ b/chrome/installer/mini_installer/mini_installer.h
@@ -42,13 +42,14 @@ const wchar_t kUninstallRegistryValueName[] = L"UninstallString";
// Paths for the above registry keys
#if defined(GOOGLE_CHROME_BUILD)
-const wchar_t kApRegistryKey[] = L"Software\\Google\\Update\\ClientState\\"
- L"{8A69D345-D564-463c-AFF1-A69D9E530F96}";
+// The concatenation of this plus the Google Update GUID is the app registry
+// key.
+const wchar_t kApRegistryKeyBase[] = L"Software\\Google\\Update\\ClientState\\";
const wchar_t kUninstallRegistryKey[] =
L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Google Chrome";
const wchar_t kCleanupRegistryKey[] = L"Software\\Google";
#else
-const wchar_t kApRegistryKey[] = L"Software\\Chromium";
+const wchar_t kApRegistryKeyBase[] = L"Software\\Chromium";
const wchar_t kUninstallRegistryKey[] =
L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Chromium";
const wchar_t kCleanupRegistryKey[] = L"Software\\Chromium";
diff --git a/chrome/installer/util/google_update_constants.cc b/chrome/installer/util/google_update_constants.cc
index 170a17b..4586f07 100644
--- a/chrome/installer/util/google_update_constants.cc
+++ b/chrome/installer/util/google_update_constants.cc
@@ -4,9 +4,10 @@
#include "chrome/installer/util/google_update_constants.h"
+#include "appid.h"
+
namespace google_update {
-const wchar_t kChromeGuid[] = L"{8A69D345-D564-463c-AFF1-A69D9E530F96}";
const wchar_t kGearsUpgradeCode[] = L"{D92DBAED-3E3E-4530-B30D-072D16C7DDD0}";
const wchar_t kRegPathClients[] = L"Software\\Google\\Update\\Clients";