blob: c04433c775a8eedd29d057741cd56360b6572109 [file] [log] [blame]
[email protected]a3bb1a62011-01-14 19:47:561// 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]07ec3762011-02-07 18:00:0512#include <windows.h>
13
[email protected]a3bb1a62011-01-14 19:47:5614#include <vector>
15
[email protected]3b63f8f42011-03-28 01:54:1516#include "base/memory/scoped_ptr.h"
[email protected]a3bb1a62011-01-14 19:47:5617
[email protected]f0260d22011-01-25 16:44:3718class BrowserDistribution;
[email protected]a3bb1a62011-01-14 19:47:5619class CommandLine;
20class FilePath;
21class Version;
22class WorkItemList;
23
24namespace installer {
25
26class InstallationState;
27class InstallerState;
28class Package;
29class Product;
30
[email protected]f0260d22011-01-25 16:44:3731// 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]5f27dc12011-03-06 20:42:3937void AddGoogleUpdateWorkItems(const InstallationState& original_state,
38 const InstallerState& installer_state,
[email protected]f0260d22011-01-25 16:44:3739 WorkItemList* install_list);
40
[email protected]07ec3762011-02-07 18:00:0541// 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.
50bool 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]bdddb672011-02-18 14:54:5055 const FilePath& temp_path,
[email protected]07ec3762011-02-07 18:00:0556 WorkItemList* post_install_task_list);
57
[email protected]a3bb1a62011-01-14 19:47:5658// 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]bdddb672011-02-18 14:54:5067// temp_path: the path of working directory used during installation. This path
68// does not need to exist.
[email protected]a3bb1a62011-01-14 19:47:5669void AddInstallWorkItems(const InstallationState& original_state,
70 const InstallerState& installer_state,
[email protected]a3bb1a62011-01-14 19:47:5671 const FilePath& setup_path,
72 const FilePath& archive_path,
73 const FilePath& src_path,
[email protected]bdddb672011-02-18 14:54:5074 const FilePath& temp_path,
[email protected]a3bb1a62011-01-14 19:47:5675 const Version& new_version,
76 scoped_ptr<Version>* current_version,
[email protected]a3bb1a62011-01-14 19:47:5677 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.
88void 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]f0260d22011-01-25 16:44:3795void AddSetMsiMarkerWorkItem(const InstallerState& installer_state,
96 BrowserDistribution* dist,
[email protected]a3bb1a62011-01-14 19:47:5697 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]f0260d22011-01-25 16:44:37103void 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]a3bb1a62011-01-14 19:47:56108 WorkItemList* list);
109
[email protected]a3bb1a62011-01-14 19:47:56110// 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]f0260d22011-01-25 16:44:37113void AddUninstallShortcutWorkItems(const InstallerState& installer_state,
114 const FilePath& setup_path,
[email protected]a3bb1a62011-01-14 19:47:56115 const Version& new_version,
116 WorkItemList* install_list,
117 const Product& product);
118
[email protected]07ec3762011-02-07 18:00:05119// Create Version key for a product (if not already present) and sets the new
120// product version as the last step.
121void AddVersionKeyWorkItems(HKEY root,
122 BrowserDistribution* dist,
123 const Version& new_version,
124 WorkItemList* list);
125
[email protected]fb3d0322011-02-03 01:07:35126// [Un]Registers Chrome and ChromeLauncher in IE's low rights elevation policy.
127void AddElevationPolicyWorkItems(const InstallationState& original_state,
128 const InstallerState& installer_state,
129 const Version& new_version,
130 WorkItemList* install_list);
131
[email protected]a3bb1a62011-01-14 19:47:56132// Utility method currently shared between install.cc and install_worker.cc
[email protected]f0260d22011-01-25 16:44:37133void AppendUninstallCommandLineFlags(const InstallerState& installer_state,
134 const Product& product,
135 CommandLine* uninstall_cmd);
[email protected]a3bb1a62011-01-14 19:47:56136
[email protected]fb3d0322011-02-03 01:07:35137// Refreshes the elevation policy on platforms where it is supported.
138void RefreshElevationPolicy();
139
[email protected]995708f2011-03-03 20:05:51140// 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.
147void 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]a3bb1a62011-01-14 19:47:56153} // namespace installer
154
155#endif // CHROME_INSTALLER_SETUP_INSTALL_WORKER_H_