| Index: chrome/installer/gcapi/gcapi.cc
|
| diff --git a/chrome/installer/gcapi/gcapi.cc b/chrome/installer/gcapi/gcapi.cc
|
| index f00ec0d757807c6b719c65d398f7920babad81e5..1617dd2f541fb7e221c0b4756804063a702463ba 100644
|
| --- a/chrome/installer/gcapi/gcapi.cc
|
| +++ b/chrome/installer/gcapi/gcapi.cc
|
| @@ -227,27 +227,16 @@ bool IsC1FSent() {
|
| RegKeyHasC1F(HKEY_LOCAL_MACHINE, kC1FPendingKey);
|
| }
|
|
|
| -enum WindowsVersion {
|
| - VERSION_BELOW_XP_SP2,
|
| - VERSION_XP_SP2_UP_TO_VISTA, // "but not including"
|
| - VERSION_VISTA_OR_HIGHER,
|
| -};
|
| -WindowsVersion GetWindowsVersion() {
|
| +bool IsWindowsVersionSupported() {
|
| OSVERSIONINFOEX version_info = { sizeof version_info };
|
| GetVersionEx(reinterpret_cast<OSVERSIONINFO*>(&version_info));
|
|
|
| - // Windows Vista is version 6.0.
|
| - if (version_info.dwMajorVersion >= 6)
|
| - return VERSION_VISTA_OR_HIGHER;
|
| -
|
| - // Windows XP is version 5.1. (5.2 is Windows Server 2003/XP Pro x64.)
|
| - if ((version_info.dwMajorVersion < 5) || (version_info.dwMinorVersion < 1))
|
| - return VERSION_BELOW_XP_SP2;
|
| + // Windows 7 is version 6.1.
|
| + if (version_info.dwMajorVersion > 6 ||
|
| + (version_info.dwMajorVersion == 6 && version_info.dwMinorVersion > 0))
|
| + return true;
|
|
|
| - // For XP itself, we only support SP2 and above.
|
| - return ((version_info.dwMinorVersion > 1) ||
|
| - (version_info.wServicePackMajor >= 2)) ?
|
| - VERSION_XP_SP2_UP_TO_VISTA : VERSION_BELOW_XP_SP2;
|
| + return false;
|
| }
|
|
|
| // Note this function should not be called on old Windows versions where these
|
| @@ -297,8 +286,7 @@ bool VerifyHKLMAccess() {
|
|
|
| bool IsRunningElevated() {
|
| // This method should be called only for Vista or later.
|
| - if ((GetWindowsVersion() < VERSION_VISTA_OR_HIGHER) ||
|
| - !VerifyAdminGroup())
|
| + if (!IsWindowsVersionSupported() || !VerifyAdminGroup())
|
| return false;
|
|
|
| HANDLE process_token;
|
| @@ -406,9 +394,9 @@ BOOL __stdcall GoogleChromeCompatibilityCheck(BOOL set_flag,
|
| DWORD* reasons) {
|
| DWORD local_reasons = 0;
|
|
|
| - WindowsVersion windows_version = GetWindowsVersion();
|
| + bool is_windows_version_supported = IsWindowsVersionSupported();
|
| // System requirements?
|
| - if (windows_version == VERSION_BELOW_XP_SP2)
|
| + if (!is_windows_version_supported)
|
| local_reasons |= GCCC_ERROR_OSNOTSUPPORTED;
|
|
|
| if (IsChromeInstalled(HKEY_LOCAL_MACHINE))
|
| @@ -422,11 +410,10 @@ BOOL __stdcall GoogleChromeCompatibilityCheck(BOOL set_flag,
|
| // GCAPI is being invoked from an elevated shell, or in admin mode
|
| if (!VerifyHKLMAccess()) {
|
| local_reasons |= GCCC_ERROR_ACCESSDENIED;
|
| - } else if ((windows_version == VERSION_VISTA_OR_HIGHER) &&
|
| - !VerifyAdminGroup()) {
|
| - // For Vista or later check for elevation since even for admin user we could
|
| - // be running in non-elevated mode. We require integrity level High.
|
| - local_reasons |= GCCC_ERROR_INTEGRITYLEVEL;
|
| + } else if (is_windows_version_supported && !VerifyAdminGroup()) {
|
| + // For Vista or later check for elevation since even for admin user we
|
| + // could be running in non-elevated mode. We require integrity level High.
|
| + local_reasons |= GCCC_ERROR_INTEGRITYLEVEL;
|
| }
|
| }
|
|
|
|
|