0

Revert "Spanify install modes"

This reverts commit fb6d8a2002.

Reason for revert: Causing compile failures on win-chrome builder. See https://ci.chromium.org/ui/p/chrome/builders/ci/win-chrome/36349/overview.

Original change's description:
> Spanify install modes
>
> Updating kInstallModes to use a container and enabling any unsafe buffer
> checks that are fully fixed from this change.
>
> Low-Coverage-Reason: TRIVIAL_CHANGE
> Bug: 40285824
> Cq-Include-Trybots: luci.chrome.try:win-branded-compile-rel
> Change-Id: Ibcffdb4664e969d93a397d3a5c9adf9cb90ac6c2
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6306124
> Reviewed-by: Stanley Hon <stahon@microsoft.com>
> Commit-Queue: Hoch Hochkeppel <mhochk@microsoft.com>
> Reviewed-by: Greg Thompson <grt@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1429625}

Bug: 40285824
Cq-Include-Trybots: luci.chrome.try:win-branded-compile-rel
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: Ic0ef31af09e17928616e7693ede8fc218aae10ed
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6336970
Commit-Queue: Adithya Srinivasan <adithyas@chromium.org>
Owners-Override: Adithya Srinivasan <adithyas@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#1429699}
This commit is contained in:
Adithya Srinivasan
2025-03-07 13:12:33 -08:00
committed by Chromium LUCI CQ
parent 389876eafc
commit ad438f99b5
13 changed files with 451 additions and 462 deletions

@ -8,6 +8,8 @@
#include <stdlib.h>
#include "chrome/app/chrome_dll_resource.h"
#include "chrome/common/chrome_icon_resources_win.h"
#include "chrome/install_static/install_modes.h"
namespace install_static {
@ -20,4 +22,78 @@ const size_t kProductPathNameLength = _countof(kProductPathName) - 1;
const char kSafeBrowsingName[] = "chromium";
const InstallConstants kInstallModes[] = {
// The primary (and only) install mode for Chromium.
{
.size = sizeof(kInstallModes[0]),
.index = CHROMIUM_INDEX, // The one and only mode for Chromium.
.install_switch =
"", // No install switch for the primary install mode.
.install_suffix =
L"", // Empty install_suffix for the primary install mode.
.logo_suffix = L"", // No logo suffix for the primary install mode.
.app_guid =
L"", // Empty app_guid since no integration with Google Update.
.base_app_name = L"Chromium", // A distinct base_app_name.
.base_app_id = L"Chromium", // A distinct base_app_id.
.browser_prog_id_prefix = L"ChromiumHTM", // Browser ProgID prefix.
.browser_prog_id_description =
L"Chromium HTML Document", // Browser ProgID description.
.pdf_prog_id_prefix = L"ChromiumPDF", // PDF ProgID prefix.
.pdf_prog_id_description =
L"Chromium PDF Document", // PDF ProgID description.
.active_setup_guid =
L"{7D2B3E1D-D096-4594-9D8F-A6667F12E0AC}", // Active Setup GUID.
.legacy_command_execute_clsid =
L"{A2DF06F9-A21A-44A8-8A99-8B9C84F29160}", // CommandExecuteImpl
// CLSID.
.toast_activator_clsid = {0x635EFA6F,
0x08D6,
0x4EC9,
{0xBD, 0x14, 0x8A, 0x0F, 0xDE, 0x97, 0x51,
0x59}}, // Toast Activator CLSID.
.elevator_clsid = {0xD133B120,
0x6DB4,
0x4D6B,
{0x8B, 0xFE, 0x83, 0xBF, 0x8C, 0xA1, 0xB1,
0xB0}}, // Elevator CLSID.
.elevator_iid = {0xb88c45b9,
0x8825,
0x4629,
{0xb8, 0x3e, 0x77, 0xcc, 0x67, 0xd9, 0xce,
0xed}}, // IElevator IID and TypeLib
// {B88C45B9-8825-4629-B83E-77CC67D9CEED}.
.tracing_service_clsid = {0x83f69367,
0x442d,
0x447f,
{0x8b, 0xcc, 0x0e, 0x3f, 0x97, 0xbe, 0x9c,
0xf2}}, // SystemTraceSession CLSID.
.tracing_service_iid = {0xa3fd580a,
0xffd4,
0x4075,
{0x91, 0x74, 0x75, 0xd0, 0xb1, 0x99, 0xd3,
0xcb}}, // ISystemTraceSessionChromium IID and
// TypeLib
.default_channel_name =
L"", // Empty default channel name since no update integration.
.channel_strategy = ChannelStrategy::UNSUPPORTED,
.supports_system_level = true, // Supports system-level installs.
.supports_set_as_default_browser =
true, // Supports in-product set as default browser UX.
.app_icon_resource_index =
icon_resources::kApplicationIndex, // App icon resource index.
.app_icon_resource_id = IDR_MAINFRAME, // App icon resource id.
.html_doc_icon_resource_index =
icon_resources::kHtmlDocIndex, // HTML doc icon resource index.
.pdf_doc_icon_resource_index =
icon_resources::kPDFDocIndex, // PDF doc icon resource index.
.sandbox_sid_prefix =
L"S-1-15-2-3251537155-1984446955-2931258699-841473695-1938553385-"
L"924012148-", // App container sid prefix for sandbox.
},
};
static_assert(_countof(kInstallModes) == NUM_INSTALL_MODES,
"Imbalance between kInstallModes and InstallConstantIndex");
} // namespace install_static

@ -7,12 +7,6 @@
#ifndef CHROME_INSTALL_STATIC_CHROMIUM_INSTALL_MODES_H_
#define CHROME_INSTALL_STATIC_CHROMIUM_INSTALL_MODES_H_
#include <array>
#include "chrome/app/chrome_dll_resource.h"
#include "chrome/common/chrome_icon_resources_win.h"
#include "chrome/install_static/install_constants.h"
namespace install_static {
// Note: This list of indices must be kept in sync with the brand-specific
@ -22,79 +16,6 @@ enum InstallConstantIndex {
NUM_INSTALL_MODES,
};
inline constexpr auto kInstallModes = std::to_array<InstallConstants>({
// The primary (and only) install mode for Chromium.
{
.size = sizeof(InstallConstants),
.index = CHROMIUM_INDEX, // The one and only mode for Chromium.
.install_switch =
"", // No install switch for the primary install mode.
.install_suffix =
L"", // Empty install_suffix for the primary install mode.
.logo_suffix = L"", // No logo suffix for the primary install mode.
.app_guid =
L"", // Empty app_guid since no integration with Google Update.
.base_app_name = L"Chromium", // A distinct base_app_name.
.base_app_id = L"Chromium", // A distinct base_app_id.
.browser_prog_id_prefix = L"ChromiumHTM", // Browser ProgID prefix.
.browser_prog_id_description =
L"Chromium HTML Document", // Browser ProgID description.
.pdf_prog_id_prefix = L"ChromiumPDF", // PDF ProgID prefix.
.pdf_prog_id_description =
L"Chromium PDF Document", // PDF ProgID description.
.active_setup_guid =
L"{7D2B3E1D-D096-4594-9D8F-A6667F12E0AC}", // Active Setup
// GUID.
.legacy_command_execute_clsid =
L"{A2DF06F9-A21A-44A8-8A99-8B9C84F29160}", // CommandExecuteImpl
// CLSID.
.toast_activator_clsid = {0x635EFA6F,
0x08D6,
0x4EC9,
{0xBD, 0x14, 0x8A, 0x0F, 0xDE, 0x97, 0x51,
0x59}}, // Toast Activator CLSID.
.elevator_clsid = {0xD133B120,
0x6DB4,
0x4D6B,
{0x8B, 0xFE, 0x83, 0xBF, 0x8C, 0xA1, 0xB1,
0xB0}}, // Elevator CLSID.
.elevator_iid = {0xb88c45b9,
0x8825,
0x4629,
{0xb8, 0x3e, 0x77, 0xcc, 0x67, 0xd9, 0xce,
0xed}}, // IElevator IID and TypeLib
// {B88C45B9-8825-4629-B83E-77CC67D9CEED}.
.tracing_service_clsid = {0x83f69367,
0x442d,
0x447f,
{0x8b, 0xcc, 0x0e, 0x3f, 0x97, 0xbe, 0x9c,
0xf2}}, // SystemTraceSession CLSID.
.tracing_service_iid = {0xa3fd580a,
0xffd4,
0x4075,
{0x91, 0x74, 0x75, 0xd0, 0xb1, 0x99, 0xd3,
0xcb}}, // ISystemTraceSessionChromium IID and
// TypeLib
.default_channel_name =
L"", // Empty default channel name since no update integration.
.channel_strategy = ChannelStrategy::UNSUPPORTED,
.supports_system_level = true, // Supports system-level installs.
.supports_set_as_default_browser =
true, // Supports in-product set as default browser UX.
.app_icon_resource_index =
icon_resources::kApplicationIndex, // App icon resource index.
.app_icon_resource_id = IDR_MAINFRAME, // App icon resource id.
.html_doc_icon_resource_index =
icon_resources::kHtmlDocIndex, // HTML doc icon resource index.
.pdf_doc_icon_resource_index =
icon_resources::kPDFDocIndex, // PDF doc icon resource index.
.sandbox_sid_prefix =
L"S-1-15-2-3251537155-1984446955-2931258699-841473695-"
L"1938553385-"
L"924012148-", // App container sid prefix for sandbox.
},
});
} // namespace install_static
#endif // CHROME_INSTALL_STATIC_CHROMIUM_INSTALL_MODES_H_

@ -8,6 +8,8 @@
#include <stdlib.h>
#include "chrome/app/chrome_dll_resource.h"
#include "chrome/common/chrome_icon_resources_win.h"
#include "chrome/install_static/install_modes.h"
namespace install_static {
@ -20,4 +22,70 @@ const size_t kProductPathNameLength = _countof(kProductPathName) - 1;
const char kSafeBrowsingName[] = "googlechromefortesting";
const InstallConstants kInstallModes[] = {
// The primary install mode for stable Google Chrome.
{
.size = sizeof(kInstallModes[0]),
.index = GOOGLE_CHROME_FOR_TESTING_INDEX, // The one and only mode for
// Google Chrome for Testing.
.install_switch =
"", // No install switch for the primary install mode.
.install_suffix =
L"", // Empty install_suffix for the primary install mode.
.logo_suffix = L"", // No logo suffix for the primary install mode.
.app_guid =
L"", // Empty app_guid since no integration with Google Update.
.base_app_name =
L"Google Chrome for Testing", // A distinct base_app_name.
.base_app_id = L"ChromeForTesting", // A distinct base_app_id.
.browser_prog_id_prefix = L"CfTHTML", // Browser ProgID prefix.
.browser_prog_id_description =
L"Chrome for Testing HTML Document", // Browser ProgID description.
.pdf_prog_id_prefix = L"CfTPDF", // PDF ProgID prefix.
.pdf_prog_id_description =
L"Chrome for Testing PDF Document", // PDF ProgID description.
.active_setup_guid =
L"{E25CFD4E-D9D4-4123-936A-286FBB19BA5B}", // Active Setup GUID.
.legacy_command_execute_clsid = L"", // CommandExecuteImpl CLSID.
.toast_activator_clsid = {0x77ED8F9B,
0xE27A,
0x499F,
{0x8E, 0x2F, 0xD7, 0xC0, 0x41, 0x57, 0xCF,
0x64}}, // Toast Activator CLSID.
// {77ED8F9B-E27A-499F-8E2F-D7C04157CF64}
.elevator_clsid = {0x724349BF,
0xE1CF,
0x4481,
{0xA6, 0x4D, 0x8C, 0xD1, 0x01, 0x83, 0xCA,
0x03}}, // Elevator CLSID.
// {724349BF-E1CF-4481-A64D-8CD10183CA03}
.elevator_iid = {0x3DC48E97,
0x47D0,
0x476F,
{0x8F, 0x89, 0x07, 0x92, 0xFC, 0x61, 0x15,
0x67}}, // IElevator IID and TypeLib
// {3DC48E97-47D0-476F-8F89-0792FC611567}
.default_channel_name =
L"", // Empty default channel name since no update integration.
.channel_strategy = ChannelStrategy::UNSUPPORTED,
.supports_system_level =
false, // Does not support system-level installs.
.supports_set_as_default_browser =
false, // Does not support in-product set as default browser UX.
.app_icon_resource_index =
icon_resources::kApplicationIndex, // App icon resource index.
.app_icon_resource_id = IDR_MAINFRAME, // App icon resource id.
.html_doc_icon_resource_index =
icon_resources::kHtmlDocIndex, // HTML doc icon resource index.
.pdf_doc_icon_resource_index =
icon_resources::kPDFDocIndex, // PDF doc icon resource index.
.sandbox_sid_prefix =
L"S-1-15-2-3251537155-1984446955-2931258699-841473695-1938553385-"
L"924012153-", // App container sid prefix for sandbox.
},
};
static_assert(_countof(kInstallModes) == NUM_INSTALL_MODES,
"Imbalance between kInstallModes and InstallConstantIndex");
} // namespace install_static

@ -7,12 +7,6 @@
#ifndef CHROME_INSTALL_STATIC_GOOGLE_CHROME_FOR_TESTING_INSTALL_MODES_H_
#define CHROME_INSTALL_STATIC_GOOGLE_CHROME_FOR_TESTING_INSTALL_MODES_H_
#include <array>
#include "chrome/app/chrome_dll_resource.h"
#include "chrome/common/chrome_icon_resources_win.h"
#include "chrome/install_static/install_constants.h"
namespace install_static {
// Note: This list of indices must be kept in sync with the brand-specific
@ -22,73 +16,6 @@ enum InstallConstantIndex {
NUM_INSTALL_MODES,
};
inline constexpr auto kInstallModes = std::to_array<InstallConstants>({
// The primary install mode for stable Google Chrome.
{
.size = sizeof(InstallConstants),
.index = GOOGLE_CHROME_FOR_TESTING_INDEX, // The one and only mode for
// Google Chrome for Testing.
.install_switch =
"", // No install switch for the primary install mode.
.install_suffix =
L"", // Empty install_suffix for the primary install mode.
.logo_suffix = L"", // No logo suffix for the primary install mode.
.app_guid =
L"", // Empty app_guid since no integration with Google Update.
.base_app_name =
L"Google Chrome for Testing", // A distinct base_app_name.
.base_app_id = L"ChromeForTesting", // A distinct base_app_id.
.browser_prog_id_prefix = L"CfTHTML", // Browser ProgID prefix.
.browser_prog_id_description =
L"Chrome for Testing HTML Document", // Browser ProgID
// description.
.pdf_prog_id_prefix = L"CfTPDF", // PDF ProgID prefix.
.pdf_prog_id_description =
L"Chrome for Testing PDF Document", // PDF ProgID description.
.active_setup_guid =
L"{E25CFD4E-D9D4-4123-936A-286FBB19BA5B}", // Active Setup
// GUID.
.legacy_command_execute_clsid = L"", // CommandExecuteImpl CLSID.
.toast_activator_clsid = {0x77ED8F9B,
0xE27A,
0x499F,
{0x8E, 0x2F, 0xD7, 0xC0, 0x41, 0x57, 0xCF,
0x64}}, // Toast Activator CLSID.
// {77ED8F9B-E27A-499F-8E2F-D7C04157CF64}
.elevator_clsid = {0x724349BF,
0xE1CF,
0x4481,
{0xA6, 0x4D, 0x8C, 0xD1, 0x01, 0x83, 0xCA,
0x03}}, // Elevator CLSID.
// {724349BF-E1CF-4481-A64D-8CD10183CA03}
.elevator_iid = {0x3DC48E97,
0x47D0,
0x476F,
{0x8F, 0x89, 0x07, 0x92, 0xFC, 0x61, 0x15,
0x67}}, // IElevator IID and TypeLib
// {3DC48E97-47D0-476F-8F89-0792FC611567}
.default_channel_name =
L"", // Empty default channel name since no update integration.
.channel_strategy = ChannelStrategy::UNSUPPORTED,
.supports_system_level =
false, // Does not support system-level installs.
.supports_set_as_default_browser =
false, // Does not support in-product set as default browser
// UX.
.app_icon_resource_index =
icon_resources::kApplicationIndex, // App icon resource index.
.app_icon_resource_id = IDR_MAINFRAME, // App icon resource id.
.html_doc_icon_resource_index =
icon_resources::kHtmlDocIndex, // HTML doc icon resource index.
.pdf_doc_icon_resource_index =
icon_resources::kPDFDocIndex, // PDF doc icon resource index.
.sandbox_sid_prefix =
L"S-1-15-2-3251537155-1984446955-2931258699-841473695-"
L"1938553385-"
L"924012153-", // App container sid prefix for sandbox.
},
});
} // namespace install_static
#endif // CHROME_INSTALL_STATIC_GOOGLE_CHROME_FOR_TESTING_INSTALL_MODES_H_

@ -8,6 +8,8 @@
#include <stdlib.h>
#include "chrome/app/chrome_dll_resource.h"
#include "chrome/common/chrome_icon_resources_win.h"
#include "chrome/install_static/install_modes.h"
namespace install_static {
@ -20,4 +22,279 @@ const size_t kProductPathNameLength = _countof(kProductPathName) - 1;
const char kSafeBrowsingName[] = "googlechrome";
const InstallConstants kInstallModes[] = {
// The primary install mode for stable Google Chrome.
{
.size = sizeof(kInstallModes[0]),
.index = STABLE_INDEX, // The first mode is for stable/beta/dev.
.install_switch =
"", // No install switch for the primary install mode.
.install_suffix =
L"", // Empty install_suffix for the primary install mode.
.logo_suffix = L"", // No logo suffix for the primary install mode.
.app_guid = L"{8A69D345-D564-463c-AFF1-A69D9E530F96}",
.base_app_name = L"Google Chrome", // A distinct base_app_name.
.base_app_id = L"Chrome", // A distinct base_app_id.
.browser_prog_id_prefix = L"ChromeHTML", // Browser ProgID prefix.
.browser_prog_id_description =
L"Chrome HTML Document", // Browser ProgID description.
.pdf_prog_id_prefix = L"ChromePDF", // PDF ProgID prefix.
.pdf_prog_id_description =
L"Chrome PDF Document", // PDF ProgID description.
.active_setup_guid =
L"{8A69D345-D564-463c-AFF1-A69D9E530F96}", // Active Setup GUID.
.legacy_command_execute_clsid =
L"{5C65F4B0-3651-4514-B207-D10CB699B14B}", // CommandExecuteImpl
// CLSID.
.toast_activator_clsid = {0xA2C6CB58,
0xC076,
0x425C,
{0xAC, 0xB7, 0x6D, 0x19, 0xD6, 0x44, 0x28,
0xCD}}, // Toast Activator CLSID.
.elevator_clsid = {0x708860E0,
0xF641,
0x4611,
{0x88, 0x95, 0x7D, 0x86, 0x7D, 0xD3, 0x67,
0x5B}}, // Elevator CLSID.
.elevator_iid = {0x463abecf,
0x410d,
0x407f,
{0x8a, 0xf5, 0xd, 0xf3, 0x5a, 0x0, 0x5c,
0xc8}}, // IElevator IID and TypeLib
// {463ABECF-410D-407F-8AF5-0DF35A005CC8}.
.tracing_service_clsid = {0x70457024,
0xd309,
0x462c,
{0xb2, 0xe0, 0x49, 0xa7, 0x71, 0x48, 0x7e,
0x46}}, // SystemTraceSession CLSID.
.tracing_service_iid = {0x056b3371,
0x1c09,
0x475b,
{0xa8, 0xd7, 0x9e, 0x58, 0xbf, 0x45, 0x53,
0x3e}}, // ISystemTraceSessionChromium IID and
// TypeLib
.default_channel_name = L"", // The empty string means "stable".
.channel_strategy = ChannelStrategy::FLOATING,
.supports_system_level = true, // Supports system-level installs.
.supports_set_as_default_browser =
true, // Supports in-product set as default browser UX.
.app_icon_resource_index =
icon_resources::kApplicationIndex, // App icon resource index.
.app_icon_resource_id = IDR_MAINFRAME, // App icon resource id.
.html_doc_icon_resource_index =
icon_resources::kHtmlDocIndex, // HTML doc icon resource index.
.pdf_doc_icon_resource_index =
icon_resources::kPDFDocIndex, // PDF doc icon resource index.
.sandbox_sid_prefix =
L"S-1-15-2-3251537155-1984446955-2931258699-841473695-1938553385-"
L"924012149-", // App container sid prefix for sandbox.
},
// A secondary install mode for Google Chrome Beta
{
.size = sizeof(kInstallModes[0]),
.index = BETA_INDEX, // The mode for the side-by-side beta channel.
.install_switch = "chrome-beta", // Install switch.
.install_suffix = L" Beta", // Install suffix.
.logo_suffix = L"Beta", // Logo suffix.
.app_guid =
L"{8237E44A-0054-442C-B6B6-EA0509993955}", // A distinct app GUID.
.base_app_name = L"Google Chrome Beta", // A distinct base_app_name.
.base_app_id = L"ChromeBeta", // A distinct base_app_id.
.browser_prog_id_prefix = L"ChromeBHTML", // Browser ProgID prefix.
.browser_prog_id_description =
L"Chrome Beta HTML Document", // Browser ProgID description.
.pdf_prog_id_prefix = L"ChromeBPDF", // PDF ProgID prefix.
.pdf_prog_id_description =
L"Chrome Beta PDF Document", // PDF ProgID description.
.active_setup_guid =
L"{8237E44A-0054-442C-B6B6-EA0509993955}", // Active Setup GUID.
.legacy_command_execute_clsid = L"", // CommandExecuteImpl CLSID.
.toast_activator_clsid = {0xB89B137F,
0x96AA,
0x4AE2,
{0x98, 0xC4, 0x63, 0x73, 0xEA, 0xA1, 0xEA,
0x4D}}, // Toast Activator CLSID.
.elevator_clsid = {0xDD2646BA,
0x3707,
0x4BF8,
{0xB9, 0xA7, 0x3, 0x86, 0x91, 0xA6, 0x8F,
0xC2}}, // Elevator CLSID.
.elevator_iid = {0xa2721d66,
0x376e,
0x4d2f,
{0x9f, 0xf, 0x90, 0x70, 0xe9, 0xa4, 0x2b,
0x5f}}, // IElevator IID and TypeLib
// {A2721D66-376E-4D2F-9F0F-9070E9A42B5F}.
.tracing_service_clsid = {0xe64e8e46,
0x6756,
0x467e,
{0x9f, 0x61, 0x86, 0x16, 0xac, 0x13, 0xd1,
0xef}}, // SystemTraceSession CLSID.
.tracing_service_iid = {0xa69d7d7d,
0x9a08,
0x422a,
{0xb6, 0xc6, 0xb7, 0xb8, 0xd3, 0x76, 0xa1,
0x2c}}, // ISystemTraceSessionChromium IID and
// TypeLib
.default_channel_name = L"beta", // Forced channel name.
.channel_strategy = ChannelStrategy::FIXED,
.supports_system_level = true, // Supports system-level installs.
.supports_set_as_default_browser =
true, // Supports in-product set as default browser UX.
.app_icon_resource_index =
icon_resources::kBetaApplicationIndex, // App icon resource index.
.app_icon_resource_id = IDR_X005_BETA, // App icon resource id.
// Using Beta icon instead of html/pdf-specific icons. The PDF bar would
// interfere with the 'B' on the icon.
.html_doc_icon_resource_index =
icon_resources::kBetaApplicationIndex, // HTML doc icon resource
// index.
.pdf_doc_icon_resource_index =
icon_resources::kBetaApplicationIndex, // PDF doc icon resource
// index.
.sandbox_sid_prefix =
L"S-1-15-2-3251537155-1984446955-2931258699-841473695-1938553385-"
L"924012151-", // App container sid prefix for sandbox.
},
// A secondary install mode for Google Chrome Dev
{
.size = sizeof(kInstallModes[0]),
.index = DEV_INDEX, // The mode for the side-by-side dev channel.
.install_switch = "chrome-dev", // Install switch.
.install_suffix = L" Dev", // Install suffix.
.logo_suffix = L"Dev", // Logo suffix.
.app_guid =
L"{401C381F-E0DE-4B85-8BD8-3F3F14FBDA57}", // A distinct app GUID.
.base_app_name = L"Google Chrome Dev", // A distinct base_app_name.
.base_app_id = L"ChromeDev", // A distinct base_app_id.
.browser_prog_id_prefix = L"ChromeDHTML", // ProgID prefix.
.browser_prog_id_description =
L"Chrome Dev HTML Document", // Browser ProgID description.
.pdf_prog_id_prefix = L"ChromeDPDF", // PDF ProgID prefix.
.pdf_prog_id_description =
L"Chrome Dev PDF Document", // PDF ProgID description.
.active_setup_guid =
L"{401C381F-E0DE-4B85-8BD8-3F3F14FBDA57}", // Active Setup GUID.
.legacy_command_execute_clsid = L"", // CommandExecuteImpl CLSID.
.toast_activator_clsid = {0xF01C03EB,
0xD431,
0x4C83,
{0x8D, 0x7A, 0x90, 0x27, 0x71, 0xE7, 0x32,
0xFA}}, // Toast Activator CLSID.
.elevator_clsid = {0xDA7FDCA5,
0x2CAA,
0x4637,
{0xAA, 0x17, 0x7, 0x40, 0x58, 0x4D, 0xE7,
0xDA}}, // Elevator CLSID.
.elevator_iid = {0xbb2aa26b,
0x343a,
0x4072,
{0x8b, 0x6f, 0x80, 0x55, 0x7b, 0x8c, 0xe5,
0x71}}, // IElevator IID and TypeLib
// {BB2AA26B-343A-4072-8B6F-80557B8CE571}.
.tracing_service_clsid = {0x48c5c553,
0x20f9,
0x4cdc,
{0x83, 0x40, 0x85, 0x29, 0xab, 0x83, 0xc5,
0x52}}, // SystemTraceSession CLSID.
.tracing_service_iid = {0xe08adae8,
0x9334,
0x46ed,
{0xb0, 0xcf, 0xdd, 0x17, 0x80, 0x15, 0x8d,
0x55}}, // ISystemTraceSessionChromium IID and
// TypeLib
.default_channel_name = L"dev", // Forced channel name.
.channel_strategy = ChannelStrategy::FIXED,
.supports_system_level = true, // Supports system-level installs.
.supports_set_as_default_browser =
true, // Supports in-product set as default browser UX.
.app_icon_resource_index =
icon_resources::kDevApplicationIndex, // App icon resource index.
.app_icon_resource_id = IDR_X004_DEV, // App icon resource id.
// Using Dev icon instead of html/pdf-specific icons. The PDF bar would
// interfere with the 'D' on the icon.
.html_doc_icon_resource_index =
icon_resources::kDevApplicationIndex, // HTML doc icon resource
// index.
.pdf_doc_icon_resource_index =
icon_resources::kDevApplicationIndex, // PDF doc icon resource
// index.
.sandbox_sid_prefix =
L"S-1-15-2-3251537155-1984446955-2931258699-841473695-1938553385-"
L"924012152-", // App container sid prefix for sandbox.
},
// A secondary install mode for Google Chrome SxS (canary).
{
.size = sizeof(kInstallModes[0]),
.index = CANARY_INDEX, // The mode for the side-by-side canary channel.
.install_switch = "chrome-sxs", // Install switch.
.install_suffix = L" SxS", // Install suffix.
.logo_suffix = L"Canary", // Logo suffix.
.app_guid =
L"{4ea16ac7-fd5a-47c3-875b-dbf4a2008c20}", // A distinct app GUID.
.base_app_name = L"Google Chrome Canary", // A distinct base_app_name.
.base_app_id = L"ChromeCanary", // A distinct base_app_id.
.browser_prog_id_prefix = L"ChromeSSHTM", // ProgID prefix.
.browser_prog_id_description =
L"Chrome Canary HTML Document", // Browser ProgID description.
.pdf_prog_id_prefix = L"ChromeSSPDF", // PDF ProgID prefix.
.pdf_prog_id_description =
L"Chrome Canary PDF Document", // PDF ProgID description.
.active_setup_guid =
L"{4ea16ac7-fd5a-47c3-875b-dbf4a2008c20}", // Active Setup GUID.
.legacy_command_execute_clsid =
L"{1BEAC3E3-B852-44F4-B468-8906C062422E}", // CommandExecuteImpl
// CLSID.
.toast_activator_clsid = {0xFA372A6E,
0x149F,
0x4E95,
{0x83, 0x2D, 0x8F, 0x69, 0x8D, 0x40, 0xAD,
0x7F}}, // Toast Activator CLSID.
.elevator_clsid = {0x704C2872,
0x2049,
0x435E,
{0xA4, 0x69, 0xA, 0x53, 0x43, 0x13, 0xC4,
0x2B}}, // Elevator CLSID.
.elevator_iid = {0x4f7ce041,
0x28e9,
0x484f,
{0x9d, 0xd0, 0x61, 0xa8, 0xca, 0xce, 0xfe,
0xe4}}, // IElevator IID and TypeLib
// {4F7CE041-28E9-484F-9DD0-61A8CACEFEE4}.
.tracing_service_clsid = {0x48c5c553,
0x20f9,
0x4cdc,
{0x83, 0x40, 0x85, 0x29, 0xab, 0x83, 0xc5,
0x52}}, // SystemTraceSession CLSID.
.tracing_service_iid = {0x6efb8558,
0x68d1,
0x4826,
{0xa6, 0x12, 0xa1, 0x80, 0xb3, 0x57, 0x03,
0x75}}, // ISystemTraceSessionChromium IID and
// TypeLib
.default_channel_name = L"canary", // Forced channel name.
.channel_strategy = ChannelStrategy::FIXED,
.supports_system_level =
false, // Does not support system-level installs.
.supports_set_as_default_browser =
false, // Does not support in-product set as default browser UX.
.app_icon_resource_index =
icon_resources::kSxSApplicationIndex, // App icon resource index.
.app_icon_resource_id = IDR_SXS, // App icon resource id.
// Using Canary icon instead of html/pdf-specific icons.
.html_doc_icon_resource_index =
icon_resources::kSxSApplicationIndex, // HTML doc icon resource
// index.
.pdf_doc_icon_resource_index =
icon_resources::kSxSApplicationIndex, // PDF doc icon resource
// index.
.sandbox_sid_prefix =
L"S-1-15-2-3251537155-1984446955-2931258699-841473695-1938553385-"
L"924012150-", // App container sid prefix for sandbox.
},
};
static_assert(_countof(kInstallModes) == NUM_INSTALL_MODES,
"Imbalance between kInstallModes and InstallConstantIndex");
} // namespace install_static

@ -7,12 +7,6 @@
#ifndef CHROME_INSTALL_STATIC_GOOGLE_CHROME_INSTALL_MODES_H_
#define CHROME_INSTALL_STATIC_GOOGLE_CHROME_INSTALL_MODES_H_
#include <array>
#include "chrome/app/chrome_dll_resource.h"
#include "chrome/common/chrome_icon_resources_win.h"
#include "chrome/install_static/install_constants.h"
namespace install_static {
// Note: This list of indices must be kept in sync with the brand-specific
@ -25,293 +19,6 @@ enum InstallConstantIndex {
NUM_INSTALL_MODES,
};
inline constexpr auto kInstallModes = std::to_array<InstallConstants>({
// The primary install mode for stable Google Chrome.
{
.size = sizeof(InstallConstants),
.index = STABLE_INDEX, // The first mode is for stable/beta/dev.
.install_switch =
"", // No install switch for the primary install mode.
.install_suffix =
L"", // Empty install_suffix for the primary install mode.
.logo_suffix = L"", // No logo suffix for the primary install mode.
.app_guid = L"{8A69D345-D564-463c-AFF1-A69D9E530F96}",
.base_app_name = L"Google Chrome", // A distinct base_app_name.
.base_app_id = L"Chrome", // A distinct base_app_id.
.browser_prog_id_prefix = L"ChromeHTML", // Browser ProgID prefix.
.browser_prog_id_description =
L"Chrome HTML Document", // Browser ProgID description.
.pdf_prog_id_prefix = L"ChromePDF", // PDF ProgID prefix.
.pdf_prog_id_description =
L"Chrome PDF Document", // PDF ProgID description.
.active_setup_guid =
L"{8A69D345-D564-463c-AFF1-A69D9E530F96}", // Active Setup
// GUID.
.legacy_command_execute_clsid =
L"{5C65F4B0-3651-4514-B207-D10CB699B14B}", // CommandExecuteImpl
// CLSID.
.toast_activator_clsid = {0xA2C6CB58,
0xC076,
0x425C,
{0xAC, 0xB7, 0x6D, 0x19, 0xD6, 0x44, 0x28,
0xCD}}, // Toast Activator CLSID.
.elevator_clsid = {0x708860E0,
0xF641,
0x4611,
{0x88, 0x95, 0x7D, 0x86, 0x7D, 0xD3, 0x67,
0x5B}}, // Elevator CLSID.
.elevator_iid = {0x463abecf,
0x410d,
0x407f,
{0x8a, 0xf5, 0xd, 0xf3, 0x5a, 0x0, 0x5c,
0xc8}}, // IElevator IID and TypeLib
// {463ABECF-410D-407F-8AF5-0DF35A005CC8}.
.tracing_service_clsid = {0x70457024,
0xd309,
0x462c,
{0xb2, 0xe0, 0x49, 0xa7, 0x71, 0x48, 0x7e,
0x46}}, // SystemTraceSession CLSID.
.tracing_service_iid = {0x056b3371,
0x1c09,
0x475b,
{0xa8, 0xd7, 0x9e, 0x58, 0xbf, 0x45, 0x53,
0x3e}}, // ISystemTraceSessionChromium IID
// and TypeLib
.default_channel_name = L"", // The empty string means "stable".
.channel_strategy = ChannelStrategy::FLOATING,
.supports_system_level = true, // Supports system-level installs.
.supports_set_as_default_browser =
true, // Supports in-product set as default browser UX.
.app_icon_resource_index =
icon_resources::kApplicationIndex, // App icon resource index.
.app_icon_resource_id = IDR_MAINFRAME, // App icon resource id.
.html_doc_icon_resource_index =
icon_resources::kHtmlDocIndex, // HTML doc icon resource index.
.pdf_doc_icon_resource_index =
icon_resources::kPDFDocIndex, // PDF doc icon resource index.
.sandbox_sid_prefix =
L"S-1-15-2-3251537155-1984446955-2931258699-841473695-"
L"1938553385-"
L"924012149-", // App container sid prefix for sandbox.
},
// A secondary install mode for Google Chrome Beta
{
.size = sizeof(InstallConstants),
.index = BETA_INDEX, // The mode for the side-by-side beta channel.
.install_switch = "chrome-beta", // Install switch.
.install_suffix = L" Beta", // Install suffix.
.logo_suffix = L"Beta", // Logo suffix.
.app_guid = L"{8237E44A-0054-442C-B6B6-EA0509993955}", // A distinct
// app GUID.
.base_app_name = L"Google Chrome Beta", // A distinct base_app_name.
.base_app_id = L"ChromeBeta", // A distinct base_app_id.
.browser_prog_id_prefix = L"ChromeBHTML", // Browser ProgID prefix.
.browser_prog_id_description =
L"Chrome Beta HTML Document", // Browser ProgID description.
.pdf_prog_id_prefix = L"ChromeBPDF", // PDF ProgID prefix.
.pdf_prog_id_description =
L"Chrome Beta PDF Document", // PDF ProgID description.
.active_setup_guid =
L"{8237E44A-0054-442C-B6B6-EA0509993955}", // Active Setup
// GUID.
.legacy_command_execute_clsid = L"", // CommandExecuteImpl CLSID.
.toast_activator_clsid = {0xB89B137F,
0x96AA,
0x4AE2,
{0x98, 0xC4, 0x63, 0x73, 0xEA, 0xA1, 0xEA,
0x4D}}, // Toast Activator CLSID.
.elevator_clsid = {0xDD2646BA,
0x3707,
0x4BF8,
{0xB9, 0xA7, 0x3, 0x86, 0x91, 0xA6, 0x8F,
0xC2}}, // Elevator CLSID.
.elevator_iid = {0xa2721d66,
0x376e,
0x4d2f,
{0x9f, 0xf, 0x90, 0x70, 0xe9, 0xa4, 0x2b,
0x5f}}, // IElevator IID and TypeLib
// {A2721D66-376E-4D2F-9F0F-9070E9A42B5F}.
.tracing_service_clsid = {0xe64e8e46,
0x6756,
0x467e,
{0x9f, 0x61, 0x86, 0x16, 0xac, 0x13, 0xd1,
0xef}}, // SystemTraceSession CLSID.
.tracing_service_iid = {0xa69d7d7d,
0x9a08,
0x422a,
{0xb6, 0xc6, 0xb7, 0xb8, 0xd3, 0x76, 0xa1,
0x2c}}, // ISystemTraceSessionChromium IID and
// TypeLib
.default_channel_name = L"beta", // Forced channel name.
.channel_strategy = ChannelStrategy::FIXED,
.supports_system_level = true, // Supports system-level installs.
.supports_set_as_default_browser =
true, // Supports in-product set as default browser UX.
.app_icon_resource_index =
icon_resources::kBetaApplicationIndex, // App icon resource
// index.
.app_icon_resource_id = IDR_X005_BETA, // App icon resource id.
// Using Beta icon instead of html/pdf-specific icons. The PDF bar
// would
// interfere with the 'B' on the icon.
.html_doc_icon_resource_index =
icon_resources::kBetaApplicationIndex, // HTML doc icon
// resource
// index.
.pdf_doc_icon_resource_index =
icon_resources::kBetaApplicationIndex, // PDF doc icon resource
// index.
.sandbox_sid_prefix =
L"S-1-15-2-3251537155-1984446955-2931258699-841473695-"
L"1938553385-"
L"924012151-", // App container sid prefix for sandbox.
},
// A secondary install mode for Google Chrome Dev
{
.size = sizeof(InstallConstants),
.index = DEV_INDEX, // The mode for the side-by-side dev channel.
.install_switch = "chrome-dev", // Install switch.
.install_suffix = L" Dev", // Install suffix.
.logo_suffix = L"Dev", // Logo suffix.
.app_guid = L"{401C381F-E0DE-4B85-8BD8-3F3F14FBDA57}", // A distinct
// app GUID.
.base_app_name = L"Google Chrome Dev", // A distinct base_app_name.
.base_app_id = L"ChromeDev", // A distinct base_app_id.
.browser_prog_id_prefix = L"ChromeDHTML", // ProgID prefix.
.browser_prog_id_description =
L"Chrome Dev HTML Document", // Browser ProgID description.
.pdf_prog_id_prefix = L"ChromeDPDF", // PDF ProgID prefix.
.pdf_prog_id_description =
L"Chrome Dev PDF Document", // PDF ProgID description.
.active_setup_guid =
L"{401C381F-E0DE-4B85-8BD8-3F3F14FBDA57}", // Active Setup
// GUID.
.legacy_command_execute_clsid = L"", // CommandExecuteImpl CLSID.
.toast_activator_clsid = {0xF01C03EB,
0xD431,
0x4C83,
{0x8D, 0x7A, 0x90, 0x27, 0x71, 0xE7, 0x32,
0xFA}}, // Toast Activator CLSID.
.elevator_clsid = {0xDA7FDCA5,
0x2CAA,
0x4637,
{0xAA, 0x17, 0x7, 0x40, 0x58, 0x4D, 0xE7,
0xDA}}, // Elevator CLSID.
.elevator_iid = {0xbb2aa26b,
0x343a,
0x4072,
{0x8b, 0x6f, 0x80, 0x55, 0x7b, 0x8c, 0xe5,
0x71}}, // IElevator IID and TypeLib
// {BB2AA26B-343A-4072-8B6F-80557B8CE571}.
.tracing_service_clsid = {0x48c5c553,
0x20f9,
0x4cdc,
{0x83, 0x40, 0x85, 0x29, 0xab, 0x83, 0xc5,
0x52}}, // SystemTraceSession CLSID.
.tracing_service_iid = {0xe08adae8,
0x9334,
0x46ed,
{0xb0, 0xcf, 0xdd, 0x17, 0x80, 0x15, 0x8d,
0x55}}, // ISystemTraceSessionChromium IID and
// TypeLib
.default_channel_name = L"dev", // Forced channel name.
.channel_strategy = ChannelStrategy::FIXED,
.supports_system_level = true, // Supports system-level installs.
.supports_set_as_default_browser =
true, // Supports in-product set as default browser UX.
.app_icon_resource_index =
icon_resources::kDevApplicationIndex, // App icon resource
// index.
.app_icon_resource_id = IDR_X004_DEV, // App icon resource id.
// Using Dev icon instead of html/pdf-specific icons. The PDF bar
// would
// interfere with the 'D' on the icon.
.html_doc_icon_resource_index =
icon_resources::kDevApplicationIndex, // HTML doc icon resource
// index.
.pdf_doc_icon_resource_index =
icon_resources::kDevApplicationIndex, // PDF doc icon resource
// index.
.sandbox_sid_prefix =
L"S-1-15-2-3251537155-1984446955-2931258699-841473695-"
L"1938553385-"
L"924012152-", // App container sid prefix for sandbox.
},
// A secondary install mode for Google Chrome SxS (canary).
{
.size = sizeof(InstallConstants),
.index = CANARY_INDEX, // The mode for the side-by-side canary channel.
.install_switch = "chrome-sxs", // Install switch.
.install_suffix = L" SxS", // Install suffix.
.logo_suffix = L"Canary", // Logo suffix.
.app_guid = L"{4ea16ac7-fd5a-47c3-875b-dbf4a2008c20}", // A distinct
// app GUID.
.base_app_name = L"Google Chrome Canary", // A distinct base_app_name.
.base_app_id = L"ChromeCanary", // A distinct base_app_id.
.browser_prog_id_prefix = L"ChromeSSHTM", // ProgID prefix.
.browser_prog_id_description =
L"Chrome Canary HTML Document", // Browser ProgID description.
.pdf_prog_id_prefix = L"ChromeSSPDF", // PDF ProgID prefix.
.pdf_prog_id_description =
L"Chrome Canary PDF Document", // PDF ProgID description.
.active_setup_guid =
L"{4ea16ac7-fd5a-47c3-875b-dbf4a2008c20}", // Active Setup
// GUID.
.legacy_command_execute_clsid =
L"{1BEAC3E3-B852-44F4-B468-8906C062422E}", // CommandExecuteImpl
// CLSID.
.toast_activator_clsid = {0xFA372A6E,
0x149F,
0x4E95,
{0x83, 0x2D, 0x8F, 0x69, 0x8D, 0x40, 0xAD,
0x7F}}, // Toast Activator CLSID.
.elevator_clsid = {0x704C2872,
0x2049,
0x435E,
{0xA4, 0x69, 0xA, 0x53, 0x43, 0x13, 0xC4,
0x2B}}, // Elevator CLSID.
.elevator_iid = {0x4f7ce041,
0x28e9,
0x484f,
{0x9d, 0xd0, 0x61, 0xa8, 0xca, 0xce, 0xfe,
0xe4}}, // IElevator IID and TypeLib
// {4F7CE041-28E9-484F-9DD0-61A8CACEFEE4}.
.tracing_service_clsid = {0x48c5c553,
0x20f9,
0x4cdc,
{0x83, 0x40, 0x85, 0x29, 0xab, 0x83, 0xc5,
0x52}}, // SystemTraceSession CLSID.
.tracing_service_iid = {0x6efb8558,
0x68d1,
0x4826,
{0xa6, 0x12, 0xa1, 0x80, 0xb3, 0x57, 0x03,
0x75}}, // ISystemTraceSessionChromium IID and
// TypeLib
.default_channel_name = L"canary", // Forced channel name.
.channel_strategy = ChannelStrategy::FIXED,
.supports_system_level =
false, // Does not support system-level installs.
.supports_set_as_default_browser =
false, // Does not support in-product set as default browser
// UX.
.app_icon_resource_index =
icon_resources::kSxSApplicationIndex, // App icon resource
// index.
.app_icon_resource_id = IDR_SXS, // App icon resource id.
// Using Canary icon instead of html/pdf-specific icons.
.html_doc_icon_resource_index =
icon_resources::kSxSApplicationIndex, // HTML doc icon resource
// index.
.pdf_doc_icon_resource_index =
icon_resources::kSxSApplicationIndex, // PDF doc icon resource
// index.
.sandbox_sid_prefix =
L"S-1-15-2-3251537155-1984446955-2931258699-841473695-"
L"1938553385-"
L"924012150-", // App container sid prefix for sandbox.
},
});
} // namespace install_static
#endif // CHROME_INSTALL_STATIC_GOOGLE_CHROME_INSTALL_MODES_H_

@ -31,6 +31,7 @@
#include <string>
#include "build/branding_buildflags.h"
#include "chrome/install_static/install_constants.h"
// Include the brand-specific values. Each of these must define:
// - enum InstallConstantIndex: named indices of the brand's kInstallModes
@ -61,6 +62,9 @@ extern const size_t kProductPathNameLength;
// The brand-specific safe browsing client name.
extern const char kSafeBrowsingName[];
// A brand's collection of install modes.
extern const InstallConstants kInstallModes[];
// The following convenience functions behave conditionally on whether or not
// the brand uses Chrome's integration with Google Update. For brands that do
// not (e.g., Chromium), they return something like "Software\Chromium" or
@ -72,9 +76,6 @@ std::wstring GetClientsKeyPath(const wchar_t* app_guid);
std::wstring GetClientStateKeyPath(const wchar_t* app_guid);
std::wstring GetClientStateMediumKeyPath(const wchar_t* app_guid);
static_assert(kInstallModes.size() == NUM_INSTALL_MODES,
"Imbalance between kInstallModes and InstallConstantIndex");
} // namespace install_static
#endif // CHROME_INSTALL_STATIC_INSTALL_MODES_H_

@ -47,8 +47,8 @@ MATCHER(ContainsIllegalProgIdChar, "") {
} // namespace
TEST(InstallModes, VerifyModes) {
ASSERT_THAT(kInstallModes.size(), Gt(0));
for (size_t i = 0; i < kInstallModes.size(); ++i) {
ASSERT_THAT(NUM_INSTALL_MODES, Gt(0));
for (int i = 0; i < NUM_INSTALL_MODES; ++i) {
const InstallConstants& mode = kInstallModes[i];
// The modes must be listed in order.

@ -35,12 +35,13 @@ std::wstring GetCurrentProcessExePath() {
const InstallConstants* FindInstallMode(const std::wstring& suffix) {
// Search for a mode with the matching suffix.
for (const auto& mode : kInstallModes) {
for (int i = 0; i < NUM_INSTALL_MODES; ++i) {
const InstallConstants& mode = kInstallModes[i];
if (!_wcsicmp(suffix.c_str(), mode.install_suffix))
return &mode;
}
// The first mode is always the default if all else fails.
return &kInstallModes.front();
return &kInstallModes[0];
}
} // namespace

@ -2,6 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif
#include "chrome/install_static/test/scoped_install_details.h"
#include <utility>

@ -2,6 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif
#include "chrome/installer/setup/setup_install_details.h"
#include <optional>
@ -24,14 +29,14 @@ namespace {
const install_static::InstallConstants* FindInstallMode(
const base::CommandLine& command_line) {
// Search for a mode whose switch is on the command line.
for (size_t i = 1; i < install_static::kInstallModes.size(); ++i) {
for (int i = 1; i < install_static::NUM_INSTALL_MODES; ++i) {
const install_static::InstallConstants& mode =
install_static::kInstallModes[i];
if (command_line.HasSwitch(mode.install_switch))
return &mode;
}
// The first mode is always the default if all else fails.
return &install_static::kInstallModes.front();
return &install_static::kInstallModes[0];
}
// Returns the value of `switch_name` from `command_line` if it is present, or

@ -26,8 +26,8 @@ TEST(GetLocalizedStringTest, DistinctStrings) {
for (int string_id : kStringIds) {
SCOPED_TRACE(testing::Message() << "message id: " << string_id);
std::set<std::wstring> the_strings;
for (size_t mode_index = 0;
mode_index < install_static::kInstallModes.size(); ++mode_index) {
for (int mode_index = 0; mode_index < install_static::NUM_INSTALL_MODES;
++mode_index) {
SCOPED_TRACE(testing::Message() << "install mode index: " << mode_index);
install_static::ScopedInstallDetails install_details(false, mode_index);
std::wstring the_string = GetLocalizedString(string_id);
@ -88,8 +88,9 @@ TEST(GetBaseMessageIdForMode, GoogleStringIds) {
// Run through all install modes, checking that the mode-specific strings are
// mapped properly by GetBaseMessageIdForMode.
ASSERT_EQ(install_static::kInstallModes.size(), mode_to_strings.size());
for (int mode_index = 0; mode_index < install_static::kInstallModes.size();
ASSERT_EQ(static_cast<size_t>(install_static::NUM_INSTALL_MODES),
mode_to_strings.size());
for (int mode_index = 0; mode_index < install_static::NUM_INSTALL_MODES;
++mode_index) {
SCOPED_TRACE(testing::Message() << "install mode index: " << mode_index);
ASSERT_EQ(1U, mode_to_strings.count(mode_index));

@ -1010,8 +1010,9 @@ ShellUtil::DefaultState ProbeCurrentDefaultHandlers(
// See if another mode is the default handler for this protocol.
size_t current_app_len = std::char_traits<wchar_t>::length(current_app);
const auto it = std::ranges::find_if(
install_static::kInstallModes,
const auto* it = std::find_if(
&install_static::kInstallModes[0],
&install_static::kInstallModes[install_static::NUM_INSTALL_MODES],
[current_install_mode_index, &current_app,
current_app_len](const install_static::InstallConstants& mode) {
if (mode.index == current_install_mode_index) {
@ -1028,9 +1029,8 @@ ShellUtil::DefaultState ProbeCurrentDefaultHandlers(
return current_app_len == mode_prog_id_prefix.length() ||
current_app[mode_prog_id_prefix.length()] == L'.';
});
if (it == install_static::kInstallModes.end()) {
if (it == &install_static::kInstallModes[install_static::NUM_INSTALL_MODES])
return ShellUtil::NOT_DEFAULT;
}
other_mode_is_default = true;
}
// This mode is default if it has all of the protocols.