blob: 596b367d377330b236df2362fba3f3f25505060c [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
16#include "base/scoped_ptr.h"
17
[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).
37void AddGoogleUpdateWorkItems(const InstallerState& installer_state,
38 WorkItemList* install_list);
39
[email protected]07ec3762011-02-07 18:00:0540// After a successful copying of all the files, this function is called to
41// do a few post install tasks:
42// - Handle the case of in-use-update by updating "opv" (old version) key or
43// deleting it if not required.
44// - Register any new dlls and unregister old dlls.
45// - If this is an MSI install, ensures that the MSI marker is set, and sets
46// it if not.
47// If these operations are successful, the function returns true, otherwise
48// false.
49bool AppendPostInstallTasks(const InstallerState& installer_state,
50 const FilePath& setup_path,
51 const FilePath& new_chrome_exe,
52 const Version* current_version,
53 const Version& new_version,
54 WorkItemList* post_install_task_list);
55
[email protected]a3bb1a62011-01-14 19:47:5656// Builds the complete WorkItemList used to build the set of installation steps
57// needed to lay down one or more installed products.
58//
59// setup_path: Path to the executable (setup.exe) as it will be copied
60// to Chrome install folder after install is complete
61// archive_path: Path to the archive (chrome.7z) as it will be copied
62// to Chrome install folder after install is complete
63// src_path: the path that contains a complete and unpacked Chrome package
64// to be installed.
65// temp_dir: the path of working directory used during installation. This path
66// does not need to exist.
67void AddInstallWorkItems(const InstallationState& original_state,
68 const InstallerState& installer_state,
[email protected]a3bb1a62011-01-14 19:47:5669 const FilePath& setup_path,
70 const FilePath& archive_path,
71 const FilePath& src_path,
72 const FilePath& temp_dir,
73 const Version& new_version,
74 scoped_ptr<Version>* current_version,
[email protected]a3bb1a62011-01-14 19:47:5675 WorkItemList* install_list);
76
77// Appends registration or unregistration work items to |work_item_list| for the
78// COM DLLs whose file names are given in |dll_files| and which reside in the
79// path |dll_folder|.
80// |system_level| specifies whether to call the system or user level DLL
81// registration entry points.
82// |do_register| says whether to register or unregister.
83// |may_fail| states whether this is best effort or not. If |may_fail| is true
84// then |work_item_list| will still succeed if the registration fails and
85// no registration rollback will be performed.
86void AddRegisterComDllWorkItems(const FilePath& dll_folder,
87 const std::vector<FilePath>& dll_files,
88 bool system_level,
89 bool do_register,
90 bool ignore_failures,
91 WorkItemList* work_item_list);
92
[email protected]f0260d22011-01-25 16:44:3793void AddSetMsiMarkerWorkItem(const InstallerState& installer_state,
94 BrowserDistribution* dist,
[email protected]a3bb1a62011-01-14 19:47:5695 bool set,
96 WorkItemList* work_item_list);
97
98// Called for either installation or uninstallation. This method updates the
99// registry according to Chrome Frame specific options for the current
100// installation. This includes handling of the ready-mode option.
[email protected]f0260d22011-01-25 16:44:37101void AddChromeFrameWorkItems(const InstallationState& original_state,
102 const InstallerState& installer_state,
103 const FilePath& setup_path,
104 const Version& new_version,
105 const Product& product,
[email protected]a3bb1a62011-01-14 19:47:56106 WorkItemList* list);
107
[email protected]a3bb1a62011-01-14 19:47:56108// This method adds work items to create (or update) Chrome uninstall entry in
109// either the Control Panel->Add/Remove Programs list or in the Omaha client
110// state key if running under an MSI installer.
[email protected]f0260d22011-01-25 16:44:37111void AddUninstallShortcutWorkItems(const InstallerState& installer_state,
112 const FilePath& setup_path,
[email protected]a3bb1a62011-01-14 19:47:56113 const Version& new_version,
114 WorkItemList* install_list,
115 const Product& product);
116
[email protected]07ec3762011-02-07 18:00:05117// Create Version key for a product (if not already present) and sets the new
118// product version as the last step.
119void AddVersionKeyWorkItems(HKEY root,
120 BrowserDistribution* dist,
121 const Version& new_version,
122 WorkItemList* list);
123
[email protected]fb3d0322011-02-03 01:07:35124// [Un]Registers Chrome and ChromeLauncher in IE's low rights elevation policy.
125void AddElevationPolicyWorkItems(const InstallationState& original_state,
126 const InstallerState& installer_state,
127 const Version& new_version,
128 WorkItemList* install_list);
129
[email protected]a3bb1a62011-01-14 19:47:56130// Utility method currently shared between install.cc and install_worker.cc
[email protected]f0260d22011-01-25 16:44:37131void AppendUninstallCommandLineFlags(const InstallerState& installer_state,
132 const Product& product,
133 CommandLine* uninstall_cmd);
[email protected]a3bb1a62011-01-14 19:47:56134
[email protected]fb3d0322011-02-03 01:07:35135// Refreshes the elevation policy on platforms where it is supported.
136void RefreshElevationPolicy();
137
[email protected]a3bb1a62011-01-14 19:47:56138} // namespace installer
139
140#endif // CHROME_INSTALLER_SETUP_INSTALL_WORKER_H_