diff options
author | kuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-12 19:44:02 +0000 |
---|---|---|
committer | kuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-12 19:44:02 +0000 |
commit | 2754dcd0a4d0412360bc5bc1ac97c55617554836 (patch) | |
tree | 1252d2c4f8191bc2a113c22cdddf5b6fa7a0ca4d /chrome | |
parent | 68d7f638d934050e6fa3f6be753f1d2c437b1f4f (diff) | |
download | chromium_src-2754dcd0a4d0412360bc5bc1ac97c55617554836.zip chromium_src-2754dcd0a4d0412360bc5bc1ac97c55617554836.tar.gz chromium_src-2754dcd0a4d0412360bc5bc1ac97c55617554836.tar.bz2 |
* Need to read version from registry if relaunching browser.
BUG=4316
Review URL: http://codereview.chromium.org/10820
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5281 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rwxr-xr-x | chrome/app/google_update_client.cc | 7 | ||||
-rw-r--r-- | chrome/browser/first_run.cc | 1 | ||||
-rw-r--r-- | chrome/installer/util/google_update_constants.cc | 2 | ||||
-rw-r--r-- | chrome/installer/util/google_update_constants.h | 2 |
4 files changed, 8 insertions, 4 deletions
diff --git a/chrome/app/google_update_client.cc b/chrome/app/google_update_client.cc index 1c8c2df..65acec6 100755 --- a/chrome/app/google_update_client.cc +++ b/chrome/app/google_update_client.cc @@ -12,8 +12,6 @@ #include "chrome/installer/util/install_util.h" namespace { -const wchar_t kEnvProductVersionKey[] = L"CHROME_VERSION"; - // Allocates the out param on success. bool GoogleUpdateEnvQueryStr(const wchar_t* key_name, wchar_t** out) { DWORD count = ::GetEnvironmentVariableW(key_name, NULL, 0); @@ -57,7 +55,7 @@ bool GoogleUpdateClient::Launch(HINSTANCE instance, ::SetCurrentDirectory(dll_path_); // Setting the version on the environment block is a 'best effort' deal. // It enables Google Update running on a child to load the same DLL version. - ::SetEnvironmentVariableW(kEnvProductVersionKey, version_); + ::SetEnvironmentVariableW(google_update::kEnvProductVersionKey, version_); } // The dll can be in the exe's directory or in the current directory. @@ -113,7 +111,8 @@ bool GoogleUpdateClient::Init(const wchar_t* client_guid, dll_.assign(client_dll); bool ret = false; if (!guid_.empty()) { - if (GoogleUpdateEnvQueryStr(kEnvProductVersionKey, &version_)) { + if (GoogleUpdateEnvQueryStr(google_update::kEnvProductVersionKey, + &version_)) { ret = true; } else { std::wstring key(google_update::kRegPathClients); diff --git a/chrome/browser/first_run.cc b/chrome/browser/first_run.cc index b9c9884..de08f40 100644 --- a/chrome/browser/first_run.cc +++ b/chrome/browser/first_run.cc @@ -227,6 +227,7 @@ bool Upgrade::SwapNewChromeExeIfPresent() { } bool Upgrade::RelaunchChromeBrowser(const CommandLine& command_line) { + ::SetEnvironmentVariable(google_update::kEnvProductVersionKey, NULL); return process_util::LaunchApp(command_line.command_line_string(), false, false, NULL); } diff --git a/chrome/installer/util/google_update_constants.cc b/chrome/installer/util/google_update_constants.cc index a8ab8a8..4a1be5b 100644 --- a/chrome/installer/util/google_update_constants.cc +++ b/chrome/installer/util/google_update_constants.cc @@ -23,5 +23,7 @@ const wchar_t kRegRenameCmdField[] = L"rename"; const wchar_t kRegRLZBrandField[] = L"brand"; const wchar_t kRegUsageStatsField[] = L"usagestats"; const wchar_t kRegVersionField[] = L"pv"; + +const wchar_t kEnvProductVersionKey[] = L"CHROME_VERSION"; } // namespace installer diff --git a/chrome/installer/util/google_update_constants.h b/chrome/installer/util/google_update_constants.h index bf4f0f7..1277f01 100644 --- a/chrome/installer/util/google_update_constants.h +++ b/chrome/installer/util/google_update_constants.h @@ -28,6 +28,8 @@ extern const wchar_t kRegRenameCmdField[]; extern const wchar_t kRegRLZBrandField[]; extern const wchar_t kRegUsageStatsField[]; extern const wchar_t kRegVersionField[]; + +extern const wchar_t kEnvProductVersionKey[]; } // namespace google_update #endif // CHROME_INSTALLER_UTIL_GOOGLE_UPDATE_CONSTANTS_H_ |