File: util_constants.h

package info (click to toggle)
chromium 139.0.7258.127-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 6,122,068 kB
  • sloc: cpp: 35,100,771; ansic: 7,163,530; javascript: 4,103,002; python: 1,436,920; asm: 946,517; xml: 746,709; pascal: 187,653; perl: 88,691; sh: 88,436; objc: 79,953; sql: 51,488; cs: 44,583; fortran: 24,137; makefile: 22,147; tcl: 15,277; php: 13,980; yacc: 8,984; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (287 lines) | stat: -rw-r--r-- 14,134 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Defines all install related constants that need to be used by Chrome as
// well as Chrome Installer.

#ifndef CHROME_INSTALLER_UTIL_UTIL_CONSTANTS_H_
#define CHROME_INSTALLER_UTIL_UTIL_CONSTANTS_H_

#include <stddef.h>

#include "base/files/file_path.h"

namespace installer {

// Return status of installer. Values in this enum must not change. Always add
// to the end. When removing an unused value, retain the deprecated name and
// value in a comment for posterity's sake, but take the liberty of removing the
// old doc string.
// The values in this enum must be kept in sync with the SetupInstallResult enum
// in enums.xml
enum InstallStatus {
  FIRST_INSTALL_SUCCESS = 0,      // First install of Chrome succeeded.
  INSTALL_REPAIRED = 1,           // Same version reinstalled for repair.
  NEW_VERSION_UPDATED = 2,        // Chrome successfully updated to new version.
  EXISTING_VERSION_LAUNCHED = 3,  // No work done; launched existing Chrome.
  HIGHER_VERSION_EXISTS = 4,      // Higher version of Chrome already exists
  USER_LEVEL_INSTALL_EXISTS = 5,  // User level install already exists.
  SYSTEM_LEVEL_INSTALL_EXISTS = 6,  // Machine level install already exists.
  INSTALL_FAILED = 7,               // Install/update failed.
  SETUP_PATCH_FAILED = 8,           // Failed to patch setup.exe.
  OS_NOT_SUPPORTED = 9,             // Current OS not supported.
  OS_ERROR = 10,                    // OS API call failed.
  TEMP_DIR_FAILED = 11,             // Unable to get Temp directory.
  UNCOMPRESSION_FAILED = 12,        // Failed to uncompress Chrome archive.
  INVALID_ARCHIVE = 13,       // Something wrong with the installer archive.
  INSUFFICIENT_RIGHTS = 14,   // User trying system level install is not Admin.
  CHROME_NOT_INSTALLED = 15,  // Chrome not installed (returned in case of
                              // uninstall).
  CHROME_RUNNING = 16,        // Chrome currently running (when trying to
                              // uninstall).
  UNINSTALL_CONFIRMED = 17,   // User has confirmed Chrome uninstall.
  UNINSTALL_DELETE_PROFILE = 18,  // User okayed uninstall and profile deletion.
  UNINSTALL_SUCCESSFUL = 19,      // Chrome successfully uninstalled.
  UNINSTALL_FAILED = 20,          // Chrome uninstallation failed.
  UNINSTALL_CANCELLED = 21,       // User cancelled Chrome uninstallation.
  UNKNOWN_STATUS = 22,            // Unknown status (this should never happen).
  RENAME_SUCCESSFUL = 23,     // Rename of new_chrome.exe to chrome.exe worked.
  RENAME_FAILED = 24,         // Rename of new_chrome.exe failed.
  EULA_REJECTED = 25,         // EULA dialog was not accepted by user.
  EULA_ACCEPTED = 26,         // EULA dialog was accepted by user.
  EULA_ACCEPTED_OPT_IN = 27,  // EULA accepted with the crash option selected.
  INSTALL_DIR_IN_USE = 28,    // Installation directory is in use by another
                              // process
  UNINSTALL_REQUIRES_REBOOT = 29,  // Uninstallation required a reboot.
  IN_USE_UPDATED = 30,  // Chrome successfully updated but old version
                        // running.
  SAME_VERSION_REPAIR_FAILED = 31,  // Chrome repair failed as Chrome was
                                    // running.
  REENTRY_SYS_UPDATE = 32,  // Setup has been re-launched as the interactive
                            // user.
  SXS_OPTION_NOT_SUPPORTED = 33,  // The chrome-sxs option provided does not
                                  // work with other command line options.
  // NON_MULTI_INSTALLATION_EXISTS = 34,
  // MULTI_INSTALLATION_EXISTS = 35,
  // READY_MODE_OPT_IN_FAILED = 36,
  // READY_MODE_TEMP_OPT_OUT_FAILED = 37,
  // READY_MODE_END_TEMP_OPT_OUT_FAILED = 38,
  // CONFLICTING_CHANNEL_EXISTS = 39,
  // READY_MODE_REQUIRES_CHROME = 40,
  // APP_HOST_REQUIRES_MULTI_INSTALL = 41,
  APPLY_DIFF_PATCH_FAILED = 42,  // Failed to apply a diff patch.
  // INCONSISTENT_UPDATE_POLICY = 43,
  // APP_HOST_REQUIRES_USER_LEVEL = 44,
  // APP_HOST_REQUIRES_BINARIES = 45,
  // INSTALL_OF_GOOGLE_UPDATE_FAILED = 46,
  INVALID_STATE_FOR_OPTION = 47,  // A non-install option was called with an
                                  // invalid installer state.
  // WAIT_FOR_EXISTING_FAILED = 48,
  PATCH_INVALID_ARGUMENTS = 49,    // The arguments of --patch were missing or
                                   // they were invalid for any reason.
  DIFF_PATCH_SOURCE_MISSING = 50,  // No previous version archive found for
                                   // differential update.
  // UNUSED_BINARIES = 51,
  // UNUSED_BINARIES_UNINSTALLED = 52,
  UNSUPPORTED_OPTION = 53,          // An unsupported legacy option was given.
  CPU_NOT_SUPPORTED = 54,           // Current OS not supported
  REENABLE_UPDATES_SUCCEEDED = 55,  // Autoupdates are now enabled.
  REENABLE_UPDATES_FAILED = 56,     // Autoupdates could not be enabled.
  UNPACKING_FAILED = 57,       // Unpacking the (possibly patched) uncompressed
                               // archive failed.
  IN_USE_DOWNGRADE = 58,       // Successfully downgrade chrome but current
                               // version is still running.
  OLD_VERSION_DOWNGRADE = 59,  // Successfully downgrade chrome to an older
                               // version.
  SETUP_SINGLETON_ACQUISITION_FAILED = 60,  // The setup process could not
                                            // acquire the exclusive right to
                                            // modify the Chrome installation.
  SETUP_SINGLETON_RELEASED = 61,            // The task did not complete because
                                            // another process asked this
                                            // process to release the exclusive
                                            // right to modify the Chrome
                                            // installation.
  DELETE_OLD_VERSIONS_SUCCESS = 62,         // All files that belong to old
                                            // versions of Chrome were
                                            // successfully deleted.
  DELETE_OLD_VERSIONS_TOO_MANY_ATTEMPTS = 63,  // A --delete-old-versions
                                               // process exited after trying to
                                               // delete all files that belong
                                               // to old versions of Chrome too
                                               // many times without success.
  STORE_DMTOKEN_FAILED = 64,   // Failed to write the specified DMToken to the
                               // registry.
  STORE_DMTOKEN_SUCCESS = 65,  // Writing the specified DMToken to the registry
                               // succeeded.
  DOWNGRADE_CLEANUP_FAILED = 66,
  DOWNGRADE_CLEANUP_SUCCESS = 67,
  UNDO_DOWNGRADE_CLEANUP_FAILED = 68,
  UNDO_DOWNGRADE_CLEANUP_SUCCESS = 69,
  DOWNGRADE_CLEANUP_UNKNOWN_OPERATION = 70,
  ROTATE_DTKEY_FAILED = 71,   // Failed to rotate device trust signing key.
  ROTATE_DTKEY_SUCCESS = 72,  // Successfully rotated device trust signing key.
  CREATE_SHORTCUTS_SUCCESS = 73,  // Successfully created Chrome shortcuts.
  DELETE_DMTOKEN_FAILED = 74,     // Failed to delete DMToken from the registry.
  DELETE_DMTOKEN_SUCCESS = 75,    // Successfully deleted DMToken from the
                                  // registry.
  ROTATE_DTKEY_FAILED_PERMISSIONS = 76,  // Failed to rotate the device trust
                                         // key due to missing permissions.
  ROTATE_DTKEY_FAILED_CONFLICT = 77,  // Failed to rotate the device trust key
                                      // due to a conflict during upload.
  CONFIGURE_APP_CONTAINER_SANDBOX_SUCCESS = 78,
  CONFIGURE_APP_CONTAINER_SANDBOX_FAILED = 79,
  MAX_INSTALL_STATUS = 80,  // When adding a new result, bump this and update
                            // the SetupInstallResult enum in enums.xml.
};

// The type of an update archive.
enum ArchiveType {
  UNKNOWN_ARCHIVE_TYPE,     // Unknown or uninitialized.
  FULL_ARCHIVE_TYPE,        // Full chrome.7z archive.
  INCREMENTAL_ARCHIVE_TYPE  // Incremental or differential archive.
};

// Stages of an installation from which a progress indication is derived.
// Generally listed in the order in which they are reached. The exceptions to
// this are the fork-and-join for diff vs. full installers (where there are
// additional (costly) stages for the former) and rollback in case of error.
enum InstallerStage {
  NO_STAGE,                  // No stage to report.
  UPDATING_SETUP,            // Patching setup.exe with differential update.
  PRECONDITIONS,             // Evaluating pre-install conditions.
  UNCOMPRESSING,             // Uncompressing chrome.packed.7z.
  PATCHING,                  // Patching chrome.7z with differential update.
  UNPACKING,                 // Unpacking chrome.7z.
  CREATING_VISUAL_MANIFEST,  // Creating VisualElementsManifest.xml.
  BUILDING,                  // Building the install work item list.
  EXECUTING,                 // Executing the install work item list.
  COPYING_PREFERENCES_FILE,  // Copying preferences file.
  CREATING_SHORTCUTS,        // Creating shortcuts.
  REGISTERING_CHROME,        // Performing Chrome registration.
  REMOVING_OLD_VERSIONS,     // Deleting old version directories.
  ROLLINGBACK,               // Rolling-back the install work item list.
  FINISHING,                 // Finishing the install.
  NUM_STAGES                 // The number of stages.
};

namespace switches {

extern const char kAllowDowngrade[];
extern const char kChannel[];
extern const char kConfigureUserSettings[];
extern const char kCreateShortcuts[];
extern const char kCriticalUpdateVersion[];
extern const char kDeleteDMToken[];
extern const char kDeleteOldVersions[];
extern const char kDeleteProfile[];
extern const char kDisableLogging[];
inline constexpr char kDisableSystemTracing[] = "disable-system-tracing";
extern const char kDmServerUrl[];
extern const char kDoNotLaunchChrome[];
extern const char kDoNotRegisterForUpdateLaunch[];
extern const char kDoNotRemoveSharedItems[];
extern const char kEnableLogging[];
inline constexpr char kEnableSystemTracing[] = "enable-system-tracing";
extern const char kForceConfigureUserSettings[];
extern const char kForceUninstall[];
extern const char kInstallArchive[];
extern const char kInstallerData[];
extern const char kInstallLevel[];
extern const char kLogFile[];
extern const char kMakeChromeDefault[];
extern const char kMsi[];
extern const char kNewSetupExe[];
extern const char kNonce[];
extern const char kOnOsUpgrade[];
extern const char kPreviousVersion[];
extern const char kReenableAutoupdates[];
extern const char kRegisterChromeBrowser[];
extern const char kRegisterChromeBrowserSuffix[];
extern const char kRegisterDevChrome[];
extern const char kRegisterURLProtocol[];
extern const char kRemoveChromeRegistration[];
extern const char kRenameChromeExe[];
extern const char kRotateDeviceTrustKey[];
extern const char kRunAsAdmin[];
extern const char kSelfDestruct[];
extern const char kShowEula[];
extern const char kStoreDMToken[];
extern const char kSystemLevel[];
extern const char kTriggerActiveSetup[];
extern const char kUncompressedArchive[];
extern const char kUninstall[];
extern const char kUpdateSetupExe[];
extern const char kVerboseLogging[];

}  // namespace switches

namespace env_vars {

// The presence of this environment variable with a value of 1 implies that
// setup.exe should run as a system installation regardless of what is on the
// command line.
inline constexpr char kGoogleUpdateIsMachineEnvVar[] = "GoogleUpdateIsMachine";

}  // namespace env_vars

extern const wchar_t kActiveSetupExe[];
extern const wchar_t kChromeDll[];
extern const wchar_t kChromeExe[];
extern const wchar_t kChromeNewExe[];
extern const wchar_t kChromeOldExe[];
extern const wchar_t kChromeProxyExe[];
extern const wchar_t kChromeProxyNewExe[];
extern const wchar_t kChromeProxyOldExe[];
extern const wchar_t kCmdAlternateRenameChromeExe[];
extern const wchar_t kCmdRenameChromeExe[];
extern const wchar_t kCmdOnOsUpgrade[];
extern const wchar_t kCmdRotateDeviceTrustKey[];
extern const wchar_t kCmdStoreDMToken[];
extern const wchar_t kCmdDeleteDMToken[];
extern const wchar_t kCmdInstallPEH[];
extern const wchar_t kEulaSentinelFile[];
extern const wchar_t kInstallBinaryDir[];
extern const wchar_t kInstallerDir[];
extern const wchar_t kInstallTempDir[];
extern const wchar_t kLnkExt[];
extern const wchar_t kNotificationHelperExe[];
extern const wchar_t kRegDowngradeVersion[];
extern const wchar_t kSetupExe[];
extern const wchar_t kUninstallArgumentsField[];
extern const wchar_t kUninstallDisplayNameField[];
extern const wchar_t kUninstallInstallationDate[];
extern const wchar_t kUninstallStringField[];
extern const wchar_t kWerDll[];

// Elevation Service constants.
extern const base::FilePath::CharType kElevationServiceExe[];

// Google Update installer result API.
extern const wchar_t kInstallerError[];
extern const wchar_t kInstallerExtraCode1[];
extern const wchar_t kInstallerResult[];
extern const wchar_t kInstallerResultUIString[];
extern const wchar_t kInstallerSuccessLaunchCmdLine[];

// Chrome channel display names.
// NOTE: Canary is not strictly a 'channel', but rather a separate product
//     installed side-by-side. However, GoogleUpdateSettings::GetChromeChannel
//     will return "canary" for that product.
extern const wchar_t kChromeChannelUnknown[];
extern const wchar_t kChromeChannelCanary[];
extern const wchar_t kChromeChannelDev[];
extern const wchar_t kChromeChannelBeta[];
extern const wchar_t kChromeChannelStable[];
extern const wchar_t kChromeChannelStableExplicit[];

extern const size_t kMaxAppModelIdLength;
enum : size_t { kMaxDMTokenLength = 4096 };

// Name of the allocator (and associated file) for storing histograms to be
// reported by Chrome during its next upload.
extern const char kSetupHistogramAllocatorName[];

}  // namespace installer

#endif  // CHROME_INSTALLER_UTIL_UTIL_CONSTANTS_H_