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 specification of setup main functions. | 5 // This file contains the specification of setup main functions. |
6 | 6 |
7 #ifndef CHROME_INSTALLER_SETUP_INSTALL_H_ | 7 #ifndef CHROME_INSTALLER_SETUP_INSTALL_H_ |
8 #define CHROME_INSTALLER_SETUP_INSTALL_H_ | 8 #define CHROME_INSTALLER_SETUP_INSTALL_H_ |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/string16.h" | 12 #include "base/string16.h" |
13 #include "base/version.h" | 13 #include "base/version.h" |
14 #include "chrome/installer/util/installation_state.h" | 14 #include "chrome/installer/util/installation_state.h" |
15 #include "chrome/installer/util/installer_state.h" | 15 #include "chrome/installer/util/installer_state.h" |
16 #include "chrome/installer/util/master_preferences.h" | 16 #include "chrome/installer/util/master_preferences.h" |
17 #include "chrome/installer/util/product.h" | 17 #include "chrome/installer/util/product.h" |
18 #include "chrome/installer/util/util_constants.h" | 18 #include "chrome/installer/util/util_constants.h" |
19 | 19 |
20 class FilePath; | 20 class FilePath; |
21 | 21 |
22 namespace installer { | 22 namespace installer { |
23 | 23 |
24 class InstallationState; | 24 class InstallationState; |
25 class InstallerState; | 25 class InstallerState; |
26 class MasterPreferences; | 26 class MasterPreferences; |
27 | 27 |
| 28 enum InstallShortcutOperation { |
| 29 // Create mandatory shortcuts (Start menu, taskbar, and uninstall). |
| 30 INSTALL_SHORTCUT_CREATE_MANDATORY = 0, |
| 31 // Create mandatory shortcuts and desktop + quick launch shortcuts. |
| 32 INSTALL_SHORTCUT_CREATE_ALL, |
| 33 // Replace all shortcuts that still exist with the most recent version of |
| 34 // each individual shortcut. |
| 35 INSTALL_SHORTCUT_REPLACE_EXISTING, |
| 36 }; |
| 37 |
28 // Escape |att_value| as per the XML AttValue production | 38 // Escape |att_value| as per the XML AttValue production |
29 // (http://www.w3.org/TR/2008/REC-xml-20081126/#NT-AttValue) for a value in | 39 // (http://www.w3.org/TR/2008/REC-xml-20081126/#NT-AttValue) for a value in |
30 // single quotes. | 40 // single quotes. |
31 void EscapeXmlAttributeValueInSingleQuotes(string16* att_value); | 41 void EscapeXmlAttributeValueInSingleQuotes(string16* att_value); |
32 | 42 |
33 // Creates VisualElementsManifest.xml beside chrome.exe in |src_path| if | 43 // Creates VisualElementsManifest.xml beside chrome.exe in |src_path| if |
34 // |src_path|\VisualElements exists. | 44 // |src_path|\VisualElements exists. |
35 // Returns true unless the manifest is supposed to be created, but fails to be. | 45 // Returns true unless the manifest is supposed to be created, but fails to be. |
36 bool CreateVisualElementsManifest(const FilePath& src_path, | 46 bool CreateVisualElementsManifest(const FilePath& src_path, |
37 const Version& version); | 47 const Version& version); |
38 | 48 |
39 // This method, if SHORTCUT_CREATE_ALWAYS is specified in |options|, creates | 49 // Overwrites shortcuts (desktop, quick launch, start menu, and uninstall link) |
40 // Start Menu shortcuts for all users or only for the current user depending on | 50 // if they are present on the system. |
41 // whether it is a system wide install or a user-level install. It also pins | 51 // If |install_operation| is a creation command, appropriate shortcuts will be |
42 // the browser shortcut to the current user's taskbar. | 52 // created even if they don't exist. |
43 // If SHORTCUT_CREATE_ALWAYS is not specified in |options|: this method only | 53 // The uninstall link is only created if this is not an MSI install. |
44 // updates existing Start Menu shortcuts. | 54 // If creating the Start menu shortcut is successful, it is also pinned to the |
45 // |setup_exe|: The path to the setup.exe stored in <version_dir>\Installer | 55 // taskbar. |
46 // post-install. | 56 void CreateOrUpdateShortcuts(const InstallerState& installer_state, |
47 // |options|: bitfield for which the options come from | 57 const FilePath& setup_exe, |
48 // ShellUtil::ChromeShortcutOptions. | 58 const Product& product, |
49 void CreateOrUpdateStartMenuAndTaskbarShortcuts( | 59 InstallShortcutOperation install_operation, |
50 const InstallerState& installer_state, | 60 bool alternate_desktop_shortcut); |
51 const FilePath& setup_exe, | |
52 const Product& product, | |
53 uint32 options); | |
54 | |
55 // This method, if SHORTCUT_CREATE_ALWAYS is specified in |options|, creates | |
56 // Desktop and Quick Launch shortcuts for all users or only for the current user | |
57 // depending on whether it is a system wide install or a user-level install. | |
58 // If SHORTCUT_CREATE_ALWAYS is not specified in |options|: this method only | |
59 // updates existing shortcuts. | |
60 // |options|: bitfield for which the options come from | |
61 // ShellUtil::ChromeShortcutOptions. | |
62 // If SHORTCUT_ALTERNATE is specified in |options|, an alternate shortcut name | |
63 // is used for the Desktop shortcut. | |
64 void CreateOrUpdateDesktopAndQuickLaunchShortcuts( | |
65 const InstallerState& installer_state, | |
66 const Product& product, | |
67 uint32 options); | |
68 | 61 |
69 // Registers Chrome on this machine. | 62 // Registers Chrome on this machine. |
70 // If |make_chrome_default|, also attempts to make Chrome default (potentially | 63 // If |make_chrome_default|, also attempts to make Chrome default (potentially |
71 // popping a UAC if the user is not an admin and HKLM registrations are required | 64 // popping a UAC if the user is not an admin and HKLM registrations are required |
72 // to register Chrome's capabilities on this version of Windows (i.e. | 65 // to register Chrome's capabilities on this version of Windows (i.e. |
73 // pre-Win8)). | 66 // pre-Win8)). |
74 void RegisterChromeOnMachine(const InstallerState& installer_state, | 67 void RegisterChromeOnMachine(const InstallerState& installer_state, |
75 const Product& product, | 68 const Product& product, |
76 bool make_chrome_default); | 69 bool make_chrome_default); |
77 | 70 |
(...skipping 25 matching lines...) Expand all Loading... |
103 const Version& new_version); | 96 const Version& new_version); |
104 | 97 |
105 // Performs installation-related tasks following an OS upgrade. | 98 // Performs installation-related tasks following an OS upgrade. |
106 void HandleOsUpgradeForBrowser(const InstallerState& installer_state, | 99 void HandleOsUpgradeForBrowser(const InstallerState& installer_state, |
107 const Product& chrome, | 100 const Product& chrome, |
108 const FilePath& setup_exe); | 101 const FilePath& setup_exe); |
109 | 102 |
110 } // namespace installer | 103 } // namespace installer |
111 | 104 |
112 #endif // CHROME_INSTALLER_SETUP_INSTALL_H_ | 105 #endif // CHROME_INSTALLER_SETUP_INSTALL_H_ |
OLD | NEW |