Chromium-mini_installer忽略品牌 [英] Chromium - mini_installer ignores branding

查看:78
本文介绍了Chromium-mini_installer忽略品牌的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从源代码构建铬之后,您可以通过运行

After building chromium from source, you can create a "mini installer" for Windows by running

ninja -C out\BuildFolder mini_installer

这可以正常工作并创建 mini_installer.exe 输入 out\BuildFolder

This works fine and creates a mini_installer.exe in out\BuildFolder.

请参见 Chromium-如何使用mini_installer.exe制作实际的安装程序以获取更多详细信息。

see Chromium - How to make an actual installer out of mini_installer.exe for more details.

但是在运行<$ c之后$ c> mini_installer.exe ,应用程序将忽略我的品牌和 grd 资源自定义。

But after running mini_installer.exe, the application ignores my branding and grd resource customizations.

应该使用我已经自定义的 IDS_PRODUCT_NAME_BASE。

It is supposed to use "IDS_PRODUCT_NAME_BASE" which I have definitely customized.

以下是我在以下品牌中应用的文件:

Here are the files I applied my branding in:


  • chrome\app\chromium_strings.grd

  • chrome\app\settings_chromium_strings.grdp

  • chrome\app\theme\chromium\Branding

  • chrome\app\chromium_strings.grd
  • chrome\app\settings_chromium_strings.grdp
  • chrome\app\theme\chromium\BRANDING

但似乎忽略了它们。


  • 程序安装在 C:\Program Files(x86)\Chromium 而不是 C:\程序文件(x86)\CustomProductName

  • 可执行文件仍命名为 chrome.exe ,而不是 CustomProductName.exe

  • The program is installed in C:\Program Files (x86)\Chromium instead of C:\Program Files (x86)\CustomProductName
  • The executable is still named chrome.exe instead of CustomProductName.exe

一个人如何自定义呢?

How does one customize that?

推荐答案

品牌不会更改生成的可执行文件的名称。您应该修改 src\chrome\BUILD.gn ,将名称从 chrome.exe 更改为 CustomProductName.exe ,如下所示:

Branding won't change the name of generated executable files. You should modify src\chrome\BUILD.gn to change the name from chrome.exe to CustomProductName.exe as specified below:

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",
]
if (symbol_level != 0) {
  outputs += [ "$root_out_dir/CustomProductName.exe.pdb" ]
}
... later in the file ...
chrome_binary("chrome_initial") {
  if (is_win) {
    output_name = "initialexe/CustomProductName"

这样做将生成 CustomProductName.exe 而不是 Chrome.exe 在您的 BuildFolder 中。之后,您还应该通过修改以下文件来通知小型安装程序: src\chrome\installer\mini_installer\BUILD.gn

Doing so will generate CustomProductName.exe instead of Chrome.exe in your BuildFolder. After that, you should notify mini installer too by modifying this file: src\chrome\installer\mini_installer\BUILD.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,
]

这些更改只会更改可执行文件的名称。您还必须修改源代码以反映这些更改。

Those changes will only change the name of executable files. You will have to modify source code to reflect those changes too.

在此文件中分配浏览器可执行文件的名称: src\chrome\ \installer\util\util_constants.cc

Assign the name of your browser executable in this file: src\chrome\installer\util\util_constants.cc

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

安装文件夹的路径应在此文件中指定:
src\chrome\install_static\chromium_install_modes.cc

The path to installation folder should be specified in this file: src\chrome\install_static\chromium_install_modes.cc

const wchar_t kCompanyPathName[] = L"CompanyName";

const wchar_t kProductPathName[] = L"CustomProductName";

同样,您也必须在此文件中更改公司名称和应用名称: src\chrome\installer\util\browser_distribution.cc 。我不确定当前版本的Chromium是否仍使用 BrowserDistribution 类中的数据。

Similarly, you will have to change company name and app name in this file too: src\chrome\installer\util\browser_distribution.cc. I am not sure if the current version of Chromium still uses data from BrowserDistribution class.

让我知道是否作品。我只是浏览了我们的回购历史记录,以找出那些更改。

Let me know if it works. I just went through our repo history to find out those changes.

更新:

这些评论揭示了一些更多地点:

The comments reveal a couple more places:

打开 chrome_elf / BUILD.gn 并在此处更改:

$root_out_dir/CustomProductName.exe

并在此处更改: chrome / installer / mini_installer / chrome.release

CustomProductName.exe: %(ChromeDir)s\

然后在此处更改: 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.*')):

这篇关于Chromium-mini_installer忽略品牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆