install_constants.h 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. // Copyright 2016 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. // Defines the struct used to describe each of a brand's install modes; see
  5. // install_modes.h for details. For brands that integrate with Google Update,
  6. // each mode also describes a strategy for determining its update channel.
  7. #ifndef CHROME_INSTALL_STATIC_INSTALL_CONSTANTS_H_
  8. #define CHROME_INSTALL_STATIC_INSTALL_CONSTANTS_H_
  9. #include <stdint.h>
  10. #include <windows.h>
  11. #include "chrome/install_static/buildflags.h"
  12. namespace install_static {
  13. // Identifies different strategies for determining an update channel.
  14. enum class ChannelStrategy {
  15. #if BUILDFLAG(USE_GOOGLE_UPDATE_INTEGRATION)
  16. // The default update channel may be overridden by an explicit value. The
  17. // installer gets this value on the command line (--channel=name), whereas the
  18. // browser gets this value from the Windows registry. This is used by Google
  19. // Chrome's primary install mode to differentiate the extended stable, beta,
  20. // and dev channels from the default (stable) channel.
  21. FLOATING,
  22. // Update channel is a fixed value. This is used by to pin Google Chrome's
  23. // secondary install modes to their respective channels (e.g., the SxS mode
  24. // follows the canary channel).
  25. FIXED,
  26. #else // BUILDFLAG(USE_GOOGLE_UPDATE_INTEGRATION)
  27. // Update channels are not supported. This value is for exclusive use by
  28. // brands that do not integrate with Google Update.
  29. UNSUPPORTED,
  30. #endif // BUILDFLAG(USE_GOOGLE_UPDATE_INTEGRATION)
  31. };
  32. // A POD-struct defining constants for a brand's install mode. A brand has one
  33. // primary and one or more secondary install modes. Refer to kInstallModes in
  34. // chromium_install_modes.cc and google_chrome_install_modes.cc for examples of
  35. // typical mode definitions.
  36. struct InstallConstants {
  37. // The size (in bytes) of this structure. This serves to verify that all
  38. // modules in a process have the same definition of the struct.
  39. size_t size;
  40. // The brand-specific index/identifier of this instance (defined in a brand's
  41. // BRAND_install_modes.h file). Index 0 is reserved for a brand's primary
  42. // install mode.
  43. int index;
  44. // The command-line switch originally passed to the installer to select this
  45. // install mode.
  46. const char* install_switch;
  47. // The install suffix of a secondary mode (e.g., " SxS" for canary Chrome) or
  48. // an empty string for the primary mode. This suffix is appended to file and
  49. // registry paths used by the product.
  50. const wchar_t* install_suffix;
  51. // The suffix for the logos corresponding to this install mode. The
  52. // VisualElementsManifest generated by the installer will use this suffix to
  53. // reference the proper logos so that they appear in the Start Menu.
  54. const wchar_t* logo_suffix;
  55. // The app guid with which this mode is registered with Google Update, or an
  56. // empty string if the brand does not integrate with Google Update.
  57. const wchar_t* app_guid;
  58. // The unsuffixed application name of this program. This is the base of the
  59. // name registered with Default Programs on Windows.
  60. const wchar_t* base_app_name;
  61. // Used for the following:
  62. // * The unsuffixed portion of the AppUserModelId. The AppUserModelId is used
  63. // to group an app's windows together on the Windows taskbar along with its
  64. // corresponding shortcuts; see
  65. // https://msdn.microsoft.com/library/windows/desktop/dd378459.aspx for more
  66. // information. Use ShellUtil::GetBrowserModelId to get the suffixed value --
  67. // it is almost never correct to use the unsuffixed (base) portion of this id
  68. // directly.
  69. // * The prefix for the Elevation Service Name. See
  70. // install_static::GetElevationServiceDisplayName() and
  71. // install_static::GetElevationServiceName().
  72. // * The prefix of Web App ProgIds. See web_app::GetProgIdForApp. This means
  73. // |base_app_id| must only contain alphanumeric characters and
  74. // non-leading '.'s.
  75. const wchar_t* base_app_id;
  76. // The prefix for the browser's ProgID. This prefix may be no more than 11
  77. // characters long; see ShellUtil::GetBrowserProgId and
  78. // https://msdn.microsoft.com/library/windows/desktop/dd542719.aspx.
  79. const wchar_t* prog_id_prefix;
  80. // A human-readable description of the browser, used when registering with
  81. // Windows.
  82. const wchar_t* prog_id_description;
  83. // The GUID to be used when registering this install mode for Active Setup.
  84. // Active Setup is used to perform certain operations in a user's context for
  85. // system-level installs.
  86. const wchar_t* active_setup_guid;
  87. // The legacy CommandExecuteImpl CLSID, or an empty string if this install
  88. // mode never included a DelegateExecute verb handler.
  89. const wchar_t* legacy_command_execute_clsid;
  90. // The CLSID of the COM object registered with the Widnows OS. This is for app
  91. // activation via user interaction with a toast notification in the Action
  92. // Center.
  93. CLSID toast_activator_clsid;
  94. // The CLSID of the COM server that provides silent elevation functionality.
  95. CLSID elevator_clsid;
  96. // The IID and the TypeLib of the IElevator interface that provides silent
  97. // elevation functionality.
  98. IID elevator_iid;
  99. // The default name for this mode's update channel.
  100. const wchar_t* default_channel_name;
  101. // The strategy used to determine the mode's update channel, or UNSUPPORTED if
  102. // the brand does not integrate with Google Update.
  103. ChannelStrategy channel_strategy;
  104. // True if this mode supports system-level installs.
  105. bool supports_system_level;
  106. // True if this mode supports in-product mechanisms to make the browser the
  107. // user's chosen default browser. Features such as the "Make default" button
  108. // in chrome://settings are hidden when this is false.
  109. bool supports_set_as_default_browser;
  110. // True if this mode supports user retention experiments run by the installer
  111. // following updates.
  112. bool supports_retention_experiments;
  113. // The index of this mode's main application icon in the main executable.
  114. int app_icon_resource_index;
  115. // The resource id of this mode's main application icon.
  116. int16_t app_icon_resource_id;
  117. // The app container sid prefix for sandbox.
  118. const wchar_t* sandbox_sid_prefix;
  119. };
  120. } // namespace install_static
  121. #endif // CHROME_INSTALL_STATIC_INSTALL_CONSTANTS_H_