| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 // | 4 // |
| 5 // This file declares utility functions for the installer. The original reason | 5 // This file declares utility functions for the installer. The original reason |
| 6 // for putting these functions in installer\util library is so that we can | 6 // for putting these functions in installer\util library is so that we can |
| 7 // separate out the critical logic and write unit tests for it. | 7 // separate out the critical logic and write unit tests for it. |
| 8 | 8 |
| 9 #ifndef CHROME_INSTALLER_UTIL_INSTALL_UTIL_H__ | 9 #ifndef CHROME_INSTALLER_UTIL_INSTALL_UTIL_H_ |
| 10 #define CHROME_INSTALLER_UTIL_INSTALL_UTIL_H__ | 10 #define CHROME_INSTALLER_UTIL_INSTALL_UTIL_H_ |
| 11 #pragma once | 11 #pragma once |
| 12 | 12 |
| 13 #include <tchar.h> | 13 #include <tchar.h> |
| 14 #include <windows.h> | 14 #include <windows.h> |
| 15 #include <string> | 15 #include <string> |
| 16 | 16 |
| 17 #include "base/basictypes.h" | 17 #include "base/basictypes.h" |
| 18 #include "base/command_line.h" | 18 #include "base/command_line.h" |
| 19 #include "chrome/installer/util/browser_distribution.h" | 19 #include "chrome/installer/util/browser_distribution.h" |
| 20 #include "chrome/installer/util/util_constants.h" | 20 #include "chrome/installer/util/util_constants.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 38 BrowserDistribution::Type distribution_type); | 38 BrowserDistribution::Type distribution_type); |
| 39 | 39 |
| 40 // Find the version of Chrome installed on the system by checking the | 40 // Find the version of Chrome installed on the system by checking the |
| 41 // Google Update registry key. Returns the version or NULL if no version is | 41 // Google Update registry key. Returns the version or NULL if no version is |
| 42 // found. | 42 // found. |
| 43 // system_install: if true, looks for version number under the HKLM root, | 43 // system_install: if true, looks for version number under the HKLM root, |
| 44 // otherwise looks under the HKCU. | 44 // otherwise looks under the HKCU. |
| 45 static Version* GetChromeVersion(BrowserDistribution* dist, | 45 static Version* GetChromeVersion(BrowserDistribution* dist, |
| 46 bool system_install); | 46 bool system_install); |
| 47 | 47 |
| 48 // Find the last critical update (version) of Chrome. Returns the version or |
| 49 // NULL if no such version is found. A critical update is a specially flagged |
| 50 // version (by Google Update) that contains an important security fix. |
| 51 static Version* GetCriticalUpdateVersion(BrowserDistribution* dist); |
| 52 |
| 48 // This function checks if the current OS is supported for Chromium. | 53 // This function checks if the current OS is supported for Chromium. |
| 49 static bool IsOSSupported(); | 54 static bool IsOSSupported(); |
| 50 | 55 |
| 51 // Adds work items to |install_list|, which should be a | 56 // Adds work items to |install_list|, which should be a |
| 52 // NoRollbackWorkItemList, to set installer error information in the registry | 57 // NoRollbackWorkItemList, to set installer error information in the registry |
| 53 // for consumption by Google Update. |state_key| must be the full path to an | 58 // for consumption by Google Update. |state_key| must be the full path to an |
| 54 // app's ClientState key. See InstallerState::WriteInstallerResult for more | 59 // app's ClientState key. See InstallerState::WriteInstallerResult for more |
| 55 // details. | 60 // details. |
| 56 static void AddInstallerResultItems(bool system_install, | 61 static void AddInstallerResultItems(bool system_install, |
| 57 const std::wstring& state_key, | 62 const std::wstring& state_key, |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 CommandLine* command_line); | 164 CommandLine* command_line); |
| 160 | 165 |
| 161 // Returns a string in the form YYYYMMDD of the current date. | 166 // Returns a string in the form YYYYMMDD of the current date. |
| 162 static std::wstring GetCurrentDate(); | 167 static std::wstring GetCurrentDate(); |
| 163 | 168 |
| 164 private: | 169 private: |
| 165 DISALLOW_COPY_AND_ASSIGN(InstallUtil); | 170 DISALLOW_COPY_AND_ASSIGN(InstallUtil); |
| 166 }; | 171 }; |
| 167 | 172 |
| 168 | 173 |
| 169 #endif // CHROME_INSTALLER_UTIL_INSTALL_UTIL_H__ | 174 #endif // CHROME_INSTALLER_UTIL_INSTALL_UTIL_H_ |
| OLD | NEW |