问题
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?
回答1:
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
...
in recent versions of NSIS v3.
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"
.
来源:https://stackoverflow.com/questions/52211779/how-to-change-nsis-installer-background-color-based-on-system-color