简体   繁体   English

如何替换NSIS安装程序中的默认徽标?

[英]How to replace the default logo in NSIS installer?

I would like to replace the default logo in my NSIS installer (see image below), but I cannot find anything about this on the internet. 我想替换我的NSIS安装程序中的默认徽标(见下图),但我在互联网上找不到任何相关内容。 Can it be done? 可以吗?

在此输入图像描述

For the sake of completion, this is the full code I used to change the logo (using Anders method) and the executable icon (using CharlesB method). 为了完成,这是我用来更改徽标(使用Anders方法)和可执行图标(使用CharlesB方法)的完整代码。 Also included MUI2.nsh as mentioned by Yuri Korolov. 还包括Yuri Korolov提到的MUI2.nsh。

!include "MUI2.nsh"

!define MUI_ICON "path\to\icon.ico"
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "path\to\InstallerLogo.bmp"
!define MUI_HEADERIMAGE_RIGHT

把它放在你的.nsi中(在包含MUI.nsh之后):

!define MUI_ICON path_to_icon_file.ico

You have to include MUI or MUI2 in order to make it work in your script 您必须包含MUI或MUI2才能使其在您的脚本中运行

!include "MUI2.nsh"

!define MUI_ICON "icon.ico"
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "header.bmp"
!define MUI_HEADERIMAGE_RIGHT

MUI_ICON changes the .exe icon and that icon is used by default in the MUI header but if you want to use a specific bitmap in the header you can use MUI_HEADERIMAGE/MUI_HEADERIMAGE_BITMAP MUI_ICON更改.exe图标,默认情况下在MUI标头中使用该图标但如果要在标头中使用特定位图,则可以使用MUI_HEADERIMAGE / MUI_HEADERIMAGE_BITMAP

You can find all the Modern UI configuration options in the docs 您可以在文档中找到所有Modern UI配置选项

With MakeNSISW 2.3 only type Icon 使用MakeNSISW 2.3只能输入Icon

Icon "MyIcon.ico"

https://nsis.sourceforge.io/Reference/Icon https://nsis.sourceforge.io/Reference/Icon

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM