├── .github
└── workflows
│ └── winget-releaser.yml
├── README.md
├── depot_tools
├── .gclient
└── src
│ └── out
│ ├── stable-nosync-x64
│ └── args.gn
│ ├── stable-sync-x64
│ └── args.gn
│ └── stable-undefined-noarch
│ └── args.gn
├── installer
└── OfflineManifest.gup
├── internal
└── .gitkeep
├── out
├── noarch
│ └── .gitkeep
└── x64
│ └── .gitkeep
├── patch
├── 0001-Patch-installer-to-close-previous-browser-instance-o.patch
├── 0002-Patch-updater-to-work-with-unsigned-and-unbranded-bu.patch
├── 0003-Ensure-bogus-ElevationService-is-not-being-created-d.patch
└── 0004-Fix-Grit-branding-args-for-policy_templates.patch
├── scripts
├── build.cmd
├── checkout.cmd
├── clean.cmd
├── out.cmd
├── patch.cmd
├── provision.cmd
└── version.sh
└── shell.cmd
/.github/workflows/winget-releaser.yml:
--------------------------------------------------------------------------------
1 | name: Publish to WinGet
2 | on:
3 | release:
4 | types: [released]
5 | jobs:
6 | publish:
7 | runs-on: windows-latest
8 | steps:
9 | - name: Get version
10 | id: get-version
11 | run: |
12 | $VERSION="${{ github.event.release.name }}" -replace '^v?([0-9\.]+).*','$1'
13 | "version=$VERSION" >> $env:GITHUB_OUTPUT
14 | shell: pwsh
15 | - uses: vedantmgoyal9/winget-releaser@main
16 | with:
17 | identifier: Hibbiki.Chromium
18 | version: ${{ steps.get-version.outputs.version }}
19 | installers-regex: 'mini_installer\.sync\.exe'
20 | max-versions-to-keep: 0
21 | token: ${{ secrets.WINGET_TOKEN }}
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Chromium for Windows x64
2 | Stable Chromium builds for Windows 64-bit, nothing fancy.
3 |
4 | ## Build setup
5 | Built using Visual Studio 2022 v17.13.6 + SDK 10.0.26100.2454 on Windows 10 virtual machine.
6 |
7 | ## General configuration
8 | - H.264, HEVC and other proprietary codecs enabled
9 | - Field trials (variations) disabled
10 | - Official build
11 |
12 | ### Builds with sync
13 | - Widevine support
14 | - Sync enabled using Google API keys
15 |
16 | ### Builds without sync
17 | - No Widevine support
18 | - Sync disabled; no Google API keys
19 |
--------------------------------------------------------------------------------
/depot_tools/.gclient:
--------------------------------------------------------------------------------
1 | solutions = [
2 | {
3 | "name": "src",
4 | "url": "https://chromium.googlesource.com/chromium/src.git",
5 | "managed": False,
6 | "custom_deps": {},
7 | "custom_vars": {
8 | "checkout_pgo_profiles": True,
9 | },
10 | },
11 | ]
12 |
--------------------------------------------------------------------------------
/depot_tools/src/out/stable-nosync-x64/args.gn:
--------------------------------------------------------------------------------
1 | enable_platform_ac3_eac3_audio = true
2 | enable_platform_hevc = true
3 | enable_iterator_debugging = false
4 | enable_mse_mpeg2ts_stream_parser = true
5 | ffmpeg_branding = "Chrome"
6 | is_component_build = false
7 | is_debug = false
8 | proprietary_codecs = true
9 | symbol_level = 0
10 | target_cpu = "x64"
11 | enable_hangout_services_extension = false
12 | enable_widevine = false
13 | rtc_use_h264 = true
14 | google_api_key = "no"
15 | google_default_client_id = "no"
16 | google_default_client_secret = "no"
17 | use_official_google_api_keys = false
18 | is_official_build = true
19 | enable_resource_allowlist_generation = false
20 | visual_studio_version = "2022"
21 | blink_symbol_level = 0
22 | enable_platform_mpeg_h_audio = true
23 | rtc_build_examples = false
24 | thin_lto_enable_optimizations = true
25 | is_chrome_branded = false
26 | disable_fieldtrial_testing_config = true
27 | use_thin_lto = true
28 | use_lld = true
29 | enable_profiling = false
--------------------------------------------------------------------------------
/depot_tools/src/out/stable-sync-x64/args.gn:
--------------------------------------------------------------------------------
1 | enable_platform_ac3_eac3_audio = true
2 | enable_platform_hevc = true
3 | enable_iterator_debugging = false
4 | enable_mse_mpeg2ts_stream_parser = true
5 | ffmpeg_branding = "Chrome"
6 | is_component_build = false
7 | is_debug = false
8 | proprietary_codecs = true
9 | symbol_level = 0
10 | target_cpu = "x64"
11 | enable_hangout_services_extension = true
12 | enable_widevine = true
13 | rtc_use_h264 = true
14 | use_official_google_api_keys = true
15 | is_official_build = true
16 | enable_resource_allowlist_generation = false
17 | visual_studio_version = "2022"
18 | blink_symbol_level = 0
19 | enable_platform_mpeg_h_audio = true
20 | rtc_build_examples = false
21 | thin_lto_enable_optimizations = true
22 | is_chrome_branded = false
23 | disable_fieldtrial_testing_config = true
24 | use_thin_lto = true
25 | use_lld = true
26 | enable_profiling = false
--------------------------------------------------------------------------------
/depot_tools/src/out/stable-undefined-noarch/args.gn:
--------------------------------------------------------------------------------
1 | is_component_build = false
2 | is_debug = false
3 | is_official_build = true
4 | visual_studio_version = "2022"
5 | is_chrome_branded = false
--------------------------------------------------------------------------------
/installer/OfflineManifest.gup:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/internal/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Hibbiki/chromium-win64/d0373e24f608118408ad353a437e5ab4d7a1cd5c/internal/.gitkeep
--------------------------------------------------------------------------------
/out/noarch/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Hibbiki/chromium-win64/d0373e24f608118408ad353a437e5ab4d7a1cd5c/out/noarch/.gitkeep
--------------------------------------------------------------------------------
/out/x64/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Hibbiki/chromium-win64/d0373e24f608118408ad353a437e5ab4d7a1cd5c/out/x64/.gitkeep
--------------------------------------------------------------------------------
/patch/0001-Patch-installer-to-close-previous-browser-instance-o.patch:
--------------------------------------------------------------------------------
1 | From bd9ba153154b8a222aa8f8b3075e1948774dd4b9 Mon Sep 17 00:00:00 2001
2 | From: Hibiki Tachibana <57486057+Hibbiki@users.noreply.github.com>
3 | Date: Thu, 5 Aug 2021 02:09:34 +0200
4 | Subject: [PATCH 1/4] Patch installer to close previous browser instance on
5 | system-level install
6 |
7 | Signed-off-by: Hibiki Tachibana <57486057+Hibbiki@users.noreply.github.com>
8 | ---
9 | chrome/installer/setup/install_worker.cc | 48 ++++++++++++++++++++++++
10 | 1 file changed, 48 insertions(+)
11 |
12 | diff --git a/chrome/installer/setup/install_worker.cc b/chrome/installer/setup/install_worker.cc
13 | index 011684089a29e..f1dec3e02d2b5 100644
14 | --- a/chrome/installer/setup/install_worker.cc
15 | +++ b/chrome/installer/setup/install_worker.cc
16 | @@ -29,6 +29,8 @@
17 | #include "base/functional/bind.h"
18 | #include "base/functional/callback_helpers.h"
19 | #include "base/logging.h"
20 | +#include "base/process/kill.h"
21 | +#include "base/process/process_iterator.h"
22 | #include "base/strings/string_util.h"
23 | #include "base/strings/utf_string_conversions.h"
24 | #include "base/version.h"
25 | @@ -39,6 +41,7 @@
26 | #include "base/win/win_util.h"
27 | #include "base/win/windows_version.h"
28 | #include "build/branding_buildflags.h"
29 | +#include "content/public/common/result_codes.h"
30 | #include "chrome/install_static/buildflags.h"
31 | #include "chrome/install_static/install_details.h"
32 | #include "chrome/install_static/install_modes.h"
33 | @@ -218,6 +221,46 @@ void AddDeleteUninstallEntryForMSIWorkItems(
34 | delete_reg_key->set_best_effort(true);
35 | }
36 |
37 | +// Filter for processes whose base name matches and whose path starts with a
38 | +// specified prefix.
39 | +class ProcessPathPrefixFilter : public base::ProcessFilter {
40 | + public:
41 | + explicit ProcessPathPrefixFilter(
42 | + base::FilePath::StringViewType process_path_prefix)
43 | + : process_path_prefix_(process_path_prefix) {}
44 | +
45 | + // base::ProcessFilter:
46 | + bool Includes(const base::ProcessEntry& entry) const override {
47 | + // Test if |entry|'s file path starts with the prefix we're looking for.
48 | + base::Process process(::OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION,
49 | + FALSE, entry.th32ProcessID));
50 | + if (!process.IsValid())
51 | + return false;
52 | +
53 | + DWORD path_len = MAX_PATH;
54 | + wchar_t path_string[MAX_PATH];
55 | + if (::QueryFullProcessImageName(process.Handle(), 0, path_string,
56 | + &path_len)) {
57 | + base::FilePath file_path(path_string);
58 | + return base::StartsWith(file_path.value(), process_path_prefix_,
59 | + base::CompareCase::INSENSITIVE_ASCII);
60 | + }
61 | + PLOG(WARNING) << "QueryFullProcessImageName failed for PID "
62 | + << entry.th32ProcessID;
63 | + return false;
64 | + }
65 | +
66 | + private:
67 | + const base::FilePath::StringViewType process_path_prefix_;
68 | +};
69 | +
70 | +// Gracefully closes previous Chrome process in |target_path|.
71 | +void ClosePreviousChromeProcess(const base::FilePath& target_path) {
72 | + ProcessPathPrefixFilter target_path_filter(target_path.value());
73 | + base::CleanupProcesses(installer::kChromeExe, base::TimeDelta(),
74 | + content::RESULT_CODE_NORMAL_EXIT, &target_path_filter);
75 | +}
76 | +
77 | // Adds Chrome specific install work items to |install_list|.
78 | void AddChromeWorkItems(const InstallParams& install_params,
79 | WorkItemList* install_list) {
80 | @@ -230,6 +273,11 @@ void AddChromeWorkItems(const InstallParams& install_params,
81 |
82 | const base::FilePath& target_path = installer_state.target_path();
83 |
84 | + // patch(Hibbiki): Close previous instance on system-install as we are missing
85 | + // required GoogleUpdate component to elevate and rename new_chrome.exe on exit.
86 | + if (installer_state.system_install())
87 | + ClosePreviousChromeProcess(target_path);
88 | +
89 | if (current_version.IsValid()) {
90 | // Delete the archive from an existing install to save some disk space.
91 | base::FilePath old_installer_dir(
92 | --
93 | 2.47.0.windows.2
94 |
95 |
--------------------------------------------------------------------------------
/patch/0002-Patch-updater-to-work-with-unsigned-and-unbranded-bu.patch:
--------------------------------------------------------------------------------
1 | From 2cd0e2ec0ca4e4144a50d45d2c1316b0acc84d3d Mon Sep 17 00:00:00 2001
2 | From: Hibiki Tachibana <57486057+Hibbiki@users.noreply.github.com>
3 | Date: Wed, 12 Jun 2024 02:14:41 +0200
4 | Subject: [PATCH 2/4] Patch updater to work with unsigned and unbranded builds
5 |
6 | Signed-off-by: Hibiki Tachibana <57486057+Hibbiki@users.noreply.github.com>
7 | ---
8 | .../install_static/chromium_install_modes.h | 3 +--
9 | chrome/updater/BUILD.gn | 1 +
10 | chrome/updater/win/installer/installer.cc | 15 +++++++++++++
11 | chrome/updater/win/signing/sign.py | 21 ++-----------------
12 | 4 files changed, 19 insertions(+), 21 deletions(-)
13 |
14 | diff --git a/chrome/install_static/chromium_install_modes.h b/chrome/install_static/chromium_install_modes.h
15 | index 7de32cf745755..9bbb8ecadd23a 100644
16 | --- a/chrome/install_static/chromium_install_modes.h
17 | +++ b/chrome/install_static/chromium_install_modes.h
18 | @@ -32,8 +32,7 @@ inline constexpr auto kInstallModes = std::to_array({
19 | .install_suffix =
20 | L"", // Empty install_suffix for the primary install mode.
21 | .logo_suffix = L"", // No logo suffix for the primary install mode.
22 | - .app_guid =
23 | - L"", // Empty app_guid since no integration with Google Update.
24 | + .app_guid = L"{7D2B3E1D-D096-4594-9D8F-A6667F12E0AC}",
25 | .base_app_name = L"Chromium", // A distinct base_app_name.
26 | .base_app_id = L"Chromium", // A distinct base_app_id.
27 | .browser_prog_id_prefix = L"ChromiumHTM", // Browser ProgID prefix.
28 | diff --git a/chrome/updater/BUILD.gn b/chrome/updater/BUILD.gn
29 | index be753c0ee2ce3..1c64d5d6ee715 100644
30 | --- a/chrome/updater/BUILD.gn
31 | +++ b/chrome/updater/BUILD.gn
32 | @@ -358,6 +358,7 @@ if (is_win || is_mac || is_linux) {
33 | "//chrome/installer/util:constants",
34 | "//chrome/installer/util:metainstaller_utils",
35 | "//chrome/installer/util:work_item",
36 | + "//chrome/install_static:install_static_util",
37 | "//chrome/updater/app/server/win:updater_idl",
38 | "//chrome/updater/app/server/win:updater_idl_system",
39 | "//chrome/updater/app/server/win:updater_idl_user",
40 | diff --git a/chrome/updater/win/installer/installer.cc b/chrome/updater/win/installer/installer.cc
41 | index 25e161d28dc56..51df12a584b5e 100644
42 | --- a/chrome/updater/win/installer/installer.cc
43 | +++ b/chrome/updater/win/installer/installer.cc
44 | @@ -11,6 +11,11 @@
45 | // LZMA file, which is further compressed as one file, and inserted as a
46 | // binary resource in the resource section of the setup program.
47 |
48 | +#ifdef UNSAFE_BUFFERS_BUILD
49 | +// TODO(crbug.com/40285824): Remove this and spanify to fix the errors.
50 | +#pragma allow_unsafe_buffers
51 | +#endif
52 | +
53 | #include "chrome/updater/win/installer/installer.h"
54 |
55 | #include
56 | @@ -30,6 +35,7 @@
57 | #include "base/memory/ref_counted.h"
58 | #include "base/path_service.h"
59 | #include "base/strings/strcat.h"
60 | +#include "base/strings/stringprintf.h"
61 | #include "base/strings/utf_string_conversions.h"
62 | #include "base/synchronization/waitable_event.h"
63 | #include "base/task/thread_pool.h"
64 | @@ -44,6 +50,7 @@
65 | #include "base/win/scoped_localalloc.h"
66 | #include "base/win/windows_version.h"
67 | #include "chrome/installer/util/lzma_util.h"
68 | +#include "chrome/install_static/install_modes.h"
69 | #include "chrome/updater/branded_constants.h"
70 | #include "chrome/updater/constants.h"
71 | #include "chrome/updater/ping_configurator.h"
72 | @@ -74,11 +81,19 @@ namespace {
73 | // program file image used to create this process. The implementation of this
74 | // function only handles UTF8 tags.
75 | std::string ExtractTag() {
76 | +#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
77 | PathString path;
78 | return (::GetModuleFileName(nullptr, path.get(), path.capacity()) > 0 &&
79 | ::GetLastError() == ERROR_SUCCESS)
80 | ? tagging::BinaryReadTagString(base::FilePath(path.get()))
81 | : std::string();
82 | +#elif BUILDFLAG(GOOGLE_CHROME_FOR_TESTING_BRANDING)
83 | + const install_static::InstallConstants& mode = install_static::kInstallModes[install_static::GOOGLE_CHROME_FOR_TESTING_INDEX];
84 | + return base::StringPrintf("appguid=%s&appname=%s", mode.app_guid, mode.base_app_id);
85 | +#else
86 | + const install_static::InstallConstants& mode = install_static::kInstallModes[install_static::CHROMIUM_INDEX];
87 | + return base::StringPrintf("appguid=%s&appname=%s", mode.app_guid, mode.base_app_id);
88 | +#endif
89 | }
90 |
91 | // Shows a splash screen "Initializing...".
92 | diff --git a/chrome/updater/win/signing/sign.py b/chrome/updater/win/signing/sign.py
93 | index fe16f52a91ec0..1fd3fae8c4484 100755
94 | --- a/chrome/updater/win/signing/sign.py
95 | +++ b/chrome/updater/win/signing/sign.py
96 | @@ -98,28 +98,11 @@ class Signer:
97 | self._sign_flags = sign_flags
98 |
99 | def _add_tagging_cert(self, in_file, out_file):
100 | - """Adds the tagging cert. Returns the path to the tagged file."""
101 | - subprocess.run(
102 | - [self._tagging_exe, '--set-tag',
103 | - '--out=%s' % out_file, in_file],
104 | - check=True)
105 | + shutil.copy(in_file, out_file)
106 | return out_file
107 |
108 | def _sign_item(self, in_file):
109 | - """Sign an executable in-place."""
110 | - # Retries may be required: lore states the timestamp server is flaky.
111 | - for flags in self._sign_flags:
112 | - command = [self._signtool_exe, 'sign']
113 | - command += flags
114 | - if self._certificate_file_path:
115 | - command += ['/f', self._certificate_file_path]
116 | - if self._certificate_password:
117 | - command += ['/p', self._certificate_password]
118 | - if self._identity:
119 | - command += ['/s', 'My', '/n', self._identity]
120 | -
121 | - command += [in_file]
122 | - subprocess.run(command, check=True)
123 | + return
124 |
125 | def _generate_target_manifest(self, appid, installer_path, manifest_path,
126 | manifest_dict_replacements):
127 | --
128 | 2.47.0.windows.2
129 |
130 |
--------------------------------------------------------------------------------
/patch/0003-Ensure-bogus-ElevationService-is-not-being-created-d.patch:
--------------------------------------------------------------------------------
1 | From 539d2f67558aca8524df8816c48cf4f29d808b99 Mon Sep 17 00:00:00 2001
2 | From: Hibiki Tachibana <57486057+Hibbiki@users.noreply.github.com>
3 | Date: Sat, 22 Jul 2023 01:33:35 +0200
4 | Subject: [PATCH 3/4] Ensure bogus ElevationService is not being created during
5 | install
6 |
7 | Signed-off-by: Hibiki Tachibana <57486057+Hibbiki@users.noreply.github.com>
8 | ---
9 | chrome/installer/setup/install_worker.cc | 8 ++++++--
10 | 1 file changed, 6 insertions(+), 2 deletions(-)
11 |
12 | diff --git a/chrome/installer/setup/install_worker.cc b/chrome/installer/setup/install_worker.cc
13 | index f1dec3e02d2b5..547bf7066013f 100644
14 | --- a/chrome/installer/setup/install_worker.cc
15 | +++ b/chrome/installer/setup/install_worker.cc
16 | @@ -345,6 +345,7 @@ void AddChromeWorkItems(const InstallParams& install_params,
17 | ->set_best_effort(true);
18 | }
19 |
20 | +#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
21 | // Adds work items to register the Elevation Service with Windows. Only for
22 | // system level installs.
23 | void AddElevationServiceWorkItems(const base::FilePath& elevation_service_path,
24 | @@ -430,7 +431,6 @@ void AddTracingServiceWorkItems(const InstallationState& original_state,
25 | }
26 | }
27 |
28 | -#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
29 | // Adds work items to add the "store-dmtoken" command to Chrome's version key.
30 | // This method is a no-op if this is anything other than system-level Chrome.
31 | // The command is used when enrolling Chrome browser instances into enterprise
32 | @@ -1030,7 +1030,7 @@ void AddInstallWorkItems(const InstallParams& install_params,
33 | install_list);
34 | AddEnterpriseDeviceTrustWorkItems(installer_state, setup_path, new_version,
35 | install_list);
36 | -#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING
37 | +#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING)
38 | AddFirewallRulesWorkItems(installer_state, !current_version.IsValid(),
39 | install_list);
40 |
41 | @@ -1040,10 +1040,12 @@ void AddInstallWorkItems(const InstallParams& install_params,
42 | installer_state.root_key(),
43 | GetNotificationHelperPath(target_path, new_version), install_list);
44 |
45 | +#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
46 | if (installer_state.system_install()) {
47 | AddElevationServiceWorkItems(
48 | GetElevationServicePath(target_path, new_version), install_list);
49 | }
50 | +#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING)
51 |
52 | AddUpdateDowngradeVersionItem(installer_state.root_key(), current_version,
53 | new_version, install_list);
54 | @@ -1323,10 +1325,12 @@ void AddFinalizeUpdateWorkItems(const InstallationState& original_state,
55 | AddWerHelperRegistration(installer_state.root_key(),
56 | GetWerHelperPath(target_path, new_version), list);
57 |
58 | +#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
59 | if (installer_state.system_install()) {
60 | AddTracingServiceWorkItems(
61 | original_state, GetTracingServicePath(target_path, new_version), list);
62 | }
63 | +#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING)
64 |
65 | const std::wstring client_state_key = install_static::GetClientStateKeyPath();
66 |
67 | --
68 | 2.47.0.windows.2
69 |
70 |
--------------------------------------------------------------------------------
/patch/0004-Fix-Grit-branding-args-for-policy_templates.patch:
--------------------------------------------------------------------------------
1 | From 18d948f4ec0a26d33e7bf459c259554115318452 Mon Sep 17 00:00:00 2001
2 | From: Hibiki Tachibana <57486057+Hibbiki@users.noreply.github.com>
3 | Date: Thu, 3 Aug 2023 11:25:53 +0200
4 | Subject: [PATCH 4/4] Fix Grit branding args for policy_templates
5 |
6 | Signed-off-by: Hibiki Tachibana <57486057+Hibbiki@users.noreply.github.com>
7 | ---
8 | .../template_writers/writer_configuration.py | 81 +++++++++----------
9 | 1 file changed, 38 insertions(+), 43 deletions(-)
10 |
11 | diff --git a/components/policy/tools/template_writers/writer_configuration.py b/components/policy/tools/template_writers/writer_configuration.py
12 | index 283ea725c5a18..f50b5ce395308 100755
13 | --- a/components/policy/tools/template_writers/writer_configuration.py
14 | +++ b/components/policy/tools/template_writers/writer_configuration.py
15 | @@ -10,9 +10,6 @@ def GetConfigurationForBuild(defines):
16 |
17 | Args:
18 | defines: Definitions coming from the build system.
19 | -
20 | - Raises:
21 | - Exception: If 'defines' contains an unknown build-type.
22 | '''
23 | # The prefix of key names in config determines which writer will use their
24 | # corresponding values:
25 | @@ -24,45 +21,7 @@ def GetConfigurationForBuild(defines):
26 | # Google:Cat_Google references the external google.admx file.
27 | # category_path_strings strings in curly braces are looked up from localized
28 | # 'messages' in policy_templates.json.
29 | - if '_chromium' in defines:
30 | - config = {
31 | - 'build': 'chromium',
32 | - 'app_name': 'Chromium',
33 | - 'doc_url': 'https://chromeenterprise.google/policies/',
34 | - 'frame_name': 'Chromium Frame',
35 | - 'os_name': 'ChromiumOS',
36 | - 'webview_name': 'Chromium WebView',
37 | - 'win_config': {
38 | - 'win': {
39 | - 'reg_mandatory_key_name': 'Software\\Policies\\Chromium',
40 | - 'reg_recommended_key_name':
41 | - 'Software\\Policies\\Chromium\\Recommended',
42 | - 'mandatory_category_path': ['chromium'],
43 | - 'recommended_category_path': ['chromium_recommended'],
44 | - 'category_path_strings': {
45 | - 'chromium': 'Chromium',
46 | - 'chromium_recommended': 'Chromium - {doc_recommended}',
47 | - },
48 | - 'namespace': 'Chromium.Policies.Chromium',
49 | - },
50 | - 'chrome_os': {
51 | - 'reg_mandatory_key_name': 'Software\\Policies\\ChromiumOS',
52 | - 'reg_recommended_key_name':
53 | - 'Software\\Policies\\ChromiumOS\\Recommended',
54 | - 'mandatory_category_path': ['chromium_os'],
55 | - 'recommended_category_path': ['chromium_os_recommended'],
56 | - 'category_path_strings': {
57 | - 'chromium_os': 'ChromiumOS',
58 | - 'chromium_os_recommended': 'ChromiumOS - {doc_recommended}',
59 | - },
60 | - 'namespace': 'Chromium.Policies.ChromiumOS'
61 | - },
62 | - },
63 | - 'admx_prefix': 'chromium',
64 | - 'linux_policy_path': '/etc/chromium/policies/',
65 | - 'bundle_id': 'org.chromium',
66 | - }
67 | - elif '_google_chrome' in defines or '_is_chrome_for_testing_branded' in defines:
68 | + if defines.get('_google_chrome', False) == True or defines.get('_is_chrome_for_testing_branded', False) == True:
69 | if '_google_chrome' in defines:
70 | linux_policy_path = '/etc/opt/chrome/policies/'
71 | win_policy_path = 'Software\\Policies\\Google\\Chrome'
72 | @@ -126,7 +85,43 @@ def GetConfigurationForBuild(defines):
73 | 'bundle_id': 'com.google.chrome.ios',
74 | }
75 | else:
76 | - raise Exception('Unknown build')
77 | + config = {
78 | + 'build': 'chromium',
79 | + 'app_name': 'Chromium',
80 | + 'doc_url': 'https://chromeenterprise.google/policies/',
81 | + 'frame_name': 'Chromium Frame',
82 | + 'os_name': 'ChromiumOS',
83 | + 'webview_name': 'Chromium WebView',
84 | + 'win_config': {
85 | + 'win': {
86 | + 'reg_mandatory_key_name': 'Software\\Policies\\Chromium',
87 | + 'reg_recommended_key_name':
88 | + 'Software\\Policies\\Chromium\\Recommended',
89 | + 'mandatory_category_path': ['chromium'],
90 | + 'recommended_category_path': ['chromium_recommended'],
91 | + 'category_path_strings': {
92 | + 'chromium': 'Chromium',
93 | + 'chromium_recommended': 'Chromium - {doc_recommended}',
94 | + },
95 | + 'namespace': 'Chromium.Policies.Chromium',
96 | + },
97 | + 'chrome_os': {
98 | + 'reg_mandatory_key_name': 'Software\\Policies\\ChromiumOS',
99 | + 'reg_recommended_key_name':
100 | + 'Software\\Policies\\ChromiumOS\\Recommended',
101 | + 'mandatory_category_path': ['chromium_os'],
102 | + 'recommended_category_path': ['chromium_os_recommended'],
103 | + 'category_path_strings': {
104 | + 'chromium_os': 'ChromiumOS',
105 | + 'chromium_os_recommended': 'ChromiumOS - {doc_recommended}',
106 | + },
107 | + 'namespace': 'Chromium.Policies.ChromiumOS'
108 | + },
109 | + },
110 | + 'admx_prefix': 'chromium',
111 | + 'linux_policy_path': '/etc/chromium/policies/',
112 | + 'bundle_id': 'org.chromium',
113 | + }
114 | if 'version' in defines:
115 | config['version'] = defines['version']
116 | if 'major_version' in defines:
117 | --
118 | 2.47.0.windows.2
119 |
120 |
--------------------------------------------------------------------------------
/scripts/build.cmd:
--------------------------------------------------------------------------------
1 | @echo off
2 |
3 | IF NOT DEFINED IN_CHROMIUM_BUILDER (goto :EOF)
4 | cd %CHROMIUM_DIR%\depot_tools
5 |
6 | cd src
7 | cmd /c "gn gen out\stable-sync-x64"
8 | cmd /c "autoninja -C out/stable-sync-x64 chrome_official_builder_no_unittests"
9 | cmd /c "gn gen out\stable-nosync-x64"
10 | cmd /c "autoninja -C out/stable-nosync-x64 chrome_official_builder_no_unittests"
11 |
12 | cmd /c "gn clean out\stable-undefined-noarch"
13 | cmd /c "gn gen out\stable-undefined-noarch"
14 | cmd /c "autoninja -C out/stable-undefined-noarch pack_policy_templates"
15 | cd ..
--------------------------------------------------------------------------------
/scripts/checkout.cmd:
--------------------------------------------------------------------------------
1 | @echo off
2 |
3 | IF NOT DEFINED IN_CHROMIUM_BUILDER (goto :EOF)
4 | cd %CHROMIUM_DIR%\depot_tools
5 |
6 | FOR /F "tokens=* USEBACKQ" %%F IN (`bash version.sh %*`) DO (
7 | SET VERSION=%%F
8 | )
9 |
10 | cd src
11 | cmd /c "git reset --hard"
12 | cmd /c "git -c core.deltaBaseCacheLimit=2g fetch --tags --progress"
13 | cmd /c "git checkout %VERSION%"
14 | cmd /c "gclient sync --with_branch_heads -f -R -D"
15 | cmd /c "python3 -m pip install pywin32"
16 | del /Q out\stable-sync-x64\*.manifest
17 | del /Q out\stable-nosync-x64\*.manifest
18 | cd ..
19 |
20 | call patch.cmd
--------------------------------------------------------------------------------
/scripts/clean.cmd:
--------------------------------------------------------------------------------
1 | @echo off
2 |
3 | IF NOT DEFINED IN_CHROMIUM_BUILDER (goto :EOF)
4 | cd %CHROMIUM_DIR%\depot_tools
5 |
6 | cd src
7 | cmd /c "gn clean out\stable-sync-x64"
8 | cmd /c "gn clean out\stable-nosync-x64"
9 | cmd /c "gn clean out\stable-undefined-noarch"
10 | cd ..
--------------------------------------------------------------------------------
/scripts/out.cmd:
--------------------------------------------------------------------------------
1 | @echo off
2 |
3 | IF NOT DEFINED IN_CHROMIUM_BUILDER (goto :EOF)
4 | cd %CHROMIUM_DIR%\depot_tools
5 |
6 | FOR /F "tokens=* USEBACKQ" %%F IN (`type ..\out\revision`) DO (
7 | SET VERSION=%%F
8 | )
9 |
10 | echo Preparing %VERSION%
11 | echo.
12 | call :GetInstaller "stable-sync-x64" "mini_installer.sync.exe"
13 | call :GetArchive "stable-sync-x64" "chrome.sync.7z"
14 | call :GetInstaller "stable-nosync-x64" "mini_installer.nosync.exe"
15 | call :GetArchive "stable-nosync-x64" "chrome.nosync.7z"
16 | call :GetPolicyTemplates
17 | echo.
18 | call :GetChecksum "x64/mini_installer.sync.exe"
19 | call :GetChecksum "x64/chrome.sync.7z"
20 | call :GetChecksum "x64/mini_installer.nosync.exe"
21 | call :GetChecksum "x64/chrome.nosync.7z"
22 | call :GetChecksum "noarch/policy_templates.zip"
23 | goto :eof
24 |
25 | :GetUpdater
26 | cmd /q /c python3 src\out\%~1\UpdaterSigning\sign.py --in_file src\out\%~1\UpdaterSetup.exe --out_file %CHROMIUM_DIR%\out\x64\%~2 ^
27 | --appid {7D2B3E1D-D096-4594-9D8F-A6667F12E0AC} ^
28 | --installer_path src\out\%~1\mini_installer.exe ^
29 | --manifest_path %CHROMIUM_DIR%\installer\OfflineManifest.gup ^
30 | --lzma_7z "C:/Program Files/7-Zip/7z.exe" ^
31 | --manifest_dict_replacements "{'${INSTALLER_VERSION}':'%VERSION%', '${ARCH_REQUIREMENT}':'x64'}"
32 | exit /b
33 |
34 | :GetInstaller
35 | copy /Y src\out\%~1\mini_installer.exe %CHROMIUM_DIR%\out\x64\%~2
36 | exit /b
37 |
38 | :GetArchive
39 | copy /Y src\out\%~1\chrome.7z %CHROMIUM_DIR%\out\x64\%~2
40 | exit /b
41 |
42 | :GetPolicyTemplates
43 | copy /Y src\out\stable-undefined-noarch\policy_templates.zip %CHROMIUM_DIR%\out\noarch\policy_templates.zip
44 | exit /b
45 |
46 | :GetChecksum
47 | cmd /c "pushd %CHROMIUM_DIR% && wsl sha1sum ../out/%~1"
48 | exit /b
--------------------------------------------------------------------------------
/scripts/patch.cmd:
--------------------------------------------------------------------------------
1 | @echo off
2 |
3 | IF NOT DEFINED IN_CHROMIUM_BUILDER (goto :EOF)
4 | cd %CHROMIUM_DIR%\depot_tools
5 |
6 | cd src
7 | FOR %%f IN (%CHROMIUM_DIR%\patch\*.patch) DO git am --reject --signoff < %%f
8 | cd ..
--------------------------------------------------------------------------------
/scripts/provision.cmd:
--------------------------------------------------------------------------------
1 | @echo off
2 |
3 | IF NOT DEFINED IN_CHROMIUM_BUILDER (goto :EOF)
4 | cd %CHROMIUM_DIR%\depot_tools
5 |
6 | gclient sync && xcopy /f /s /e /i ..\internal src\google_apis\internal
--------------------------------------------------------------------------------
/scripts/version.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | function printHelp() {
4 | echo "$0 usage:" && grep " .)\ #" $0; exit 0;
5 | }
6 |
7 | function manualVersionInput() {
8 | read -p "Provide version for build: " CUR_VERSION
9 | echo $CUR_VERSION
10 | }
11 |
12 | function getVersionOnline() {
13 | VERSIONS=$(curl -s 'https://versionhistory.googleapis.com/v1/chrome/platforms/win64/channels/stable/versions/all/releases?filter=fraction%3E0.9,endtime=none')
14 | CUR_VERSION=$(echo $VERSIONS | jq -e -r '.releases[0].version')
15 | if [ $? -ne 0 ]; then
16 | read -p "Unable to determine current stable version, provide manually: " CUR_VERSION
17 | fi
18 | echo $CUR_VERSION
19 | }
20 |
21 | function getBranchPos() {
22 | RELEASES=$(curl -s 'https://chromiumdash.appspot.com/fetch_releases?channel=Stable&platform=Windows')
23 | CUR_BRANCH_POS=$(echo $RELEASES | jq -e -r ".[] | select(.version==\"$1\").chromium_main_branch_position")
24 | if [ $? -ne 0 ]; then
25 | read -p "Unable to resolve version to branch position, provide manually: " CUR_BRANCH_POS
26 | fi
27 | echo $CUR_BRANCH_POS
28 | }
29 |
30 | # ---
31 |
32 | while getopts hno f; do
33 | case "${f}" in
34 | n) # Asks for manual version input
35 | CUR_VERSION=$(manualVersionInput)
36 | ;;
37 | o) # Fetches current stable version online
38 | CUR_VERSION=$(getVersionOnline)
39 | ;;
40 | h) # Display this help message
41 | printHelp
42 | ;;
43 | ?) exit 1;;
44 | esac
45 | done
46 |
47 | if [ $OPTIND -eq 1 ]; then
48 | CUR_VERSION=$(getVersionOnline)
49 | fi
50 |
51 | # ---
52 |
53 | echo v$CUR_VERSION-r$(getBranchPos $CUR_VERSION) | tee ../out/revision >&2
54 | echo $CUR_VERSION
--------------------------------------------------------------------------------
/shell.cmd:
--------------------------------------------------------------------------------
1 | @echo off
2 |
3 | set CHROMIUM_DIR=X:
4 | set IN_CHROMIUM_BUILDER=1
5 |
6 | set DEPOT_TOOLS_WIN_TOOLCHAIN=0
7 | set NINJA_SUMMARIZE_BUILD=1
8 | set PYTHONDONTWRITEBYTECODE=1
9 |
10 | set PATH=%CHROMIUM_DIR%\depot_tools;%CHROMIUM_DIR%\scripts;%PATH%
11 |
12 | title Chromium Shell
13 |
14 | cmd /c "git config --global core.autocrlf false"
15 | cmd /c "git config --global core.filemode false"
16 | cmd /c "git config --global branch.autosetuprebase always"
17 |
18 | cmd /k cd %CHROMIUM_DIR%\depot_tools
--------------------------------------------------------------------------------