diff options
-rw-r--r-- | base/win_util.cc | 18 | ||||
-rw-r--r-- | base/win_util.h | 3 | ||||
-rw-r--r-- | chrome/browser/views/about_chrome_view.cc | 11 |
3 files changed, 29 insertions, 3 deletions
diff --git a/base/win_util.cc b/base/win_util.cc index d8f8b4e..6f193cc 100644 --- a/base/win_util.cc +++ b/base/win_util.cc @@ -60,6 +60,24 @@ WinVersion GetWinVersion() { return win_version; } +void GetServicePackLevel(int* major, int* minor) { + DCHECK(major && minor); + static bool checked_version = false; + static int service_pack_major = -1; + static int service_pack_minor = -1; + if (!checked_version) { + OSVERSIONINFOEX version_info = {0}; + version_info.dwOSVersionInfoSize = sizeof(version_info); + GetVersionEx(reinterpret_cast<LPOSVERSIONINFOW>(&version_info)); + service_pack_major = version_info.wServicePackMajor; + service_pack_minor = version_info.wServicePackMinor; + checked_version = true; + } + + *major = service_pack_major; + *minor = service_pack_minor; +} + bool AddAccessToKernelObject(HANDLE handle, WELL_KNOWN_SID_TYPE known_sid, ACCESS_MASK access) { PSECURITY_DESCRIPTOR descriptor = NULL; diff --git a/base/win_util.h b/base/win_util.h index 54f5e4a..d3728c1 100644 --- a/base/win_util.h +++ b/base/win_util.h @@ -28,6 +28,9 @@ void GetNonClientMetrics(NONCLIENTMETRICS* metrics); // Returns the running version of Windows. WinVersion GetWinVersion(); +// Returns the major and minor version of the service pack installed. +void GetServicePackLevel(int* major, int* minor); + // Adds an ACE in the DACL of the object referenced by handle. The ACE is // granting |access| to the user |known_sid|. // If |known_sid| is WinSelfSid, the sid of the current user will be added to diff --git a/chrome/browser/views/about_chrome_view.cc b/chrome/browser/views/about_chrome_view.cc index fc0ec12..6766a9b 100644 --- a/chrome/browser/views/about_chrome_view.cc +++ b/chrome/browser/views/about_chrome_view.cc @@ -251,11 +251,16 @@ void AboutChromeView::ViewHierarchyChanged(bool is_add, parent->AddChildView(&timeout_indicator_); timeout_indicator_.SetVisible(false); - // On-demand updates for Chrome don't work in Vista when UAC is turned + // On-demand updates for Chrome don't work in Vista RTM when UAC is turned // off. So, in this case we just want the About box to not mention // on-demand updates. Silent updates (in the background) should still - // work as before. - if (win_util::UserAccountControlIsEnabled()) { + // work as before - enabling UAC or installing the latest service pack + // for Vista is another option. + int service_pack_major = 0, service_pack_minor = 0; + win_util::GetServicePackLevel(&service_pack_major, &service_pack_minor); + if (win_util::UserAccountControlIsEnabled() || + (win_util::GetWinVersion() == win_util::WINVERSION_VISTA && + service_pack_major >= 1)) { UpdateStatus(UPGRADE_CHECK_STARTED, GOOGLE_UPDATE_NO_ERROR); google_updater_->CheckForUpdate(false); // false=don't upgrade yet. } |