OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 util functions for setup project. It also declares a | 5 // This file declares util functions for setup project. It also declares a |
6 // few functions that the Chrome component updater uses for patching binary | 6 // few functions that the Chrome component updater uses for patching binary |
7 // deltas. | 7 // deltas. |
8 | 8 |
9 #ifndef CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ | 9 #ifndef CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ |
10 #define CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ | 10 #define CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 // Spawns a new process that waits for a specified amount of time before | 76 // Spawns a new process that waits for a specified amount of time before |
77 // attempting to delete |path|. This is useful for setup to delete the | 77 // attempting to delete |path|. This is useful for setup to delete the |
78 // currently running executable or a file that we cannot close right away but | 78 // currently running executable or a file that we cannot close right away but |
79 // estimate that it will be possible after some period of time. | 79 // estimate that it will be possible after some period of time. |
80 // Returns true if a new process was started, false otherwise. Note that | 80 // Returns true if a new process was started, false otherwise. Note that |
81 // given the nature of this function, it is not possible to know if the | 81 // given the nature of this function, it is not possible to know if the |
82 // delete operation itself succeeded. | 82 // delete operation itself succeeded. |
83 bool DeleteFileFromTempProcess(const base::FilePath& path, | 83 bool DeleteFileFromTempProcess(const base::FilePath& path, |
84 uint32_t delay_before_delete_ms); | 84 uint32_t delay_before_delete_ms); |
85 | 85 |
86 // Returns true if the product |type| will be installed after the current | |
87 // setup.exe instance have carried out installation / uninstallation, at | |
88 // the level specified by |installer_state|. | |
89 // This function only returns meaningful results for install and update | |
90 // operations if called after CheckPreInstallConditions (see setup_main.cc). | |
91 bool WillProductBePresentAfterSetup( | |
92 const installer::InstallerState& installer_state, | |
93 const installer::InstallationState& machine_state, | |
94 BrowserDistribution::Type type); | |
95 | |
96 // Drops the process down to background processing mode on supported OSes if it | 86 // Drops the process down to background processing mode on supported OSes if it |
97 // was launched below the normal process priority. Returns true when background | 87 // was launched below the normal process priority. Returns true when background |
98 // procesing mode is entered. | 88 // procesing mode is entered. |
99 bool AdjustProcessPriority(); | 89 bool AdjustProcessPriority(); |
100 | 90 |
101 // Makes registry adjustments to migrate the Google Update state of |to_migrate| | 91 // Makes registry adjustments to migrate the Google Update state of |to_migrate| |
102 // from multi-install to single-install. This includes copying the usagestats | 92 // from multi-install to single-install. This includes copying the usagestats |
103 // value and adjusting the ap values of all multi-install products. | 93 // value and adjusting the ap values of all multi-install products. |
104 void MigrateGoogleUpdateStateMultiToSingle( | 94 void MigrateGoogleUpdateStateMultiToSingle( |
105 bool system_level, | 95 bool system_level, |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 int32_t status, | 133 int32_t status, |
144 UnPackConsumer consumer); | 134 UnPackConsumer consumer); |
145 | 135 |
146 // Register Chrome's EventLog message provider dll. | 136 // Register Chrome's EventLog message provider dll. |
147 void RegisterEventLogProvider(const base::FilePath& install_directory, | 137 void RegisterEventLogProvider(const base::FilePath& install_directory, |
148 const base::Version& version); | 138 const base::Version& version); |
149 | 139 |
150 // De-register Chrome's EventLog message provider dll. | 140 // De-register Chrome's EventLog message provider dll. |
151 void DeRegisterEventLogProvider(); | 141 void DeRegisterEventLogProvider(); |
152 | 142 |
| 143 // Removes leftover bits from features that have been removed from the product. |
| 144 void DoLegacyCleanups(const InstallerState& installer_state, |
| 145 InstallStatus install_status); |
| 146 |
153 // This class will enable the privilege defined by |privilege_name| on the | 147 // This class will enable the privilege defined by |privilege_name| on the |
154 // current process' token. The privilege will be disabled upon the | 148 // current process' token. The privilege will be disabled upon the |
155 // ScopedTokenPrivilege's destruction (unless it was already enabled when the | 149 // ScopedTokenPrivilege's destruction (unless it was already enabled when the |
156 // ScopedTokenPrivilege object was constructed). | 150 // ScopedTokenPrivilege object was constructed). |
157 // Some privileges might require admin rights to be enabled (check is_enabled() | 151 // Some privileges might require admin rights to be enabled (check is_enabled() |
158 // to know whether |privilege_name| was successfully enabled). | 152 // to know whether |privilege_name| was successfully enabled). |
159 class ScopedTokenPrivilege { | 153 class ScopedTokenPrivilege { |
160 public: | 154 public: |
161 explicit ScopedTokenPrivilege(const wchar_t* privilege_name); | 155 explicit ScopedTokenPrivilege(const wchar_t* privilege_name); |
162 ~ScopedTokenPrivilege(); | 156 ~ScopedTokenPrivilege(); |
(...skipping 12 matching lines...) Expand all Loading... |
175 // The previous state of the privilege this object is responsible for. As set | 169 // The previous state of the privilege this object is responsible for. As set |
176 // by AdjustTokenPrivileges() upon construction. | 170 // by AdjustTokenPrivileges() upon construction. |
177 TOKEN_PRIVILEGES previous_privileges_; | 171 TOKEN_PRIVILEGES previous_privileges_; |
178 | 172 |
179 DISALLOW_IMPLICIT_CONSTRUCTORS(ScopedTokenPrivilege); | 173 DISALLOW_IMPLICIT_CONSTRUCTORS(ScopedTokenPrivilege); |
180 }; | 174 }; |
181 | 175 |
182 } // namespace installer | 176 } // namespace installer |
183 | 177 |
184 #endif // CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ | 178 #endif // CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ |
OLD | NEW |