| 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 #ifndef CHROME_INSTALLER_SETUP_INSTALL_WORKER_H_ | 8 #ifndef CHROME_INSTALLER_SETUP_INSTALL_WORKER_H_ |
| 9 #define CHROME_INSTALLER_SETUP_INSTALL_WORKER_H_ | 9 #define CHROME_INSTALLER_SETUP_INSTALL_WORKER_H_ |
| 10 | 10 |
| 11 #include <windows.h> | 11 #include <windows.h> |
| 12 | 12 |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 class BrowserDistribution; | 15 class BrowserDistribution; |
| 16 class CommandLine; | 16 class CommandLine; |
| 17 class FilePath; | |
| 18 class Version; | 17 class Version; |
| 19 class WorkItemList; | 18 class WorkItemList; |
| 20 | 19 |
| 20 namespace base { |
| 21 class FilePath; |
| 22 } |
| 23 |
| 21 namespace installer { | 24 namespace installer { |
| 22 | 25 |
| 23 class InstallationState; | 26 class InstallationState; |
| 24 class InstallerState; | 27 class InstallerState; |
| 25 class Product; | 28 class Product; |
| 26 | 29 |
| 27 // This method adds work items to create (or update) Chrome uninstall entry in | 30 // This method adds work items to create (or update) Chrome uninstall entry in |
| 28 // either the Control Panel->Add/Remove Programs list or in the Omaha client | 31 // either the Control Panel->Add/Remove Programs list or in the Omaha client |
| 29 // state key if running under an MSI installer. | 32 // state key if running under an MSI installer. |
| 30 void AddUninstallShortcutWorkItems(const InstallerState& installer_state, | 33 void AddUninstallShortcutWorkItems(const InstallerState& installer_state, |
| 31 const FilePath& setup_path, | 34 const base::FilePath& setup_path, |
| 32 const Version& new_version, | 35 const Version& new_version, |
| 33 const Product& product, | 36 const Product& product, |
| 34 WorkItemList* install_list); | 37 WorkItemList* install_list); |
| 35 | 38 |
| 36 // Creates Version key for a product (if not already present) and sets the new | 39 // Creates Version key for a product (if not already present) and sets the new |
| 37 // product version as the last step. If |add_language_identifier| is true, the | 40 // product version as the last step. If |add_language_identifier| is true, the |
| 38 // "lang" value is also set according to the currently selected translation. | 41 // "lang" value is also set according to the currently selected translation. |
| 39 void AddVersionKeyWorkItems(HKEY root, | 42 void AddVersionKeyWorkItems(HKEY root, |
| 40 BrowserDistribution* dist, | 43 BrowserDistribution* dist, |
| 41 const Version& new_version, | 44 const Version& new_version, |
| (...skipping 30 matching lines...) Expand all Loading... |
| 72 // do a few post install tasks: | 75 // do a few post install tasks: |
| 73 // - Handle the case of in-use-update by updating "opv" (old version) key or | 76 // - Handle the case of in-use-update by updating "opv" (old version) key or |
| 74 // deleting it if not required. | 77 // deleting it if not required. |
| 75 // - Register any new dlls and unregister old dlls. | 78 // - Register any new dlls and unregister old dlls. |
| 76 // - If this is an MSI install, ensures that the MSI marker is set, and sets | 79 // - If this is an MSI install, ensures that the MSI marker is set, and sets |
| 77 // it if not. | 80 // it if not. |
| 78 // If these operations are successful, the function returns true, otherwise | 81 // If these operations are successful, the function returns true, otherwise |
| 79 // false. | 82 // false. |
| 80 // |current_version| can be NULL to indicate no Chrome is currently installed. | 83 // |current_version| can be NULL to indicate no Chrome is currently installed. |
| 81 bool AppendPostInstallTasks(const InstallerState& installer_state, | 84 bool AppendPostInstallTasks(const InstallerState& installer_state, |
| 82 const FilePath& setup_path, | 85 const base::FilePath& setup_path, |
| 83 const Version* current_version, | 86 const Version* current_version, |
| 84 const Version& new_version, | 87 const Version& new_version, |
| 85 const FilePath& temp_path, | 88 const base::FilePath& temp_path, |
| 86 WorkItemList* post_install_task_list); | 89 WorkItemList* post_install_task_list); |
| 87 | 90 |
| 88 // Builds the complete WorkItemList used to build the set of installation steps | 91 // Builds the complete WorkItemList used to build the set of installation steps |
| 89 // needed to lay down one or more installed products. | 92 // needed to lay down one or more installed products. |
| 90 // | 93 // |
| 91 // setup_path: Path to the executable (setup.exe) as it will be copied | 94 // setup_path: Path to the executable (setup.exe) as it will be copied |
| 92 // to Chrome install folder after install is complete | 95 // to Chrome install folder after install is complete |
| 93 // archive_path: Path to the archive (chrome.7z) as it will be copied | 96 // archive_path: Path to the archive (chrome.7z) as it will be copied |
| 94 // to Chrome install folder after install is complete | 97 // to Chrome install folder after install is complete |
| 95 // src_path: the path that contains a complete and unpacked Chrome package | 98 // src_path: the path that contains a complete and unpacked Chrome package |
| 96 // to be installed. | 99 // to be installed. |
| 97 // temp_path: the path of working directory used during installation. This path | 100 // temp_path: the path of working directory used during installation. This path |
| 98 // does not need to exist. | 101 // does not need to exist. |
| 99 // |current_version| can be NULL to indicate no Chrome is currently installed. | 102 // |current_version| can be NULL to indicate no Chrome is currently installed. |
| 100 void AddInstallWorkItems(const InstallationState& original_state, | 103 void AddInstallWorkItems(const InstallationState& original_state, |
| 101 const InstallerState& installer_state, | 104 const InstallerState& installer_state, |
| 102 const FilePath& setup_path, | 105 const base::FilePath& setup_path, |
| 103 const FilePath& archive_path, | 106 const base::FilePath& archive_path, |
| 104 const FilePath& src_path, | 107 const base::FilePath& src_path, |
| 105 const FilePath& temp_path, | 108 const base::FilePath& temp_path, |
| 106 const Version* current_version, | 109 const Version* current_version, |
| 107 const Version& new_version, | 110 const Version& new_version, |
| 108 WorkItemList* install_list); | 111 WorkItemList* install_list); |
| 109 | 112 |
| 110 // Appends registration or unregistration work items to |work_item_list| for the | 113 // 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 | 114 // COM DLLs whose file names are given in |dll_files| and which reside in the |
| 112 // path |dll_folder|. | 115 // path |dll_folder|. |
| 113 // |system_level| specifies whether to call the system or user level DLL | 116 // |system_level| specifies whether to call the system or user level DLL |
| 114 // registration entry points. | 117 // registration entry points. |
| 115 // |do_register| says whether to register or unregister. | 118 // |do_register| says whether to register or unregister. |
| 116 // |may_fail| states whether this is best effort or not. If |may_fail| is true | 119 // |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 | 120 // then |work_item_list| will still succeed if the registration fails and |
| 118 // no registration rollback will be performed. | 121 // no registration rollback will be performed. |
| 119 void AddRegisterComDllWorkItems(const FilePath& dll_folder, | 122 void AddRegisterComDllWorkItems(const base::FilePath& dll_folder, |
| 120 const std::vector<FilePath>& dll_files, | 123 const std::vector<base::FilePath>& dll_files, |
| 121 bool system_level, | 124 bool system_level, |
| 122 bool do_register, | 125 bool do_register, |
| 123 bool ignore_failures, | 126 bool ignore_failures, |
| 124 WorkItemList* work_item_list); | 127 WorkItemList* work_item_list); |
| 125 | 128 |
| 126 void AddSetMsiMarkerWorkItem(const InstallerState& installer_state, | 129 void AddSetMsiMarkerWorkItem(const InstallerState& installer_state, |
| 127 BrowserDistribution* dist, | 130 BrowserDistribution* dist, |
| 128 bool set, | 131 bool set, |
| 129 WorkItemList* work_item_list); | 132 WorkItemList* work_item_list); |
| 130 | 133 |
| 131 // Called for either installation or uninstallation. This method updates the | 134 // Called for either installation or uninstallation. This method updates the |
| 132 // registry according to Chrome Frame specific options for the current | 135 // registry according to Chrome Frame specific options for the current |
| 133 // installation. This includes handling of the ready-mode option. | 136 // installation. This includes handling of the ready-mode option. |
| 134 void AddChromeFrameWorkItems(const InstallationState& original_state, | 137 void AddChromeFrameWorkItems(const InstallationState& original_state, |
| 135 const InstallerState& installer_state, | 138 const InstallerState& installer_state, |
| 136 const FilePath& setup_path, | 139 const base::FilePath& setup_path, |
| 137 const Version& new_version, | 140 const Version& new_version, |
| 138 const Product& product, | 141 const Product& product, |
| 139 WorkItemList* list); | 142 WorkItemList* list); |
| 140 | 143 |
| 141 // Called for either installation or uninstallation. This method adds or | 144 // Called for either installation or uninstallation. This method adds or |
| 142 // removes COM registration for a product's DelegateExecute verb handler. | 145 // removes COM registration for a product's DelegateExecute verb handler. |
| 143 // If |new_version| is empty, the registrations will point to | 146 // If |new_version| is empty, the registrations will point to |
| 144 // delegate_execute.exe directly in |target_path|. | 147 // delegate_execute.exe directly in |target_path|. |
| 145 void AddDelegateExecuteWorkItems(const InstallerState& installer_state, | 148 void AddDelegateExecuteWorkItems(const InstallerState& installer_state, |
| 146 const FilePath& target_path, | 149 const base::FilePath& target_path, |
| 147 const Version& new_version, | 150 const Version& new_version, |
| 148 const Product& product, | 151 const Product& product, |
| 149 WorkItemList* list); | 152 WorkItemList* list); |
| 150 | 153 |
| 151 // Adds Active Setup registration for sytem-level setup to be called by Windows | 154 // Adds Active Setup registration for sytem-level setup to be called by Windows |
| 152 // on user-login post-install/update. | 155 // on user-login post-install/update. |
| 153 // This method should be called for installation only. | 156 // This method should be called for installation only. |
| 154 // |product|: The product being installed. This method is a no-op if this is | 157 // |product|: The product being installed. This method is a no-op if this is |
| 155 // anything other than system-level Chrome/Chromium. | 158 // anything other than system-level Chrome/Chromium. |
| 156 void AddActiveSetupWorkItems(const InstallerState& installer_state, | 159 void AddActiveSetupWorkItems(const InstallerState& installer_state, |
| 157 const FilePath& setup_path, | 160 const base::FilePath& setup_path, |
| 158 const Version& new_version, | 161 const Version& new_version, |
| 159 const Product& product, | 162 const Product& product, |
| 160 WorkItemList* list); | 163 WorkItemList* list); |
| 161 | 164 |
| 162 // Unregisters the "opv" version of ChromeLauncher from IE's low rights | 165 // Unregisters the "opv" version of ChromeLauncher from IE's low rights |
| 163 // elevation policy. | 166 // elevation policy. |
| 164 void AddDeleteOldIELowRightsPolicyWorkItems( | 167 void AddDeleteOldIELowRightsPolicyWorkItems( |
| 165 const InstallerState& installer_state, | 168 const InstallerState& installer_state, |
| 166 WorkItemList* install_list); | 169 WorkItemList* install_list); |
| 167 | 170 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 179 | 182 |
| 180 // Adds work items to add or remove the "quick-enable-cf" to the multi-installer | 183 // Adds work items to add or remove the "quick-enable-cf" to the multi-installer |
| 181 // binaries' version key on the basis of the current operation (represented in | 184 // binaries' version key on the basis of the current operation (represented in |
| 182 // |installer_state|) and the pre-existing machine configuration (represented in | 185 // |installer_state|) and the pre-existing machine configuration (represented in |
| 183 // |machine_state|). |setup_path| (the path to the executable currently being | 186 // |machine_state|). |setup_path| (the path to the executable currently being |
| 184 // run) and |new_version| (the version of the product(s) currently being | 187 // run) and |new_version| (the version of the product(s) currently being |
| 185 // installed) are required when processing product installation; they are unused | 188 // installed) are required when processing product installation; they are unused |
| 186 // (and may therefore be empty) when uninstalling. | 189 // (and may therefore be empty) when uninstalling. |
| 187 void AddQuickEnableChromeFrameWorkItems(const InstallerState& installer_state, | 190 void AddQuickEnableChromeFrameWorkItems(const InstallerState& installer_state, |
| 188 const InstallationState& machine_state, | 191 const InstallationState& machine_state, |
| 189 const FilePath& setup_path, | 192 const base::FilePath& setup_path, |
| 190 const Version& new_version, | 193 const Version& new_version, |
| 191 WorkItemList* work_item_list); | 194 WorkItemList* work_item_list); |
| 192 | 195 |
| 193 // Adds work items to add or remove the "quick-enable-application-host" command | 196 // Adds work items to add or remove the "quick-enable-application-host" command |
| 194 // to the multi-installer binaries' version key on the basis of the current | 197 // to the multi-installer binaries' version key on the basis of the current |
| 195 // operation (represented in |installer_state|) and the pre-existing machine | 198 // operation (represented in |installer_state|) and the pre-existing machine |
| 196 // configuration (represented in |machine_state|). |setup_path| (the path to | 199 // configuration (represented in |machine_state|). |setup_path| (the path to |
| 197 // the executable currently being run) and |new_version| (the version of the | 200 // the executable currently being run) and |new_version| (the version of the |
| 198 // product(s) currently being installed) are required when processing product | 201 // product(s) currently being installed) are required when processing product |
| 199 // installation; they are unused ((and may therefore be empty) when | 202 // installation; they are unused ((and may therefore be empty) when |
| 200 // uninstalling). | 203 // uninstalling). |
| 201 void AddQuickEnableApplicationLauncherWorkItems( | 204 void AddQuickEnableApplicationLauncherWorkItems( |
| 202 const InstallerState& installer_state, | 205 const InstallerState& installer_state, |
| 203 const InstallationState& machine_state, | 206 const InstallationState& machine_state, |
| 204 const FilePath& setup_path, | 207 const base::FilePath& setup_path, |
| 205 const Version& new_version, | 208 const Version& new_version, |
| 206 WorkItemList* work_item_list); | 209 WorkItemList* work_item_list); |
| 207 | 210 |
| 208 // Adds work items to add or remove the "on-os-upgrade" command to |product|'s | 211 // Adds work items to add or remove the "on-os-upgrade" command to |product|'s |
| 209 // version key on the basis of the current operation (represented in | 212 // version key on the basis of the current operation (represented in |
| 210 // |installer_state|). |new_version| is the version of the product(s) | 213 // |installer_state|). |new_version| is the version of the product(s) |
| 211 // currently being installed -- can be empty on uninstall. | 214 // currently being installed -- can be empty on uninstall. |
| 212 void AddOsUpgradeWorkItems(const InstallerState& installer_state, | 215 void AddOsUpgradeWorkItems(const InstallerState& installer_state, |
| 213 const FilePath& setup_path, | 216 const base::FilePath& setup_path, |
| 214 const Version& new_version, | 217 const Version& new_version, |
| 215 const Product& product, | 218 const Product& product, |
| 216 WorkItemList* install_list); | 219 WorkItemList* install_list); |
| 217 | 220 |
| 218 // Adds work items to add or remove the "query-eula-acceptance" command to | 221 // Adds work items to add or remove the "query-eula-acceptance" command to |
| 219 // |product|'s version key on the basis of the current operation (represented | 222 // |product|'s version key on the basis of the current operation (represented |
| 220 // in |installer_state|). |new_version| is the version of the product(s) | 223 // in |installer_state|). |new_version| is the version of the product(s) |
| 221 // currently being installed -- can be empty on uninstall. | 224 // currently being installed -- can be empty on uninstall. |
| 222 void AddQueryEULAAcceptanceWorkItems(const InstallerState& installer_state, | 225 void AddQueryEULAAcceptanceWorkItems(const InstallerState& installer_state, |
| 223 const FilePath& setup_path, | 226 const base::FilePath& setup_path, |
| 224 const Version& new_version, | 227 const Version& new_version, |
| 225 const Product& product, | 228 const Product& product, |
| 226 WorkItemList* work_item_list); | 229 WorkItemList* work_item_list); |
| 227 | 230 |
| 228 } // namespace installer | 231 } // namespace installer |
| 229 | 232 |
| 230 #endif // CHROME_INSTALLER_SETUP_INSTALL_WORKER_H_ | 233 #endif // CHROME_INSTALLER_SETUP_INSTALL_WORKER_H_ |
| OLD | NEW |