| 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 contains the declarations of the installer functions that build | 5 // This file contains the declarations of the installer functions that build |
| 6 // the WorkItemList used to install the application. | 6 // the WorkItemList used to install the application. |
| 7 | 7 |
| 8 //Pickup file for readability review. |
| 9 |
| 8 #ifndef CHROME_INSTALLER_SETUP_INSTALL_WORKER_H_ | 10 #ifndef CHROME_INSTALLER_SETUP_INSTALL_WORKER_H_ |
| 9 #define CHROME_INSTALLER_SETUP_INSTALL_WORKER_H_ | 11 #define CHROME_INSTALLER_SETUP_INSTALL_WORKER_H_ |
| 10 | 12 |
| 11 #include <windows.h> | 13 #include <windows.h> |
| 12 | 14 |
| 13 #include <vector> | 15 #include <vector> |
| 14 | 16 |
| 15 #include "base/memory/scoped_ptr.h" | |
| 16 | |
| 17 class BrowserDistribution; | 17 class BrowserDistribution; |
| 18 class CommandLine; | 18 class CommandLine; |
| 19 class FilePath; | 19 class FilePath; |
| 20 class Version; | 20 class Version; |
| 21 class WorkItemList; | 21 class WorkItemList; |
| 22 | 22 |
| 23 namespace installer { | 23 namespace installer { |
| 24 | 24 |
| 25 class InstallationState; | 25 class InstallationState; |
| 26 class InstallerState; | 26 class InstallerState; |
| 27 class Product; | 27 class Product; |
| 28 | 28 |
| 29 // This method adds work items to create (or update) Chrome uninstall entry in | 29 // This method adds work items to create (or update) Chrome uninstall entry in |
| 30 // either the Control Panel->Add/Remove Programs list or in the Omaha client | 30 // either the Control Panel->Add/Remove Programs list or in the Omaha client |
| 31 // state key if running under an MSI installer. | 31 // state key if running under an MSI installer. |
| 32 void AddUninstallShortcutWorkItems(const InstallerState& installer_state, | 32 void AddUninstallShortcutWorkItems(const InstallerState& installer_state, |
| 33 const FilePath& setup_path, | 33 const FilePath& setup_path, |
| 34 const Version& new_version, | 34 const Version& new_version, |
| 35 WorkItemList* install_list, | 35 const Product& product, |
| 36 const Product& product); | 36 WorkItemList* install_list); |
| 37 | 37 |
| 38 // Creates Version key for a product (if not already present) and sets the new | 38 // Creates Version key for a product (if not already present) and sets the new |
| 39 // product version as the last step. If |add_language_identifier| is true, the | 39 // product version as the last step. If |add_language_identifier| is true, the |
| 40 // "lang" value is also set according to the currently selected translation. | 40 // "lang" value is also set according to the currently selected translation. |
| 41 void AddVersionKeyWorkItems(HKEY root, | 41 void AddVersionKeyWorkItems(HKEY root, |
| 42 BrowserDistribution* dist, | 42 BrowserDistribution* dist, |
| 43 const Version& new_version, | 43 const Version& new_version, |
| 44 bool add_language_identifier, | 44 bool add_language_identifier, |
| 45 WorkItemList* list); | 45 WorkItemList* list); |
| 46 | 46 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 72 | 72 |
| 73 // After a successful copying of all the files, this function is called to | 73 // After a successful copying of all the files, this function is called to |
| 74 // do a few post install tasks: | 74 // do a few post install tasks: |
| 75 // - Handle the case of in-use-update by updating "opv" (old version) key or | 75 // - Handle the case of in-use-update by updating "opv" (old version) key or |
| 76 // deleting it if not required. | 76 // deleting it if not required. |
| 77 // - Register any new dlls and unregister old dlls. | 77 // - Register any new dlls and unregister old dlls. |
| 78 // - If this is an MSI install, ensures that the MSI marker is set, and sets | 78 // - If this is an MSI install, ensures that the MSI marker is set, and sets |
| 79 // it if not. | 79 // it if not. |
| 80 // If these operations are successful, the function returns true, otherwise | 80 // If these operations are successful, the function returns true, otherwise |
| 81 // false. | 81 // false. |
| 82 // |current_version| can be NULL to indicate no Chrome is currently installed. |
| 82 bool AppendPostInstallTasks(const InstallerState& installer_state, | 83 bool AppendPostInstallTasks(const InstallerState& installer_state, |
| 83 const FilePath& setup_path, | 84 const FilePath& setup_path, |
| 84 const Version* current_version, | 85 const Version* current_version, |
| 85 const Version& new_version, | 86 const Version& new_version, |
| 86 const FilePath& temp_path, | 87 const FilePath& temp_path, |
| 87 WorkItemList* post_install_task_list); | 88 WorkItemList* post_install_task_list); |
| 88 | 89 |
| 89 // Builds the complete WorkItemList used to build the set of installation steps | 90 // Builds the complete WorkItemList used to build the set of installation steps |
| 90 // needed to lay down one or more installed products. | 91 // needed to lay down one or more installed products. |
| 91 // | 92 // |
| 92 // setup_path: Path to the executable (setup.exe) as it will be copied | 93 // setup_path: Path to the executable (setup.exe) as it will be copied |
| 93 // to Chrome install folder after install is complete | 94 // to Chrome install folder after install is complete |
| 94 // archive_path: Path to the archive (chrome.7z) as it will be copied | 95 // archive_path: Path to the archive (chrome.7z) as it will be copied |
| 95 // to Chrome install folder after install is complete | 96 // to Chrome install folder after install is complete |
| 96 // src_path: the path that contains a complete and unpacked Chrome package | 97 // src_path: the path that contains a complete and unpacked Chrome package |
| 97 // to be installed. | 98 // to be installed. |
| 98 // temp_path: the path of working directory used during installation. This path | 99 // temp_path: the path of working directory used during installation. This path |
| 99 // does not need to exist. | 100 // does not need to exist. |
| 101 // |current_version| can be NULL to indicate no Chrome is currently installed. |
| 100 void AddInstallWorkItems(const InstallationState& original_state, | 102 void AddInstallWorkItems(const InstallationState& original_state, |
| 101 const InstallerState& installer_state, | 103 const InstallerState& installer_state, |
| 102 const FilePath& setup_path, | 104 const FilePath& setup_path, |
| 103 const FilePath& archive_path, | 105 const FilePath& archive_path, |
| 104 const FilePath& src_path, | 106 const FilePath& src_path, |
| 105 const FilePath& temp_path, | 107 const FilePath& temp_path, |
| 108 const Version* current_version, |
| 106 const Version& new_version, | 109 const Version& new_version, |
| 107 scoped_ptr<Version>* current_version, | |
| 108 WorkItemList* install_list); | 110 WorkItemList* install_list); |
| 109 | 111 |
| 110 // Appends registration or unregistration work items to |work_item_list| for the | 112 // Appends registration or unregistration work items to |work_item_list| for the |
| 111 // COM DLLs whose file names are given in |dll_files| and which reside in the | 113 // COM DLLs whose file names are given in |dll_files| and which reside in the |
| 112 // path |dll_folder|. | 114 // path |dll_folder|. |
| 113 // |system_level| specifies whether to call the system or user level DLL | 115 // |system_level| specifies whether to call the system or user level DLL |
| 114 // registration entry points. | 116 // registration entry points. |
| 115 // |do_register| says whether to register or unregister. | 117 // |do_register| says whether to register or unregister. |
| 116 // |may_fail| states whether this is best effort or not. If |may_fail| is true | 118 // |may_fail| states whether this is best effort or not. If |may_fail| is true |
| 117 // then |work_item_list| will still succeed if the registration fails and | 119 // then |work_item_list| will still succeed if the registration fails and |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 | 175 |
| 174 // Refreshes the elevation policy on platforms where it is supported. | 176 // Refreshes the elevation policy on platforms where it is supported. |
| 175 void RefreshElevationPolicy(); | 177 void RefreshElevationPolicy(); |
| 176 | 178 |
| 177 // Adds work items to add or remove the "quick-enable-cf" to the multi-installer | 179 // Adds work items to add or remove the "quick-enable-cf" to the multi-installer |
| 178 // binaries' version key on the basis of the current operation (represented in | 180 // binaries' version key on the basis of the current operation (represented in |
| 179 // |installer_state|) and the pre-existing machine configuration (represented in | 181 // |installer_state|) and the pre-existing machine configuration (represented in |
| 180 // |machine_state|). |setup_path| (the path to the executable currently being | 182 // |machine_state|). |setup_path| (the path to the executable currently being |
| 181 // run) and |new_version| (the version of the product(s) currently being | 183 // run) and |new_version| (the version of the product(s) currently being |
| 182 // installed) are required when processing product installation; they are unused | 184 // installed) are required when processing product installation; they are unused |
| 183 // (and may therefore be NULL) when uninstalling. | 185 // (and may therefore be empty) when uninstalling. |
| 184 void AddQuickEnableChromeFrameWorkItems(const InstallerState& installer_state, | 186 void AddQuickEnableChromeFrameWorkItems(const InstallerState& installer_state, |
| 185 const InstallationState& machine_state, | 187 const InstallationState& machine_state, |
| 186 const FilePath* setup_path, | 188 const FilePath& setup_path, |
| 187 const Version* new_version, | 189 const Version& new_version, |
| 188 WorkItemList* work_item_list); | 190 WorkItemList* work_item_list); |
| 189 | 191 |
| 190 // Adds work items to add or remove the "quick-enable-application-host" command | 192 // Adds work items to add or remove the "quick-enable-application-host" command |
| 191 // to the multi-installer binaries' version key on the basis of the current | 193 // to the multi-installer binaries' version key on the basis of the current |
| 192 // operation (represented in |installer_state|) and the pre-existing machine | 194 // operation (represented in |installer_state|) and the pre-existing machine |
| 193 // configuration (represented in |machine_state|). |setup_path| (the path to | 195 // configuration (represented in |machine_state|). |setup_path| (the path to |
| 194 // the executable currently being run) and |new_version| (the version of the | 196 // the executable currently being run) and |new_version| (the version of the |
| 195 // product(s) currently being installed) are required when processing product | 197 // product(s) currently being installed) are required when processing product |
| 196 // installation; they are unused (and may therefore be NULL) when uninstalling. | 198 // installation; they are unused ((and may therefore be empty) when |
| 199 // uninstalling). |
| 197 void AddQuickEnableApplicationHostWorkItems( | 200 void AddQuickEnableApplicationHostWorkItems( |
| 198 const InstallerState& installer_state, | 201 const InstallerState& installer_state, |
| 199 const InstallationState& machine_state, | 202 const InstallationState& machine_state, |
| 200 const FilePath* setup_path, | 203 const FilePath& setup_path, |
| 201 const Version* new_version, | 204 const Version& new_version, |
| 202 WorkItemList* work_item_list); | 205 WorkItemList* work_item_list); |
| 203 | 206 |
| 204 // Adds work items to add or remove the "on-os-upgrade" command to |product|'s | 207 // Adds work items to add or remove the "on-os-upgrade" command to |product|'s |
| 205 // version key on the basis of the current operation (represented in | 208 // version key on the basis of the current operation (represented in |
| 206 // |installer_state|). |new_version| (the version of the product(s) | 209 // |installer_state|). |new_version| is the version of the product(s) |
| 207 // currently being installed) is required when processing product | 210 // currently being installed -- can be empty on uninstall. |
| 208 // installation; it is unused (and may therefore be NULL) when uninstalling. | |
| 209 void AddOsUpgradeWorkItems(const InstallerState& installer_state, | 211 void AddOsUpgradeWorkItems(const InstallerState& installer_state, |
| 210 const FilePath* setup_path, | 212 const FilePath& setup_path, |
| 211 const Version* new_version, | 213 const Version& new_version, |
| 212 const Product& product, | 214 const Product& product, |
| 213 WorkItemList* install_list); | 215 WorkItemList* install_list); |
| 214 | 216 |
| 215 } // namespace installer | 217 } // namespace installer |
| 216 | 218 |
| 217 #endif // CHROME_INSTALLER_SETUP_INSTALL_WORKER_H_ | 219 #endif // CHROME_INSTALLER_SETUP_INSTALL_WORKER_H_ |
| OLD | NEW |