Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1045)

Unified Diff: chrome/installer/mini_installer/mini_installer.cc

Issue 178011: Parameterize the Google Update appid at build time instead of hard coding it ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/installer/mini_installer/mini_installer.cc
===================================================================
--- chrome/installer/mini_installer/mini_installer.cc (revision 24686)
+++ chrome/installer/mini_installer/mini_installer.cc (working copy)
@@ -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 @@
// 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 @@
PEResource resource(name, type, module);
if ((!resource.IsValid()) ||
- (resource.Size() < 1 ) ||
+ (resource.Size() < 1) ||
(resource.Size() > kMaxResourceSize)) {
return FALSE;
}
@@ -251,7 +261,7 @@
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 @@
// 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;

Powered by Google App Engine
This is Rietveld 408576698