Search code examples
nsis

Remove button pane at the bottom in NSIS installer


I'm using NSIS to create an installer which will only have custom pages. The custom page shouldn't have the default buttons (back, next or cancel), but only 1 button in the center of the page. Is there any way I can remove the full bottom pane, as I have highlighted in the image attached ? I have hid the buttons, but I would like to remove the separator line and the section below it as well.

This is code I have:

;--------------------------------
;Include Modern UI
  !include "MUI2.nsh"

;--------------------------------
;General

  ;Name and file
  Name "Custom Test"
  OutFile "custom_installer.exe"

  ;Default installation folder
  InstallDir "$LOCALAPPDATA\Custom Test"

  ;Remove default branding text of Nullsoft
  BrandingText " "

;--------------------------------
;Interface Settings
  !define MUI_LICENSEPAGE_BGCOLOR "814EFA"
  !define MUI_ABORTWARNING
  !define MUI_BGCOLOR "000000"

;--------------------------------
;Functions
Function Start
  nsDialogs::Create 1044
  Pop $0
    SetCtlColors $0 222425 FBFBFB
  
  ${NSD_CreateButton} 20 170 90% 15u INSTALL

  GetDlgItem $0 $HWNDPARENT 3 ; Back Button
  GetDlgItem $1 $HWNDPARENT 1 ; Next/Close Button
  GetDlgItem $2 $HWNDPARENT 2 ; Cancel Button
  
  ShowWindow $0 ${SW_HIDE}
  ShowWindow $1 ${SW_HIDE}
  ShowWindow $2 ${SW_HIDE}

    nsDialogs::Show
FunctionEnd

;--------------------------------
;Pages

  Page custom Start
  !insertmacro MUI_PAGE_COMPONENTS

;--------------------------------
;Languages
 
  !insertmacro MUI_LANGUAGE "English"

;--------------------------------
;Installer Sections

Section "Dummy Section" SecDummy

  SetOutPath "$INSTDIR"

SectionEnd

And this is how the installer page looks like now: enter image description here


Solution

  • What about using SetBrandingText " " to hide the horizontal line and coloring the bottom area with SetCtlColors $0 222425 FBFBFB so it will look like the rest of the dialog?

    Is that acceptable for you or you want to make the dialog smaller (lower its height)?