[email protected] | a3bb1a6 | 2011-01-14 19:47:56 | [diff] [blame] | 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 |
| 3 | // found in the LICENSE file. |
| 4 | // |
| 5 | // This file contains the declarations of the installer functions that build |
| 6 | // the WorkItemList used to install the application. |
| 7 | |
| 8 | #ifndef CHROME_INSTALLER_SETUP_INSTALL_WORKER_H_ |
| 9 | #define CHROME_INSTALLER_SETUP_INSTALL_WORKER_H_ |
| 10 | #pragma once |
| 11 | |
[email protected] | 07ec376 | 2011-02-07 18:00:05 | [diff] [blame] | 12 | #include <windows.h> |
| 13 | |
[email protected] | a3bb1a6 | 2011-01-14 19:47:56 | [diff] [blame] | 14 | #include <vector> |
| 15 | |
[email protected] | 3b63f8f4 | 2011-03-28 01:54:15 | [diff] [blame^] | 16 | #include "base/memory/scoped_ptr.h" |
[email protected] | a3bb1a6 | 2011-01-14 19:47:56 | [diff] [blame] | 17 | |
[email protected] | f0260d2 | 2011-01-25 16:44:37 | [diff] [blame] | 18 | class BrowserDistribution; |
[email protected] | a3bb1a6 | 2011-01-14 19:47:56 | [diff] [blame] | 19 | class CommandLine; |
| 20 | class FilePath; |
| 21 | class Version; |
| 22 | class WorkItemList; |
| 23 | |
| 24 | namespace installer { |
| 25 | |
| 26 | class InstallationState; |
| 27 | class InstallerState; |
| 28 | class Package; |
| 29 | class Product; |
| 30 | |
[email protected] | f0260d2 | 2011-01-25 16:44:37 | [diff] [blame] | 31 | // Adds work items that make registry adjustments for Google Update. When a |
| 32 | // product is installed (including overinstall), Google Update will write the |
| 33 | // channel ("ap") value into either Chrome or Chrome Frame's ClientState key. |
| 34 | // In the multi-install case, this value is used as the basis upon which the |
| 35 | // package's channel value is built (by adding the ordered list of installed |
| 36 | // products and their options). |
[email protected] | 5f27dc1 | 2011-03-06 20:42:39 | [diff] [blame] | 37 | void AddGoogleUpdateWorkItems(const InstallationState& original_state, |
| 38 | const InstallerState& installer_state, |
[email protected] | f0260d2 | 2011-01-25 16:44:37 | [diff] [blame] | 39 | WorkItemList* install_list); |
| 40 | |
[email protected] | 07ec376 | 2011-02-07 18:00:05 | [diff] [blame] | 41 | // After a successful copying of all the files, this function is called to |
| 42 | // do a few post install tasks: |
| 43 | // - Handle the case of in-use-update by updating "opv" (old version) key or |
| 44 | // deleting it if not required. |
| 45 | // - Register any new dlls and unregister old dlls. |
| 46 | // - If this is an MSI install, ensures that the MSI marker is set, and sets |
| 47 | // it if not. |
| 48 | // If these operations are successful, the function returns true, otherwise |
| 49 | // false. |
| 50 | bool AppendPostInstallTasks(const InstallerState& installer_state, |
| 51 | const FilePath& setup_path, |
| 52 | const FilePath& new_chrome_exe, |
| 53 | const Version* current_version, |
| 54 | const Version& new_version, |
[email protected] | bdddb67 | 2011-02-18 14:54:50 | [diff] [blame] | 55 | const FilePath& temp_path, |
[email protected] | 07ec376 | 2011-02-07 18:00:05 | [diff] [blame] | 56 | WorkItemList* post_install_task_list); |
| 57 | |
[email protected] | a3bb1a6 | 2011-01-14 19:47:56 | [diff] [blame] | 58 | // Builds the complete WorkItemList used to build the set of installation steps |
| 59 | // needed to lay down one or more installed products. |
| 60 | // |
| 61 | // setup_path: Path to the executable (setup.exe) as it will be copied |
| 62 | // to Chrome install folder after install is complete |
| 63 | // archive_path: Path to the archive (chrome.7z) as it will be copied |
| 64 | // to Chrome install folder after install is complete |
| 65 | // src_path: the path that contains a complete and unpacked Chrome package |
| 66 | // to be installed. |
[email protected] | bdddb67 | 2011-02-18 14:54:50 | [diff] [blame] | 67 | // temp_path: the path of working directory used during installation. This path |
| 68 | // does not need to exist. |
[email protected] | a3bb1a6 | 2011-01-14 19:47:56 | [diff] [blame] | 69 | void AddInstallWorkItems(const InstallationState& original_state, |
| 70 | const InstallerState& installer_state, |
[email protected] | a3bb1a6 | 2011-01-14 19:47:56 | [diff] [blame] | 71 | const FilePath& setup_path, |
| 72 | const FilePath& archive_path, |
| 73 | const FilePath& src_path, |
[email protected] | bdddb67 | 2011-02-18 14:54:50 | [diff] [blame] | 74 | const FilePath& temp_path, |
[email protected] | a3bb1a6 | 2011-01-14 19:47:56 | [diff] [blame] | 75 | const Version& new_version, |
| 76 | scoped_ptr<Version>* current_version, |
[email protected] | a3bb1a6 | 2011-01-14 19:47:56 | [diff] [blame] | 77 | WorkItemList* install_list); |
| 78 | |
| 79 | // Appends registration or unregistration work items to |work_item_list| for the |
| 80 | // COM DLLs whose file names are given in |dll_files| and which reside in the |
| 81 | // path |dll_folder|. |
| 82 | // |system_level| specifies whether to call the system or user level DLL |
| 83 | // registration entry points. |
| 84 | // |do_register| says whether to register or unregister. |
| 85 | // |may_fail| states whether this is best effort or not. If |may_fail| is true |
| 86 | // then |work_item_list| will still succeed if the registration fails and |
| 87 | // no registration rollback will be performed. |
| 88 | void AddRegisterComDllWorkItems(const FilePath& dll_folder, |
| 89 | const std::vector<FilePath>& dll_files, |
| 90 | bool system_level, |
| 91 | bool do_register, |
| 92 | bool ignore_failures, |
| 93 | WorkItemList* work_item_list); |
| 94 | |
[email protected] | f0260d2 | 2011-01-25 16:44:37 | [diff] [blame] | 95 | void AddSetMsiMarkerWorkItem(const InstallerState& installer_state, |
| 96 | BrowserDistribution* dist, |
[email protected] | a3bb1a6 | 2011-01-14 19:47:56 | [diff] [blame] | 97 | bool set, |
| 98 | WorkItemList* work_item_list); |
| 99 | |
| 100 | // Called for either installation or uninstallation. This method updates the |
| 101 | // registry according to Chrome Frame specific options for the current |
| 102 | // installation. This includes handling of the ready-mode option. |
[email protected] | f0260d2 | 2011-01-25 16:44:37 | [diff] [blame] | 103 | void AddChromeFrameWorkItems(const InstallationState& original_state, |
| 104 | const InstallerState& installer_state, |
| 105 | const FilePath& setup_path, |
| 106 | const Version& new_version, |
| 107 | const Product& product, |
[email protected] | a3bb1a6 | 2011-01-14 19:47:56 | [diff] [blame] | 108 | WorkItemList* list); |
| 109 | |
[email protected] | a3bb1a6 | 2011-01-14 19:47:56 | [diff] [blame] | 110 | // This method adds work items to create (or update) Chrome uninstall entry in |
| 111 | // either the Control Panel->Add/Remove Programs list or in the Omaha client |
| 112 | // state key if running under an MSI installer. |
[email protected] | f0260d2 | 2011-01-25 16:44:37 | [diff] [blame] | 113 | void AddUninstallShortcutWorkItems(const InstallerState& installer_state, |
| 114 | const FilePath& setup_path, |
[email protected] | a3bb1a6 | 2011-01-14 19:47:56 | [diff] [blame] | 115 | const Version& new_version, |
| 116 | WorkItemList* install_list, |
| 117 | const Product& product); |
| 118 | |
[email protected] | 07ec376 | 2011-02-07 18:00:05 | [diff] [blame] | 119 | // Create Version key for a product (if not already present) and sets the new |
| 120 | // product version as the last step. |
| 121 | void AddVersionKeyWorkItems(HKEY root, |
| 122 | BrowserDistribution* dist, |
| 123 | const Version& new_version, |
| 124 | WorkItemList* list); |
| 125 | |
[email protected] | fb3d032 | 2011-02-03 01:07:35 | [diff] [blame] | 126 | // [Un]Registers Chrome and ChromeLauncher in IE's low rights elevation policy. |
| 127 | void AddElevationPolicyWorkItems(const InstallationState& original_state, |
| 128 | const InstallerState& installer_state, |
| 129 | const Version& new_version, |
| 130 | WorkItemList* install_list); |
| 131 | |
[email protected] | a3bb1a6 | 2011-01-14 19:47:56 | [diff] [blame] | 132 | // Utility method currently shared between install.cc and install_worker.cc |
[email protected] | f0260d2 | 2011-01-25 16:44:37 | [diff] [blame] | 133 | void AppendUninstallCommandLineFlags(const InstallerState& installer_state, |
| 134 | const Product& product, |
| 135 | CommandLine* uninstall_cmd); |
[email protected] | a3bb1a6 | 2011-01-14 19:47:56 | [diff] [blame] | 136 | |
[email protected] | fb3d032 | 2011-02-03 01:07:35 | [diff] [blame] | 137 | // Refreshes the elevation policy on platforms where it is supported. |
| 138 | void RefreshElevationPolicy(); |
| 139 | |
[email protected] | 995708f | 2011-03-03 20:05:51 | [diff] [blame] | 140 | // Add work items to add or remove the "quick-enable-cf" to the multi-installer |
| 141 | // binaries' version key on the basis of the current operation (represented in |
| 142 | // |installer_state|) and the pre-existing machine configuration (represented in |
| 143 | // |machine_state|). |setup_path| (the path to the executable currently being |
| 144 | // run) and |new_version| (the version of the product(s) currently being |
| 145 | // installed) are required when processing product installation; they are unused |
| 146 | // (and may therefore be NULL) when uninstalling. |
| 147 | void AddQuickEnableWorkItems(const InstallerState& installer_state, |
| 148 | const InstallationState& machine_state, |
| 149 | const FilePath* setup_path, |
| 150 | const Version* new_version, |
| 151 | WorkItemList* work_item_list); |
| 152 | |
[email protected] | a3bb1a6 | 2011-01-14 19:47:56 | [diff] [blame] | 153 | } // namespace installer |
| 154 | |
| 155 | #endif // CHROME_INSTALLER_SETUP_INSTALL_WORKER_H_ |