Search code examples
nsis

NSIS: Changing colors of the installer


I've been working with NSIS to make installers for some of my stuff experimentally. I do not know the correct syntax for how to change colors on the installer. I've tried using help on other websites but they do nothing. Does anyone know the right syntax and !insertmacro that I'd have to use in order to change colors? EDIT: Also, I do not know what to !include and !define in order to get to that point. I want to change not only the background but maybe the progress bar and button colors. EDIT2: I need to find macros and data for progress bar and buttons. Not just the background.


Solution

  • NSIS tries to uses the system colors as much as possible. If you are using the Modern UI then there are a couple of defines you can set to control the colors but mostly just for the "wizard" areas.

    !define MUI_BGCOLOR 000000
    !define MUI_TEXTCOLOR ffffff
    !define MUI_LICENSEPAGE_BGCOLOR 445566
    !define MUI_DIRECTORYPAGE_BGCOLOR 556677
    ;define MUI_STARTMENUPAGE_BGCOLOR ...
    !define MUI_INSTFILESPAGE_COLORS 123456
    !define MUI_INSTFILESPAGE_PROGRESSBAR colored
    ;define MUI_FINISHPAGE_LINK_COLOR ...
    !include MUI2.nsh
    ...
    

    The SetCtlColors instruction can be used to change to color of some other UI elements but if you want to create a installer with custom colors on everything then you must use one of the 3rd-party skinning plug-ins because that is the only way to change the color of buttons.