Chromium 修改chrome.exe

具体可以参考这个:

https://stackoverflow.com/questions/50307180/chromium-mini-installer-ignores-branding/50308199#50308199

以及对比:https://blog.csdn.net/longji/article/details/81902251

主要改:

  chrome.exe 改成CustomProductName.exe

srcchromeBUILD.gn 

if (is_win) {
action("reorder_imports") {
script = "//build/win/reorder-imports.py"

# See comment in chrome_dll.gypi in the hardlink_to_output
# target for why this cannot be 'initial' like the DLL.
inputs = [
  "$root_out_dir/initialexe/CustomProductName.exe",
]
outputs = [
  "$root_out_dir/CustomProductName.exe",
  "$root_out_dir/CustomProductName.exe.pdb"
]

... later in the file ...
chrome_binary("chrome_initial") {
  if (is_win) {
    output_name = "initialexe/CustomProductName"

srcchromeinstallermini_installerBUILD.gn:

action(archive_name) {
script = "//chrome/tools/build/win/create_installer_archive.py"

release_file = "chrome.release"

inputs = [
  "$chrome_dll_file",
  "$root_out_dir/CustomProductName.exe",
  "$root_out_dir/locales/en-US.pak",
  "$root_out_dir/setup.exe",
  "//chrome/tools/build/win/makecab.py",
  release_file,
]

chrome/installer/mini_installer/chrome.release

CustomProductName.exe: %(ChromeDir)s

srcchromeinstall_staticchromium_install_modes.cc

const wchar_t kCompanyPathName[] = L"CompanyName";

const wchar_t kProductPathName[] = L"CustomProductName";

build/win/reorder-imports.py

input_image = os.path.join(input_dir, 'CustomProductName.exe')
output_image = os.path.join(output_dir, 'CustomProductName.exe')
... later on in the file ...
for fname in glob.iglob(os.path.join(input_dir, 'CustomProductName.exe.*')):

srcchromeinstallerutilutil_constants.cc

const wchar_t kChromeExe[] = L"CustomProductName.exe";

srcchromeappchrome_exe.vsprops

        Name="VCLinkerTool"
        DelayLoadDLLs="ole32.dll;oleaut32.dll"
        OutputFile="$(OutDir)CustomProductName.exe"

srcchromeappchrome_exe.ver

ORIGINAL_FILENAME=CustomProductName.exe

这个能改。。也能安装!

但是奥

改完之后会报错...........绝望.............

以后有大哥看到了能救救我吗

[0805/151941.623:ERROR:install_worker.cc(142)] Failed creating a firewall rules. Continuing with install.
[0805/151941.826:ERROR:create_reg_key_work_item.cc(82)] Failed to create SoftwareMicrosoftMediaPlayerShimInclusionListXXXXXXXXXXXXexe
[0805/151941.826:ERROR:install.cc(142)] Could not add Chrome to media player inclusion list.

原文地址:https://www.cnblogs.com/Galesaur-wcy/p/15103475.html