- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / installer / util / util_constants.cc
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
7 namespace installer {
8
9 namespace switches {
10
11 // Whether to set Chrome to launch at computer startup.
12 const char kAutoLaunchChrome[] = "auto-launch-chrome";
13
14 // Install Chrome.
15 // Currently this is only required when used in combination with kMultiInstall.
16 const char kChrome[] = "chrome";
17
18 // Install Chrome App Host. This is now interpreted as kChromeAppLauncher.
19 // TODO(huangs): Remove by M27.
20 const 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.
25 const char kChromeAppLauncher[] = "app-launcher";
26
27 // Install Chrome Frame.
28 const char kChromeFrame[] = "chrome-frame";
29
30 // Installs Chrome Frame from an already installed multi-install of Chrome.
31 const 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.
35 const char kChromeFrameReadyMode[] = "ready-mode";
36
37 // GCF ready mode opt-in.  This enables a full installation of GCF.
38 const 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.
42 const 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.
46 const char kChromeFrameReadyModeEndTempOptOut[] = "ready-mode-end-temp-opt-out";
47
48 // Run the installer for Chrome SxS.
49 const 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.
55 const 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.
59 const 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.
63 const char kDeleteProfile[] = "delete-profile";
64
65 // Disable logging
66 const char kDisableLogging[] = "disable-logging";
67
68 // Prevent installer from launching Chrome after a successful first install.
69 const 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.
73 const 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.
79 const char kDoNotRemoveSharedItems[] = "do-not-remove-shared-items";
80
81 // Enable logging at the error level. This is the default behavior.
82 const char kEnableLogging[] = "enable-logging";
83
84 // Ensures that Google Update is present at the current level of installation.
85 const 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).
91 const char kForceConfigureUserSettings[] = "force-configure-user-settings";
92
93 // If present, setup will uninstall chrome without asking for any
94 // confirmation from user.
95 const 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).
101 const char kInstallArchive[] = "install-archive";
102
103 // Specify the file path of Chrome master preference file.
104 const char kInstallerData[] = "installerdata";
105
106 // If present, specify file path to write logging info.
107 const 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.
113 const char kMakeChromeDefault[] = "make-chrome-default";
114
115 // Migrate multi-install Chrome Frame to single-install. Use in conjunction with
116 // --uncompressed-archive.
117 const char kMigrateChromeFrame[] = "migrate-chrome-frame";
118
119 // Tells installer to expect to be run as a subsidiary to an MSI.
120 const char kMsi[] = "msi";
121
122 // Tells installer to install multiple products specified on the command line.
123 // (e.g. Chrome Frame, Chrome)
124 const 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.
128 const char kNewSetupExe[] = "new-setup-exe";
129
130 // Notify the installer that the OS has been upgraded.
131 const 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.
135 const 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.
140 const 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.
145 const 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.
151 const 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.
156 const 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.
160 const char kRenameChromeExe[] = "rename-chrome-exe";
161
162 // Removes Chrome registration from current machine. Requires admin rights.
163 const 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.
167 const 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.
171 const char kSelfDestruct[] = "self-destruct";
172
173 // Install Chrome to system wise location. The default is per user install.
174 const char kSystemLevel[] = "system-level";
175
176 // If present, setup will uninstall chrome.
177 const 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.
182 const char kUpdateSetupExe[] = "update-setup-exe";
183
184 // Use the given uncompressed chrome.7z archive as the source of files to
185 // install.
186 const char kUncompressedArchive[] = "uncompressed-archive";
187
188 // Enable verbose logging (info level).
189 const char kVerboseLogging[] = "verbose-logging";
190
191 // Show the embedded EULA dialog.
192 const char kShowEula[] = "show-eula";
193
194 // Show the embedded EULA dialog, relaunch metro Chrome on acceptance.
195 const char kShowEulaForMetro[] = "show-eula-for-metro";
196
197 // Perform the inactive user toast experiment.
198 const char kInactiveUserToast[] = "inactive-user-toast";
199
200 // User toast experiment switch from system context to user context.
201 const char kSystemLevelToast[] = "system-level-toast";
202
203 // The group this experiment belongs to.
204 const 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.
208 const 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'
214 const char kPatch[] = "patch";
215 const char kInputFile[] = "input-file";
216 const char kPatchFile[] = "patch-file";
217 const 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.
230 const wchar_t kActiveSetupExe[] = L"chrmstp.exe";
231 const wchar_t kChromeAppHostExe[] = L"app_host.exe";
232 const wchar_t kChromeDll[] = L"chrome.dll";
233 const wchar_t kChromeChildDll[] = L"chrome_child.dll";
234 const wchar_t kChromeExe[] = L"chrome.exe";
235 const wchar_t kChromeFrameDll[] = L"npchrome_frame.dll";
236 const wchar_t kChromeFrameHelperExe[] = L"chrome_frame_helper.exe";
237 const wchar_t kChromeFrameHelperWndClass[] = L"ChromeFrameHelperWindowClass";
238 const wchar_t kChromeFrameReadyModeField[] = L"ChromeFrameReadyMode";
239 const wchar_t kChromeLauncherExe[] = L"chrome_launcher.exe";
240 const wchar_t kChromeNewExe[] = L"new_chrome.exe";
241 const wchar_t kChromeOldExe[] = L"old_chrome.exe";
242 const wchar_t kCmdInstallApp[] = L"install-application";
243 const wchar_t kCmdInstallExtension[] = L"install-extension";
244 const wchar_t kCmdOnOsUpgrade[] = L"on-os-upgrade";
245 const wchar_t kCmdQueryEULAAcceptance[] = L"query-eula-acceptance";
246 const wchar_t kCmdQuickEnableApplicationHost[] =
247     L"quick-enable-application-host";
248 const wchar_t kCmdQuickEnableCf[] = L"quick-enable-cf";
249 const wchar_t kDelegateExecuteExe[] = L"delegate_execute.exe";
250 const wchar_t kEULASentinelFile[] = L"EULA Accepted";
251 const wchar_t kGoogleChromeInstallSubDir1[] = L"Google";
252 const wchar_t kGoogleChromeInstallSubDir2[] = L"Chrome";
253 const wchar_t kInstallBinaryDir[] = L"Application";
254 const wchar_t kInstallerDir[] = L"Installer";
255 const wchar_t kInstallTempDir[] = L"Temp";
256 const wchar_t kInstallUserDataDir[] = L"User Data";
257 const wchar_t kLnkExt[] = L".lnk";
258 const wchar_t kNaClExe[] = L"nacl64.exe";
259 const wchar_t kSetupExe[] = L"setup.exe";
260 const wchar_t kSxSSuffix[] = L" SxS";
261 const wchar_t kUninstallStringField[] = L"UninstallString";
262 const wchar_t kUninstallArgumentsField[] = L"UninstallArguments";
263 const wchar_t kUninstallDisplayNameField[] = L"DisplayName";
264 const char kUninstallMetricsName[] = "uninstall_metrics";
265 const wchar_t kUninstallInstallationDate[] = L"installation_date";
266 const wchar_t kInstallerError[] = L"InstallerError";
267 const wchar_t kInstallerExtraCode1[] = L"InstallerExtraCode1";
268 const wchar_t kInstallerResult[] = L"InstallerResult";
269 const wchar_t kInstallerResultUIString[] = L"InstallerResultUIString";
270 const wchar_t kInstallerSuccessLaunchCmdLine[] =
271     L"InstallerSuccessLaunchCmdLine";
272
273 const wchar_t kOptionMultiInstall[] = L"multi-install";
274 const wchar_t kOptionReadyMode[] = L"ready-mode";
275
276 // Chrome channel display names.
277 const wchar_t kChromeChannelUnknown[] = L"unknown";
278 const wchar_t kChromeChannelCanary[] = L"canary";
279 const wchar_t kChromeChannelDev[] = L"dev";
280 const wchar_t kChromeChannelBeta[] = L"beta";
281 const wchar_t kChromeChannelStable[] = L"";
282
283 const size_t kMaxAppModelIdLength = 64U;
284
285 const char kCourgette[] = "courgette";
286 const char kBsdiff[] = "bsdiff";
287
288 }  // namespace installer