util_constants.cc revision 558790d6acca3451cf3a6b497803a5f07d0bec58
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
3// found in the LICENSE file.
4
5#include "chrome/installer/util/util_constants.h"
6
7namespace installer {
8
9namespace switches {
10
11// Whether to set Chrome to launch at computer startup.
12const char kAutoLaunchChrome[] = "auto-launch-chrome";
13
14// Install Chrome.
15// Currently this is only required when used in combination with kMultiInstall.
16const char kChrome[] = "chrome";
17
18// Install Chrome App Host. This is now interpreted as kChromeAppLauncher.
19// TODO(huangs): Remove by M27.
20const char kChromeAppHostDeprecated[] = "app-host";
21
22// Install Chrome App Launcher, which subsumes Chrome App Host, i.e.,
23// App Launcher install converts App Host to App Launcher, and all subsequent
24// App Host updates/uninstalls become App Launcher updates/uninstalls.
25const char kChromeAppLauncher[] = "app-launcher";
26
27// Install Chrome Frame.
28const char kChromeFrame[] = "chrome-frame";
29
30// Installs Chrome Frame from an already installed multi-install of Chrome.
31const char kChromeFrameQuickEnable[] = "quick-enable-cf";
32
33// When installing Chrome Frame, install it in ready mode.
34// If --chrome-frame is not on the command line, this switch has no effect.
35const char kChromeFrameReadyMode[] = "ready-mode";
36
37// GCF ready mode opt-in.  This enables a full installation of GCF.
38const char kChromeFrameReadyModeOptIn[] = "ready-mode-opt-in";
39
40// GCF ready mode temp opt-out.  This disables the GCF user agent modification
41// and detection of headers/meta tags.
42const char kChromeFrameReadyModeTempOptOut[] = "ready-mode-temp-opt-out";
43
44// End GCF ready mode temp opt-out.  This re-enables the GCF user agent
45// modification and detection of headers/meta tags.
46const char kChromeFrameReadyModeEndTempOptOut[] = "ready-mode-end-temp-opt-out";
47
48// Run the installer for Chrome SxS.
49const char kChromeSxS[] = "chrome-sxs";
50
51// Create shortcuts for this user to point to a system-level install (which
52// must already be installed on the machine). The shortcuts created will
53// match the preferences of the already present system-level install as such
54// this option is not compatible with any other installer options.
55const char kConfigureUserSettings[] = "configure-user-settings";
56
57// The version number of an update containing critical fixes, for which an
58// in-use Chrome should be restarted ASAP.
59const char kCriticalUpdateVersion[] = "critical-update-version";
60
61// Delete user profile data. This param is useful only when specified with
62// kUninstall, otherwise it is silently ignored.
63const char kDeleteProfile[] = "delete-profile";
64
65// Disable logging
66const char kDisableLogging[] = "disable-logging";
67
68// Prevent installer from launching Chrome after a successful first install.
69const char kDoNotLaunchChrome[] = "do-not-launch-chrome";
70
71// Prevents installer from writing the Google Update key that causes Google
72// Update to launch Chrome after a first install.
73const char kDoNotRegisterForUpdateLaunch[] =
74    "do-not-register-for-update-launch";
75
76// By default we remove all shared (between users) files, registry entries etc
77// during uninstall. If this option is specified together with kUninstall option
78// we do not clean up shared entries otherwise this option is ignored.
79const char kDoNotRemoveSharedItems[] = "do-not-remove-shared-items";
80
81// Enable logging at the error level. This is the default behavior.
82const char kEnableLogging[] = "enable-logging";
83
84// Ensures that Google Update is present at the current level of installation.
85const char kEnsureGoogleUpdatePresent[] = "ensure-google-update-present";
86
87// Same as kConfigureUserSettings above; except the checks to know whether
88// first run already occured are bypassed and shortcuts are created either way
89// (kConfigureUserSettings also needs to be on the command-line for this to have
90// any effect).
91const char kForceConfigureUserSettings[] = "force-configure-user-settings";
92
93// If present, setup will uninstall chrome without asking for any
94// confirmation from user.
95const char kForceUninstall[] = "force-uninstall";
96
97// Specify the path to the compressed Chrome archive for install. If not
98// specified, chrome.packed.7z or chrome.7z in the same directory as setup.exe
99// is used (the packed file is preferred; see kUncompressedArchive to force use
100// of an uncompressed archive).
101const char kInstallArchive[] = "install-archive";
102
103// Specify the file path of Chrome master preference file.
104const char kInstallerData[] = "installerdata";
105
106// If present, specify file path to write logging info.
107const char kLogFile[] = "log-file";
108
109// Register Chrome as default browser on the system. Usually this will require
110// that setup is running as admin. If running as admin we try to register
111// as default browser at system level, if running as non-admin we try to
112// register as default browser only for the current user.
113const char kMakeChromeDefault[] = "make-chrome-default";
114
115// Migrate multi-install Chrome Frame to single-install. Use in conjunction with
116// --uncompressed-archive.
117const char kMigrateChromeFrame[] = "migrate-chrome-frame";
118
119// Tells installer to expect to be run as a subsidiary to an MSI.
120const char kMsi[] = "msi";
121
122// Tells installer to install multiple products specified on the command line.
123// (e.g. Chrome Frame, Chrome)
124const char kMultiInstall[] = "multi-install";
125
126// Useful only when used with --update-setup-exe, otherwise ignored. It
127// specifies the full path where updated setup.exe will be stored.
128const char kNewSetupExe[] = "new-setup-exe";
129
130// Notify the installer that the OS has been upgraded.
131const char kOnOsUpgrade[] = "on-os-upgrade";
132
133// Determines whether or not EULA has been accepted at some point. Returns via
134// exit code: 0 if EULA not accepted, 1 if EULA accepted, and E_FAIL on error.
135const char kQueryEULAAcceptance[] = "query-eula-acceptance";
136
137// Register Chrome as a valid browser on the current sytem. This option
138// requires that setup.exe is running as admin. If this option is specified,
139// options kInstallArchive and kUninstall are ignored.
140const char kRegisterChromeBrowser[] = "register-chrome-browser";
141
142// Used by the installer to forward the registration suffix of the
143// (un)installation in progress when launching an elevated setup.exe to finish
144// registration work.
145const char kRegisterChromeBrowserSuffix[] = "register-chrome-browser-suffix";
146
147// Specify the path to the dev build of chrome.exe the user wants to install
148// (register and install Start menu shortcut for) on the system. This will
149// always result in a user-level install and will make this install default
150// browser.
151const char kRegisterDevChrome[] = "register-dev-chrome";
152
153// Switch to allow an extra URL protocol to be registered. This option is used
154// in conjunction with kRegisterChromeBrowser to specify an extra protocol
155// in addition to the standard set of protocols.
156const char kRegisterURLProtocol[] = "register-url-protocol";
157
158// Renames chrome.exe to old_chrome.exe and renames new_chrome.exe to chrome.exe
159// to support in-use updates. Also deletes opv key.
160const char kRenameChromeExe[] = "rename-chrome-exe";
161
162// Removes Chrome registration from current machine. Requires admin rights.
163const char kRemoveChromeRegistration[] = "remove-chrome-registration";
164
165// When we try to relaunch setup.exe as admin on Vista, we append this command
166// line flag so that we try the launch only once.
167const char kRunAsAdmin[] = "run-as-admin";
168
169// Combined with --uninstall, signals to setup.exe that this uninstall was
170// triggered by a self-destructing Chrome.
171const char kSelfDestruct[] = "self-destruct";
172
173// Install Chrome to system wise location. The default is per user install.
174const char kSystemLevel[] = "system-level";
175
176// If present, setup will uninstall chrome.
177const char kUninstall[] = "uninstall";
178
179// Also see --new-setup-exe. This command line option specifies a diff patch
180// that setup.exe will apply to itself and store the resulting binary in the
181// path given by --new-setup-exe.
182const char kUpdateSetupExe[] = "update-setup-exe";
183
184// Use the given uncompressed chrome.7z archive as the source of files to
185// install.
186const char kUncompressedArchive[] = "uncompressed-archive";
187
188// Enable verbose logging (info level).
189const char kVerboseLogging[] = "verbose-logging";
190
191// Show the embedded EULA dialog.
192const char kShowEula[] = "show-eula";
193
194// Show the embedded EULA dialog, relaunch metro Chrome on acceptance.
195const char kShowEulaForMetro[] = "show-eula-for-metro";
196
197// Perform the inactive user toast experiment.
198const char kInactiveUserToast[] = "inactive-user-toast";
199
200// User toast experiment switch from system context to user context.
201const char kSystemLevelToast[] = "system-level-toast";
202
203// The group this experiment belongs to.
204const char kExperimentGroup[] = "experiment-group";
205
206// A handle value of the key to write the results of the toast experiment
207// to. See DuplicateGoogleUpdateSystemClientKey for details.
208const char kToastResultsKey[] = "toast-results-key";
209
210// Applies a binary patch to a file. The input, patch, and the output file are
211// specified as command line arguments following the --patch switch.
212// Ex: --patch=courgette --input_file='input' --patch_file='patch'
213//        --output_file='output'
214const char kPatch[] = "patch";
215const char kInputFile[] = "input-file";
216const char kPatchFile[] = "patch-file";
217const char kOutputFile[] = "output-file";
218
219}  // namespace switches
220
221// The Active Setup executable will be an identical copy of setup.exe; this is
222// necessary because Windows' installer detection heuristics (which include
223// things like process name being "setup.exe") will otherwise force elevation
224// for non-admin users when setup.exe is launched. This is mitigated by adding
225// requestedExecutionLevel="asInvoker" to setup.exe's manifest on Vista+, but
226// there is no such manifest entry on Windows XP (which results in
227// crbug.com/166473).
228// TODO(gab): Rename setup.exe itself altogether and use the same binary for
229// Active Setup.
230const wchar_t kActiveSetupExe[] = L"chrmstp.exe";
231const wchar_t kChromeAppHostExe[] = L"app_host.exe";
232const wchar_t kChromeDll[] = L"chrome.dll";
233const wchar_t kChromeChildDll[] = L"chrome_child.dll";
234const wchar_t kChromeExe[] = L"chrome.exe";
235const wchar_t kChromeFrameDll[] = L"npchrome_frame.dll";
236const wchar_t kChromeFrameHelperExe[] = L"chrome_frame_helper.exe";
237const wchar_t kChromeFrameHelperWndClass[] = L"ChromeFrameHelperWindowClass";
238const wchar_t kChromeFrameReadyModeField[] = L"ChromeFrameReadyMode";
239const wchar_t kChromeLauncherExe[] = L"chrome_launcher.exe";
240const wchar_t kChromeNewExe[] = L"new_chrome.exe";
241const wchar_t kChromeOldExe[] = L"old_chrome.exe";
242const wchar_t kCmdInstallApp[] = L"install-application";
243const wchar_t kCmdInstallExtension[] = L"install-extension";
244const wchar_t kCmdOnOsUpgrade[] = L"on-os-upgrade";
245const wchar_t kCmdQueryEULAAcceptance[] = L"query-eula-acceptance";
246const wchar_t kCmdQuickEnableApplicationHost[] =
247    L"quick-enable-application-host";
248const wchar_t kCmdQuickEnableCf[] = L"quick-enable-cf";
249const wchar_t kDelegateExecuteExe[] = L"delegate_execute.exe";
250const wchar_t kEULASentinelFile[] = L"EULA Accepted";
251const wchar_t kGoogleChromeInstallSubDir1[] = L"Google";
252const wchar_t kGoogleChromeInstallSubDir2[] = L"Chrome";
253const wchar_t kInstallBinaryDir[] = L"Application";
254const wchar_t kInstallerDir[] = L"Installer";
255const wchar_t kInstallTempDir[] = L"Temp";
256const wchar_t kInstallUserDataDir[] = L"User Data";
257const wchar_t kLnkExt[] = L".lnk";
258const wchar_t kNaClExe[] = L"nacl64.exe";
259const wchar_t kSetupExe[] = L"setup.exe";
260const wchar_t kSxSSuffix[] = L" SxS";
261const wchar_t kUninstallStringField[] = L"UninstallString";
262const wchar_t kUninstallArgumentsField[] = L"UninstallArguments";
263const wchar_t kUninstallDisplayNameField[] = L"DisplayName";
264const char kUninstallMetricsName[] = "uninstall_metrics";
265const wchar_t kUninstallInstallationDate[] = L"installation_date";
266const wchar_t kInstallerError[] = L"InstallerError";
267const wchar_t kInstallerExtraCode1[] = L"InstallerExtraCode1";
268const wchar_t kInstallerResult[] = L"InstallerResult";
269const wchar_t kInstallerResultUIString[] = L"InstallerResultUIString";
270const wchar_t kInstallerSuccessLaunchCmdLine[] =
271    L"InstallerSuccessLaunchCmdLine";
272
273const wchar_t kOptionMultiInstall[] = L"multi-install";
274const wchar_t kOptionReadyMode[] = L"ready-mode";
275
276// Chrome channel display names.
277const wchar_t kChromeChannelUnknown[] = L"unknown";
278const wchar_t kChromeChannelCanary[] = L"canary";
279const wchar_t kChromeChannelDev[] = L"dev";
280const wchar_t kChromeChannelBeta[] = L"beta";
281const wchar_t kChromeChannelStable[] = L"";
282
283const size_t kMaxAppModelIdLength = 64U;
284
285const char kCourgette[] = "courgette";
286const char kBsdiff[] = "bsdiff";
287
288}  // namespace installer
289