I'm working on an installer using NSIS and MUI
Problem N°1:
My problem is I can't seem to get to change the color of the descriptions text in the components page
I've tried searching the forums and searching again: all I've foud doesn't seem to work mith me, even thought it solved the problem for them
here are the parts of code in regard of this I use: (the complete script is quite huge so it's best if I only post the parts concerning this problem)
!include "MUI.nsh"
!include "LogicLib.nsh"
;--------------------------------
;General
Name "blabla"
OutFile "blabla_Setup.exe"
InstallDir $PROGRAMFILES\blabla
InstallDirRegKey HKLM "Software\blabla power v185479.6.5.8" "Install_Dir"
;--------------------------------
;Interface Configuration
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Header\myreallynice.bmp" ; optional
!define MUI_ABORTWARNING
!define MUI_PAGE_CUSTOMFUNCTION_SHOW ChangeFont
;--------------------------------
;Language Selection Dialog Settings
;Remember the installer language
!define MUI_LANGDLL_REGISTRY_ROOT "HKCU"
!define MUI_LANGDLL_REGISTRY_KEY "Software\whocares"
!define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"
;--------------------------------
;Pages
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE $(MUILicense)
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
Function ChangeFont
FindWindow $0 "#32770" "" $HWNDPARENT
GetDlgItem $0 $0 1043
CreateFont $1 "Arial" 8 400
SendMessage $0 ${WM_SETFONT} $1 0
EnableWindow $0 1
FunctionEnd
and, right after the installation sections:
Function .onMouseOverSection
FindWindow $R0 "#32770" "" $HWNDPARENT
GetDlgItem $R0 $R0 1043 ; description item
${If} $0 == -1
CreateFont $1 "Arial" 9 700 ; create the font for the default description
SetCtlColors $R0 0x5f5f61 0xffffff; set colors
SendMessage $R0 ${WM_SETFONT} $1 0
SendMessage $R0 ${WM_SETTEXT} 0 "STR😁ON'T PLACE YOUR CURSOR HERE! (or your comp will crash so badly it will drill a hole in the soil)"
${Else}
CreateFont $1 "Arial" 9 400 ; create the font for mouse over descriptions
SetCtlColors $R0 0x5f5f61 0xffffff; set colors
SendMessage $R0 ${WM_SETFONT} $1 0
; show description for each section
${If} $0 == 0
SendMessage $R0 ${WM_SETTEXT} 0 "STR:This is a worm"
${ElseIf} $0 == 1
SendMessage $R0 ${WM_SETTEXT} 0 "STR:This is a cool virus"
${ElseIf} $0 == 2
SendMessage $R0 ${WM_SETTEXT} 0 "STR:This sux"
${ElseIf} $0 == 3
SendMessage $R0 ${WM_SETTEXT} 0 "STR:This... huh: no clue!"
${ElseIf} $0 == 4
SendMessage $R0 ${WM_SETTEXT} 0 "STR:This will give me your GF's credit card number"
${EndIf}
${EndIf}
FunctionEnd
I've tried changing the values for "SetCtlColors $R0 0x5f5f61 0xffffff", "EnableWindow $0 1" and trying parts of code from these forums so many times I think I might not actually survive...
the result is always the same: I can choose the background color but nothing seems to affect the font color
and that's really no luck at all, because what I'd like is exactly the contrary:
I'd like the background to remain system's button face color (not only mine please: the setting on the end user comp would be quite more classy) and the font color to be a plain simple black (engraving is ok, as long as it's "enabled", meaning with damn black somewhere in it ^^ )
Problem N°2:
of course, I have several sections:
one is required
four others are optionnal (but at least one has to be selected)
questions:
-is there a way to have these four sections unchecked by default?
-is there a way to make the installer refuse to continue if 2 or more of these 4 options are checked?
-is there a way to make the installer refuse to continue if none of these 4 options is checked?
I do understand I may ask a lot, but I'm really stuck and I've been for quite a while now, so any help would be rather appreciated 🙂
Thanks for reading anyway