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