summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/app/client_util.cc4
-rw-r--r--chrome/common/env_vars.cc7
-rw-r--r--chrome/common/env_vars.h5
-rw-r--r--chrome/installer/util/master_preferences.cc3
-rw-r--r--chrome/installer/util/util_constants.cc5
-rw-r--r--chrome/installer/util/util_constants.h3
6 files changed, 18 insertions, 9 deletions
diff --git a/chrome/app/client_util.cc b/chrome/app/client_util.cc
index 905f9df..d78feb2 100644
--- a/chrome/app/client_util.cc
+++ b/chrome/app/client_util.cc
@@ -26,6 +26,7 @@
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_result_codes.h"
#include "chrome/common/chrome_switches.h"
+#include "chrome/common/env_vars.h"
#include "chrome/installer/util/browser_distribution.h"
#include "chrome/installer/util/channel_info.h"
#include "chrome/installer/util/install_util.h"
@@ -428,6 +429,9 @@ int MainDllLoader::Launch(HINSTANCE instance,
scoped_ptr<base::Environment> env(base::Environment::Create());
env->SetVar(chrome::kChromeVersionEnvVar, WideToUTF8(version));
+ // TODO(erikwright): Remove this when http://crbug.com/174953 is fixed and
+ // widely deployed.
+ env->UnSetVar(env_vars::kGoogleUpdateIsMachineEnvVar);
InitCrashReporter();
OnBeforeLaunch(file);
diff --git a/chrome/common/env_vars.cc b/chrome/common/env_vars.cc
index 06e10f8..063d15b 100644
--- a/chrome/common/env_vars.cc
+++ b/chrome/common/env_vars.cc
@@ -32,4 +32,11 @@ const char kLtrLocale[] = "LEFT_TO_RIGHT";
// Number of times to run a given startup_tests unit test.
const char kStartupTestsNumCycles[] = "STARTUP_TESTS_NUMCYCLES";
+// The presence of this environment variable with a value of 1 implies that
+// setup.exe should run as a system installation regardless of what is on the
+// command line.
+// TODO(erikwright): Put this in chrome/installer/util/util_constants.cc when
+// http://crbug.com/174953 is fixed and widely deployed.
+const char kGoogleUpdateIsMachineEnvVar[] = "GoogleUpdateIsMachine";
+
} // namespace env_vars
diff --git a/chrome/common/env_vars.h b/chrome/common/env_vars.h
index 0b3ba6f..34e1e17 100644
--- a/chrome/common/env_vars.h
+++ b/chrome/common/env_vars.h
@@ -18,6 +18,11 @@ extern const char kRtlLocale[];
extern const char kLtrLocale[];
extern const char kStartupTestsNumCycles[];
+// Google Update named environment variable that implies kSystemLevel.
+// TODO(erikwright): Put this in chrome/installer/util/util_constants.h when
+// http://crbug.com/174953 is fixed and widely deployed.
+extern const char kGoogleUpdateIsMachineEnvVar[];
+
} // namespace env_vars
#endif // CHROME_COMMON_ENV_VARS_H__
diff --git a/chrome/installer/util/master_preferences.cc b/chrome/installer/util/master_preferences.cc
index 598cc4d..a730f94 100644
--- a/chrome/installer/util/master_preferences.cc
+++ b/chrome/installer/util/master_preferences.cc
@@ -11,6 +11,7 @@
#include "base/logging.h"
#include "base/path_service.h"
#include "base/string_util.h"
+#include "chrome/common/env_vars.h"
#include "chrome/installer/util/master_preferences_constants.h"
#include "chrome/installer/util/util_constants.h"
#include "googleurl/src/gurl.h"
@@ -200,7 +201,7 @@ void MasterPreferences::InitializeFromCommandLine(const CommandLine& cmd_line) {
scoped_ptr<base::Environment> env(base::Environment::Create());
if (env != NULL) {
std::string is_machine_var;
- env->GetVar(kGoogleUpdateIsMachineEnvVar, &is_machine_var);
+ env->GetVar(env_vars::kGoogleUpdateIsMachineEnvVar, &is_machine_var);
if (!is_machine_var.empty() && is_machine_var[0] == '1') {
VLOG(1) << "Taking system-level from environment.";
name.assign(installer::master_preferences::kDistroDict);
diff --git a/chrome/installer/util/util_constants.cc b/chrome/installer/util/util_constants.cc
index b41fada..cd4e379 100644
--- a/chrome/installer/util/util_constants.cc
+++ b/chrome/installer/util/util_constants.cc
@@ -247,11 +247,6 @@ const wchar_t kInstallerResultUIString[] = L"InstallerResultUIString";
const wchar_t kInstallerSuccessLaunchCmdLine[] =
L"InstallerSuccessLaunchCmdLine";
-// The presence of this environment variable with a value of 1 implies that
-// we should run as a system installation regardless of what is on the
-// command line.
-const char kGoogleUpdateIsMachineEnvVar[] = "GoogleUpdateIsMachine";
-
const wchar_t kOptionAppHostIsLauncher[] = L"app-host-is-launcher";
const wchar_t kOptionMultiInstall[] = L"multi-install";
const wchar_t kOptionReadyMode[] = L"ready-mode";
diff --git a/chrome/installer/util/util_constants.h b/chrome/installer/util/util_constants.h
index 3892cc2a..3664bd0 100644
--- a/chrome/installer/util/util_constants.h
+++ b/chrome/installer/util/util_constants.h
@@ -220,9 +220,6 @@ extern const wchar_t kInstallerResult[];
extern const wchar_t kInstallerResultUIString[];
extern const wchar_t kInstallerSuccessLaunchCmdLine[];
-// Google Update named environment variable that implies kSystemLevel.
-extern const char kGoogleUpdateIsMachineEnvVar[];
-
// Product options.
extern const wchar_t kOptionMultiInstall[];
extern const wchar_t kOptionReadyMode[];