Skip to content

Commit

Permalink
Merge pull request #85 from brave/cleanup_install_mode
Browse files Browse the repository at this point in the history
Support multi channel release on Windows
  • Loading branch information
bbondy authored Apr 11, 2018
2 parents 16f184e + 1be0212 commit 702f616
Show file tree
Hide file tree
Showing 24 changed files with 243 additions and 124 deletions.
11 changes: 10 additions & 1 deletion app/brave_exe.rc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
// Note: chrome/installer/util/shell_util.cc depends on the order and number of
// icons. To avoid breaking existing shortcuts, add new icons at the end
// (following the ordering described above).
#if defined(OFFICIAL_BUILD)
IDR_MAINFRAME ICON "theme\\brave\\win\\brave.ico"
// These three are no longer used, but remain as placeholders. (They cannot be
// removed, or existing shortcuts to the later resources will break.)
Expand All @@ -43,18 +44,26 @@ IDR_MAINFRAME_3 ICON "theme\\brave\\win\\placeholder.ico"
IDR_MAINFRAME_4 ICON "theme\\brave\\win\\placeholder.ico"
// The SXS icon must have an index of 4, the constant is used in Chrome code to
// identify it.
IDR_SXS ICON "theme\\brave\\win\\brave_sxs.ico"
IDR_SXS ICON "theme\\brave\\win\\brave_canary.ico"

// Start a naming scheme to keep icons in order. A leading X is used to keep
// the name alphabetically after IDR_SXS. The maximum of the number that follows
// should be incremented when a new icon is added. The icon indices in
// chrome_icon_resources_win.h should also be updated.
#else
IDR_MAINFRAME ICON "theme\\brave\\win\\brave_development.ico"
#endif

#if defined(OFFICIAL_BUILD)
IDR_X001_APP_LIST ICON "theme\\brave\\win\\app_list.ico"
IDR_X002_APP_LIST_SXS ICON "theme\\brave\\win\\app_list_sxs.ico"
IDR_X003_INCOGNITO ICON "theme\\brave\\win\\incognito.ico"
IDR_X004_DEV ICON "theme\\brave\\win\\brave_dev.ico"
IDR_X005_BETA ICON "theme\\brave\\win\\brave_beta.ico"
#else
IDR_X001_APP_LIST ICON "theme\\brave\\win\\app_list.ico"
IDR_X003_INCOGNITO ICON "theme\\brave\\win\\incognito.ico"
#endif


#endif // English (U.S.) resources
Expand Down
Binary file modified app/theme/brave/win/brave.ico
Binary file not shown.
Binary file modified app/theme/brave/win/brave_beta.ico
Binary file not shown.
Binary file added app/theme/brave/win/brave_canary.ico
Binary file not shown.
Binary file modified app/theme/brave/win/brave_dev.ico
Binary file not shown.
Binary file added app/theme/brave/win/brave_development.ico
Binary file not shown.
Binary file removed app/theme/brave/win/brave_sxs.ico
Binary file not shown.
Binary file removed app/theme/brave/win/chromium.ico
Binary file not shown.
Binary file modified app/theme/brave/win/placeholder.ico
Binary file not shown.
12 changes: 8 additions & 4 deletions chromium_src/BUILD.gn
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
source_set("browser") {
sources = []
if (is_win) {
sources += [
if (is_win) {
source_set("install_static") {
sources = [
"chrome/common/chrome_icon_resources_win.h",
"chrome/install_static/chromium_install_modes.cc",
"chrome/install_static/chromium_install_modes.h",
]
}
}

source_set("browser") {
sources = []
}
source_set("common") {
sources = []
}
Expand Down
22 changes: 15 additions & 7 deletions chromium_src/chrome/common/chrome_icon_resources_win.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,42 @@

namespace icon_resources {

// This file contains the indices of icon resources in chrome_exe.rc.
// This file contains the indices of icon resources in brave_exe.rc.

enum {
// The main application icon is always index 0.
kApplicationIndex = 0,

#if defined(OFFICIAL_BUILD)
// Legacy indices that are no longer used.
kApplication2Index = 1,
kApplication3Index = 2,
kApplication4Index = 3,

// The Chrome Canary application icon.
// The Brave Canary application icon.
kSxSApplicationIndex = 4,

// The Chrome App Launcher icon.
// The Brave App Launcher icon.
kAppLauncherIndex = 5,

// The Chrome App Launcher Canary icon.
// The Brave App Launcher Canary icon.
kSxSAppLauncherIndex = 6,

// The Chrome incognito icon.
// The Brave incognito icon.
kIncognitoIndex = 7,

// The Chrome Dev application icon.
// The Brave Dev application icon.
kDevApplicationIndex = 8,

// The Chrome Beta application icon.
// The Brave Beta application icon.
kBetaApplicationIndex = 9,
#else
// The Brave Developer App Launcher icon.
kAppLauncherIndex = 1,

// The Brave Developer incognito icon.
kIncognitoIndex = 2,
#endif
};

} // namespace icon_resources
Expand Down
57 changes: 49 additions & 8 deletions chromium_src/chrome/install_static/chromium_install_modes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,24 @@ namespace install_static {

const wchar_t kCompanyPathName[] = L"BraveSoftware";

const wchar_t kProductPathName[] = L"Brave";
#if defined(OFFICIAL_BUILD)
const wchar_t kProductPathName[] = L"Brave-Browser";
#else
const wchar_t kProductPathName[] = L"Brave-Browser-Development";
#endif

const size_t kProductPathNameLength = _countof(kProductPathName) - 1;

#if defined(OFFICIAL_BUILD)
const wchar_t kBinariesAppGuid[] = L"{F7526127-0B8A-406F-8998-282BEA40103A}";
#else
const wchar_t kBinariesAppGuid[] = L"";
#endif

// Brave integrates with Brave Update, so the app GUID above is used.
const wchar_t kBinariesPathName[] = L"";

#if defined(OFFICIAL_BUILD)
const InstallConstants kInstallModes[] = {
// The primary install mode for stable Brave.
{
Expand Down Expand Up @@ -56,13 +65,13 @@ const InstallConstants kInstallModes[] = {
{
sizeof(kInstallModes[0]),
BETA_INDEX, // The mode for the side-by-side beta channel.
"brave-beta", // Install switch.
L" Beta", // Install suffix.
"beta", // Install switch.
L"-Beta", // Install suffix.
L"Beta", // Logo suffix.
L"{103BD053-949B-43A8-9120-2E424887DE11}", // A distinct app GUID.
L"Brave Beta", // A distinct base_app_name.
L"BraveBeta", // A distinct base_app_id.
L"BraveHTML", // ProgID prefix.
L"BraveBHTML", // ProgID prefix.
L"Brave Beta HTML Document", // ProgID description.
L"{103BD053-949B-43A8-9120-2E424887DE11}", // Active Setup GUID.
L"", // CommandExecuteImpl CLSID.
Expand All @@ -84,8 +93,8 @@ const InstallConstants kInstallModes[] = {
{
sizeof(kInstallModes[0]),
DEV_INDEX, // The mode for the side-by-side dev channel.
"brave-dev", // Install switch.
L" Dev", // Install suffix.
"dev", // Install switch.
L"-Dev", // Install suffix.
L"Dev", // Logo suffix.
L"{CB2150F2-595F-4633-891A-E39720CE0531}", // A distinct app GUID.
L"Brave Dev", // A distinct base_app_name.
Expand All @@ -112,8 +121,8 @@ const InstallConstants kInstallModes[] = {
{
sizeof(kInstallModes[0]),
CANARY_INDEX, // The mode for the side-by-side canary channel.
"brave-sxs", // Install switch.
L" SxS", // Install suffix.
"canary", // Install switch.
L"-Canary", // Install suffix.
L"Canary", // Logo suffix.
L"{C6CB981E-DB30-4876-8639-109F8933582C}", // A distinct app GUID.
L"Brave Canary", // A distinct base_app_name.
Expand All @@ -137,6 +146,38 @@ const InstallConstants kInstallModes[] = {
IDR_SXS, // App icon resource id.
},
};
#else
const InstallConstants kInstallModes[] = {
// The primary (and only) install mode for Brave developer build.
{
sizeof(kInstallModes[0]),
DEVELOPER_INDEX, // The one and only mode for developer mode.
"", // No install switch for the primary install mode.
L"", // Empty install_suffix for the primary install mode.
L"", // No logo suffix for the primary install mode.
L"", // Empty app_guid since no integraion with Brave Update.
L"Brave Developer", // A distinct base_app_name.
L"BraveDeveloper", // A distinct base_app_id.
L"BraveDevHTM", // ProgID prefix.
L"Brave Developer HTML Document", // ProgID description.
L"{C6CB981E-DB30-4876-8639-109F8933582C}", // Active Setup GUID.
L"{312ABB99-A176-4939-A39F-E8D34EA4D393}", // CommandExecuteImpl CLSID.
{ 0xf2edbc59,
0x7217,
0x4da5,
{ 0xa2, 0x59, 0x3, 0x2, 0xda, 0x6a, 0x0,
0xe1 } }, // Toast activator CLSID.
L"", // Empty default channel name since no update integration.
ChannelStrategy::UNSUPPORTED,
true, // Supports system-level installs.
true, // Supports in-product set as default browser UX.
false, // Does not support retention experiments.
true, // Supported multi-install.
icon_resources::kApplicationIndex, // App icon resource index.
IDR_MAINFRAME, // App icon resource id.
},
};
#endif

static_assert(_countof(kInstallModes) == NUM_INSTALL_MODES,
"Imbalance between kInstallModes and InstallConstantIndex");
Expand Down
4 changes: 4 additions & 0 deletions chromium_src/chrome/install_static/chromium_install_modes.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,14 @@ enum : bool {
// Note: This list of indices must be kept in sync with the brand-specific
// resource strings in chrome/installer/util/prebuild/create_string_rc.
enum InstallConstantIndex {
#if defined(OFFICIAL_BUILD)
STABLE_INDEX,
BETA_INDEX,
DEV_INDEX,
CANARY_INDEX,
#else
DEVELOPER_INDEX,
#endif
NUM_INSTALL_MODES,
};

Expand Down
42 changes: 0 additions & 42 deletions chromium_src/common/chrome_icon_resources_win.h

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
'IDS_APP_SHORTCUTS_SUBDIR_NAME_DEV',
'IDS_APP_SHORTCUTS_SUBDIR_NAME_CANARY',
],
'brave-development': [
'IDS_APP_SHORTCUTS_SUBDIR_NAME',
],
},
'IDS_INBOUND_MDNS_RULE_DESCRIPTION': {
'google_chrome': [
Expand All @@ -32,6 +35,9 @@
'IDS_INBOUND_MDNS_RULE_DESCRIPTION_DEV',
'IDS_INBOUND_MDNS_RULE_DESCRIPTION_CANARY',
],
'brave-development': [
'IDS_INBOUND_MDNS_RULE_DESCRIPTION',
],
},
'IDS_INBOUND_MDNS_RULE_NAME': {
'google_chrome': [
Expand All @@ -49,6 +55,9 @@
'IDS_INBOUND_MDNS_RULE_NAME_DEV',
'IDS_INBOUND_MDNS_RULE_NAME_CANARY',
],
'brave-development': [
'IDS_INBOUND_MDNS_RULE_NAME',
],
},
# In contrast to the strings above, this one (IDS_PRODUCT_NAME) is used
# throughout Chrome in mode-independent contexts. Within the installer (the
Expand All @@ -70,5 +79,8 @@
'IDS_SHORTCUT_NAME_DEV',
'IDS_SXS_SHORTCUT_NAME',
],
'brave-development': [
'IDS_PRODUCT_NAME',
],
},
}
Loading

0 comments on commit 702f616

Please sign in to comment.