Advertisement
Guest User

chromium\chrome\installer\util\util_constants.cc

a guest
Sep 10th, 2016
461
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 12.16 KB | None | 0 0
  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. // Install Chrome.
  12. // Currently this is only required when used in combination with kMultiInstall.
  13. const char kChrome[] = "chrome";
  14.  
  15. #ifndef OMIT_CHROME_FRAME
  16. // Install Chrome Frame.
  17. const char kChromeFrame[] = "chrome-frame";
  18. #endif
  19.  
  20. // Run the installer for Chrome SxS.
  21. const char kChromeSxS[] = "chrome-sxs";
  22.  
  23. // Create shortcuts for this user to point to a system-level install (which
  24. // must already be installed on the machine). The shortcuts created will
  25. // match the preferences of the already present system-level install as such
  26. // this option is not compatible with any other installer options.
  27. const char kConfigureUserSettings[] = "configure-user-settings";
  28.  
  29. // The version number of an update containing critical fixes, for which an
  30. // in-use Chrome should be restarted ASAP.
  31. const char kCriticalUpdateVersion[] = "critical-update-version";
  32.  
  33. // Delete user profile data. This param is useful only when specified with
  34. // kUninstall, otherwise it is silently ignored.
  35. const char kDeleteProfile[] = "delete-profile";
  36.  
  37. // Disable logging
  38. const char kDisableLogging[] = "disable-logging";
  39.  
  40. // Prevent installer from launching Chrome after a successful first install.
  41. const char kDoNotLaunchChrome[] = "do-not-launch-chrome";
  42.  
  43. // Prevents installer from writing the Google Update key that causes Google
  44. // Update to launch Chrome after a first install.
  45. const char kDoNotRegisterForUpdateLaunch[] =
  46.     "do-not-register-for-update-launch";
  47.  
  48. // By default we remove all shared (between users) files, registry entries etc
  49. // during uninstall. If this option is specified together with kUninstall option
  50. // we do not clean up shared entries otherwise this option is ignored.
  51. const char kDoNotRemoveSharedItems[] = "do-not-remove-shared-items";
  52.  
  53. // Enable logging at the error level. This is the default behavior.
  54. const char kEnableLogging[] = "enable-logging";
  55.  
  56. // Same as kConfigureUserSettings above; except the checks to know whether
  57. // first run already occured are bypassed and shortcuts are created either way
  58. // (kConfigureUserSettings also needs to be on the command-line for this to have
  59. // any effect).
  60. const char kForceConfigureUserSettings[] = "force-configure-user-settings";
  61.  
  62. // If present, setup will uninstall chrome without asking for any
  63. // confirmation from user.
  64. const char kForceUninstall[] = "force-uninstall";
  65.  
  66. // Specify the path to the compressed Chrome archive for install. If not
  67. // specified, chrome.packed.7z or chrome.7z in the same directory as setup.exe
  68. // is used (the packed file is preferred; see kUncompressedArchive to force use
  69. // of an uncompressed archive).
  70. const char kInstallArchive[] = "install-archive";
  71.  
  72. // Specify the file path of Chrome master preference file.
  73. const char kInstallerData[] = "installerdata";
  74.  
  75. // If present, specify file path to write logging info.
  76. const char kLogFile[] = "log-file";
  77.  
  78. // Register Chrome as default browser on the system. Usually this will require
  79. // that setup is running as admin. If running as admin we try to register
  80. // as default browser at system level, if running as non-admin we try to
  81. // register as default browser only for the current user.
  82. const char kMakeChromeDefault[] = "make-chrome-default";
  83.  
  84. // Tells installer to expect to be run as a subsidiary to an MSI.
  85. const char kMsi[] = "msi";
  86.  
  87. // Tells installer to install multiple products specified on the command line.
  88. // (e.g. Chrome Frame, Chrome)
  89. const char kMultiInstall[] = "multi-install";
  90.  
  91. // Useful only when used with --update-setup-exe, otherwise ignored. It
  92. // specifies the full path where updated setup.exe will be stored.
  93. const char kNewSetupExe[] = "new-setup-exe";
  94.  
  95. // Notify the installer that the OS has been upgraded.
  96. const char kOnOsUpgrade[] = "on-os-upgrade";
  97.  
  98. // Provide the previous version that patch is for.
  99. const char kPreviousVersion[] = "previous-version";
  100.  
  101. // Requests that setup attempt to reenable autoupdates for Chrome.
  102. const char kReenableAutoupdates[] = "reenable-autoupdates";
  103.  
  104. // Register Chrome as a valid browser on the current system. This option
  105. // requires that setup.exe is running as admin. If this option is specified,
  106. // options kInstallArchive and kUninstall are ignored.
  107. const char kRegisterChromeBrowser[] = "register-chrome-browser";
  108.  
  109. // Used by the installer to forward the registration suffix of the
  110. // (un)installation in progress when launching an elevated setup.exe to finish
  111. // registration work.
  112. const char kRegisterChromeBrowserSuffix[] = "register-chrome-browser-suffix";
  113.  
  114. // Specify the path to the dev build of chrome.exe the user wants to install
  115. // (register and install Start menu shortcut for) on the system. This will
  116. // always result in a user-level install and will make this install default
  117. // browser.
  118. const char kRegisterDevChrome[] = "register-dev-chrome";
  119.  
  120. // Switch to allow an extra URL protocol to be registered. This option is used
  121. // in conjunction with kRegisterChromeBrowser to specify an extra protocol
  122. // in addition to the standard set of protocols.
  123. const char kRegisterURLProtocol[] = "register-url-protocol";
  124.  
  125. // Renames chrome.exe to old_chrome.exe and renames new_chrome.exe to chrome.exe
  126. // to support in-use updates. Also deletes opv key.
  127. const char kRenameChromeExe[] = "rename-chrome-exe";
  128.  
  129. // Removes Chrome registration from current machine. Requires admin rights.
  130. const char kRemoveChromeRegistration[] = "remove-chrome-registration";
  131.  
  132. // When we try to relaunch setup.exe as admin on Vista, we append this command
  133. // line flag so that we try the launch only once.
  134. const char kRunAsAdmin[] = "run-as-admin";
  135.  
  136. // Combined with --uninstall, signals to setup.exe that this uninstall was
  137. // triggered by a self-destructing Chrome.
  138. const char kSelfDestruct[] = "self-destruct";
  139.  
  140. // Install Chrome to system wise location. The default is per user install.
  141. const char kSystemLevel[] = "system-level";
  142.  
  143. // Signals to setup.exe that it should trigger the active setup command.
  144. const char kTriggerActiveSetup[] = "trigger-active-setup";
  145.  
  146. // If present, setup will uninstall chrome.
  147. const char kUninstall[] = "uninstall";
  148.  
  149. // Also see --new-setup-exe. This command line option specifies a diff patch
  150. // that setup.exe will apply to itself and store the resulting binary in the
  151. // path given by --new-setup-exe.
  152. const char kUpdateSetupExe[] = "update-setup-exe";
  153.  
  154. // Use the given uncompressed chrome.7z archive as the source of files to
  155. // install.
  156. const char kUncompressedArchive[] = "uncompressed-archive";
  157.  
  158. // Enable verbose logging (info level).
  159. const char kVerboseLogging[] = "verbose-logging";
  160.  
  161. // Show the embedded EULA dialog.
  162. const char kShowEula[] = "show-eula";
  163.  
  164. // Show the embedded EULA dialog, relaunch metro Chrome on acceptance.
  165. const char kShowEulaForMetro[] = "show-eula-for-metro";
  166.  
  167. // Perform the inactive user toast experiment.
  168. const char kInactiveUserToast[] = "inactive-user-toast";
  169.  
  170. // User toast experiment switch from system context to user context.
  171. const char kSystemLevelToast[] = "system-level-toast";
  172.  
  173. // The group this experiment belongs to.
  174. const char kExperimentGroup[] = "experiment-group";
  175.  
  176. // A handle value of the key to write the results of the toast experiment
  177. // to. See DuplicateGoogleUpdateSystemClientKey for details.
  178. const char kToastResultsKey[] = "toast-results-key";
  179.  
  180. // Applies a binary patch to a file. The input, patch, and the output file are
  181. // specified as command line arguments following the --patch switch.
  182. // Ex: --patch=courgette --input_file='input' --patch_file='patch'
  183. //        --output_file='output'
  184. const char kPatch[] = "patch";
  185. const char kInputFile[] = "input-file";
  186. const char kPatchFile[] = "patch-file";
  187. const char kOutputFile[] = "output-file";
  188.  
  189. // Vivaldi customization.
  190. const char kVivaldi[] = "vivaldi";
  191. const char kVivaldiInstallDir[] = "vivaldi-install-dir";
  192. const char kVivaldiStandalone[] = "vivaldi-standalone";
  193. const char kVivaldiForceLaunch[] = "vivaldi-force-launch";
  194. const char kVivaldiUpdate[] = "vivaldi-update";
  195. const char kVivaldiRegisterStandalone[] = "vivaldi-register-standalone";
  196. const char kVivaldiSilent[] = "vivaldi-silent";
  197.  
  198. }  // namespace switches
  199.  
  200. namespace env_vars {
  201.  
  202. // The presence of this environment variable with a value of 1 implies that
  203. // setup.exe should run as a system installation regardless of what is on the
  204. // command line.
  205. const char kGoogleUpdateIsMachineEnvVar[] = "GoogleUpdateIsMachine";
  206.  
  207. }  // namespace env_vars
  208.  
  209. // The Active Setup executable will be an identical copy of setup.exe; this is
  210. // necessary because Windows' installer detection heuristics (which include
  211. // things like process name being "setup.exe") will otherwise force elevation
  212. // for non-admin users when setup.exe is launched. This is mitigated by adding
  213. // requestedExecutionLevel="asInvoker" to setup.exe's manifest on Vista+, but
  214. // there is no such manifest entry on Windows XP (which results in
  215. // crbug.com/166473).
  216. // TODO(gab): Rename setup.exe itself altogether and use the same binary for
  217. // Active Setup.
  218. const wchar_t kActiveSetupExe[] = L"chrmstp.exe";
  219. const wchar_t kAppLauncherGuid[] = L"{FDA71E6F-AC4C-4a00-8B70-9958A68906BF}";
  220. const wchar_t kChromeDll[] = L"vivaldi.dll";
  221. const wchar_t kChromeChildDll[] = L"vivaldi_child.dll";
  222. const wchar_t kChromeExe[] = L"vivaldi.exe";
  223. const wchar_t kChromeFrameDll[] = L"npchrome_frame.dll";
  224. const wchar_t kChromeFrameHelperDll[] = L"chrome_frame_helper.dll";
  225. const wchar_t kChromeFrameHelperExe[] = L"chrome_frame_helper.exe";
  226. const wchar_t kChromeFrameHelperWndClass[] = L"ChromeFrameHelperWindowClass";
  227. const wchar_t kChromeLauncherExe[] = L"chrome_launcher.exe";
  228. const wchar_t kChromeNewExe[] = L"new_vivaldi.exe";
  229. const wchar_t kChromeOldExe[] = L"old_vivaldi.exe";
  230. const wchar_t kCmdOnOsUpgrade[] = L"on-os-upgrade";
  231. const wchar_t kCmdQuickEnableCf[] = L"quick-enable-cf";
  232. const wchar_t kEULASentinelFile[] = L"EULA Accepted";
  233. const wchar_t kGoogleChromeInstallSubDir1[] = L"Google";
  234. const wchar_t kGoogleChromeInstallSubDir2[] = L"Chrome";
  235. const wchar_t kInstallBinaryDir[] = L"Application";
  236. const wchar_t kInstallerDir[] = L"Installer";
  237. const wchar_t kInstallTempDir[] = L"Temp";
  238. const wchar_t kLnkExt[] = L".lnk";
  239. const wchar_t kNaClExe[] = L"nacl64.exe";
  240. const wchar_t kSetupExe[] = L"setup.exe";
  241. const wchar_t kSxSSuffix[] = L" SxS";
  242. const wchar_t kUninstallStringField[] = L"UninstallString";
  243. const wchar_t kUninstallArgumentsField[] = L"UninstallArguments";
  244. const wchar_t kUninstallDisplayNameField[] = L"DisplayName";
  245. const char kUninstallMetricsName[] = "uninstall_metrics";
  246. const wchar_t kUninstallInstallationDate[] = L"installation_date";
  247. const wchar_t kInstallerError[] = L"InstallerError";
  248. const wchar_t kInstallerExtraCode1[] = L"InstallerExtraCode1";
  249. const wchar_t kInstallerResult[] = L"InstallerResult";
  250. const wchar_t kInstallerResultUIString[] = L"InstallerResultUIString";
  251. const wchar_t kInstallerSuccessLaunchCmdLine[] =
  252.     L"InstallerSuccessLaunchCmdLine";
  253.  
  254. const wchar_t kVivaldiKey[] = L"Software\\Vivaldi";
  255. const wchar_t kVivaldiPinToTaskbarValue[] = L"EnablePinToTaskbar";
  256.  
  257. // Vivaldi installer settings from last install.
  258. const wchar_t kVivaldiInstallerDestinationFolder[] = L"DestinationFolder";
  259. const wchar_t kVivaldiInstallerInstallType[] = L"InstallType";
  260. const wchar_t kVivaldiInstallerDefaultBrowser[] = L"DefaultBrowser";
  261. const wchar_t kVivaldiInstallerRegisterBrowser[] = L"RegisterBrowser";
  262.  
  263. const wchar_t kOptionMultiInstall[] = L"multi-install";
  264.  
  265. // Chrome channel display names.
  266. const wchar_t kChromeChannelUnknown[] = L"unknown";
  267. const wchar_t kChromeChannelCanary[] = L"canary";
  268. const wchar_t kChromeChannelDev[] = L"dev";
  269. const wchar_t kChromeChannelBeta[] = L"beta";
  270. const wchar_t kChromeChannelStable[] = L"";
  271. const wchar_t kChromeChannelStableExplicit[] = L"stable";
  272.  
  273. const size_t kMaxAppModelIdLength = 64U;
  274.  
  275. const char kCourgette[] = "courgette";
  276. const char kBsdiff[] = "bsdiff";
  277.  
  278. const char kSetupHistogramAllocatorName[] = "SetupMetrics";
  279.  
  280. }  // namespace installer
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement