| 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__ |
| (...skipping 30 matching lines...) Expand all Loading... |
| 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 // This function checks if the current OS is supported for Chromium. | 48 // This function checks if the current OS is supported for Chromium. |
| 49 static bool IsOSSupported(); | 49 static bool IsOSSupported(); |
| 50 | 50 |
| 51 // This function sets installer error information in registry so that Google | 51 // Adds work items to |install_list|, which should be a |
| 52 // Update can read it and display to the user. |state_key| should be | 52 // NoRollbackWorkItemList, to set installer error information in the registry |
| 53 // obtained via the state_key method of an InstallerState instance created | 53 // for consumption by Google Update. |state_key| must be the full path to an |
| 54 // before the machine state is modified by the installer. | 54 // app's ClientState key. See InstallerState::WriteInstallerResult for more |
| 55 static void WriteInstallerResult(bool system_install, | 55 // details. |
| 56 const std::wstring& state_key, | 56 static void AddInstallerResultItems(bool system_install, |
| 57 installer::InstallStatus status, | 57 const std::wstring& state_key, |
| 58 int string_resource_id, | 58 installer::InstallStatus status, |
| 59 const std::wstring* const launch_cmd); | 59 int string_resource_id, |
| 60 const std::wstring* const launch_cmd, |
| 61 WorkItemList* install_list); |
| 60 | 62 |
| 61 // Update the installer stage reported by Google Update. |state_key_path| | 63 // Update the installer stage reported by Google Update. |state_key_path| |
| 62 // should be obtained via the state_key method of an InstallerState instance | 64 // should be obtained via the state_key method of an InstallerState instance |
| 63 // created before the machine state is modified by the installer. | 65 // created before the machine state is modified by the installer. |
| 64 static void UpdateInstallerStage(bool system_install, | 66 static void UpdateInstallerStage(bool system_install, |
| 65 const std::wstring& state_key_path, | 67 const std::wstring& state_key_path, |
| 66 installer::InstallerStage stage); | 68 installer::InstallerStage stage); |
| 67 | 69 |
| 68 // Returns true if this installation path is per user, otherwise returns | 70 // Returns true if this installation path is per user, otherwise returns |
| 69 // false (per machine install, meaning: the exe_path contains path to | 71 // false (per machine install, meaning: the exe_path contains path to |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 | 160 |
| 159 // Returns a string in the form YYYYMMDD of the current date. | 161 // Returns a string in the form YYYYMMDD of the current date. |
| 160 static std::wstring GetCurrentDate(); | 162 static std::wstring GetCurrentDate(); |
| 161 | 163 |
| 162 private: | 164 private: |
| 163 DISALLOW_COPY_AND_ASSIGN(InstallUtil); | 165 DISALLOW_COPY_AND_ASSIGN(InstallUtil); |
| 164 }; | 166 }; |
| 165 | 167 |
| 166 | 168 |
| 167 #endif // CHROME_INSTALLER_UTIL_INSTALL_UTIL_H__ | 169 #endif // CHROME_INSTALLER_UTIL_INSTALL_UTIL_H__ |
| OLD | NEW |