如何根据系统颜色更改NSIS安装程序的背景颜色 [英] How to change NSIS installer background color based on system color
问题描述
NSIS似乎将背景颜色硬编码为白色。
It seems that NSIS has hardcoded the background color to be white.
每当打开高对比度时,背景保持白色,而文本恢复为白色(
Whenever high contrast is turned on, the background remains white while the text is reverted to white (to comply with high contrast).
是否可以确定当前系统的颜色并相应地更改背景?
Is there a way to determine the current system colors and change the background accordingly?
推荐答案
如果您不使用依赖于白色背景的向导/标题图像,则只需执行
If you are not using a wizard/header image that depends on the background being white you can simply do
!define MUI_BGCOLOR "SYSCLR:Window"
!include MUI2.nsh
...
NSIS v3的最新版本中的
。
in recent versions of NSIS v3.
如果您要强制黑白色,则必须手动更改Modern UI。 nsh文件。查找类似于 SetCtlColors $ SomeNameHere $ {MUI_BGCOLOR}
的行,并将其更改为 SetCtlColors $ SomeNameHere 000000 FFFFFF
。
If you want to force black on white then you must manually change the Modern UI .nsh files. Look for lines that look like SetCtlColors $SomeNameHere "" "${MUI_BGCOLOR}"
and change them to SetCtlColors $SomeNameHere "000000" "FFFFFF"
.
这篇关于如何根据系统颜色更改NSIS安装程序的背景颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!