diff options
author | kuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-07 01:27:57 +0000 |
---|---|---|
committer | kuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-07 01:27:57 +0000 |
commit | 2414e84fdc99feb8e3a674a1776cddf5d24529fd (patch) | |
tree | a7735239d78bdbc37dcaf5a6428b3076d8a5ff33 /chrome/app | |
parent | 0c294877146c3812e0a69a5a6ec0cf3e29803954 (diff) | |
download | chromium_src-2414e84fdc99feb8e3a674a1776cddf5d24529fd.zip chromium_src-2414e84fdc99feb8e3a674a1776cddf5d24529fd.tar.gz chromium_src-2414e84fdc99feb8e3a674a1776cddf5d24529fd.tar.bz2 |
Implement the new mechanism we are going to use for handling Chromium updates
while it is in use. This should work for per user as well as system level
installs (after some additional changes once Google Update changes are ready).
The following scenarios should work now:
- If Chromium is using two different profiles at the same time we do not switch
chrome executables until all of them are closed.
- The old version of Chromium can be run after a restart if the renaming of
executables fails.
- We will not use environment variable any more but we need to keep it until all
the users get this change on their machines.
- opv/rename registry keys and new_chrome.exe should always together. If one
exist all three should exist because they are created and deleted as one atomic
operation (as much as possible given laws of physics).
BUG=1463346
Review URL: http://codereview.chromium.org/9436
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4949 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/app')
-rw-r--r-- | chrome/app/client_util.cc | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/chrome/app/client_util.cc b/chrome/app/client_util.cc index a8841cd..9908cf6 100644 --- a/chrome/app/client_util.cc +++ b/chrome/app/client_util.cc @@ -5,9 +5,9 @@ #include "chrome/app/client_util.h" #include "chrome/installer/util/install_util.h" -namespace client_util { -const wchar_t kProductVersionKey[] = L"pv"; +#include "chrome/installer/util/google_update_constants.h" +namespace client_util { bool FileExists(const wchar_t* const file_path) { WIN32_FILE_ATTRIBUTE_DATA attrs; return ::GetFileAttributesEx(file_path, GetFileExInfoStandard, &attrs) != 0; @@ -25,10 +25,24 @@ bool GetChromiumVersion(const wchar_t* const exe_path, } DWORD size = 0; bool ret = false; - if (::RegQueryValueEx(reg_key, client_util::kProductVersionKey, NULL, NULL, + if (::RegQueryValueEx(reg_key, google_update::kRegOldVersionField, NULL, NULL, + NULL, &size) == ERROR_SUCCESS) { + *version = new wchar_t[1 + (size / sizeof(wchar_t))]; + if (::RegQueryValueEx(reg_key, google_update::kRegOldVersionField, + NULL, NULL, reinterpret_cast<BYTE*>(*version), + &size) == ERROR_SUCCESS) { + ret = true; + } else { + delete[] *version; + } + ::RegCloseKey(reg_key); + return ret; + } + + if (::RegQueryValueEx(reg_key, google_update::kRegVersionField, NULL, NULL, NULL, &size) == ERROR_SUCCESS) { *version = new wchar_t[1 + (size / sizeof(wchar_t))]; - if (::RegQueryValueEx(reg_key, client_util::kProductVersionKey, + if (::RegQueryValueEx(reg_key, google_update::kRegVersionField, NULL, NULL, reinterpret_cast<BYTE*>(*version), &size) == ERROR_SUCCESS) { ret = true; |