Search code examples
nsis

NSIS Custom Page with Custom Header Text


I am creating a custom page and trying to change the the different page areas, but cant figure out how I have tried several thing and in different spots.

here are the areas I am looking to chance (And I can on like the license page but cant figure out the code for custom pages)

  !define MUI_LICENSEPAGE_TEXT_TOP "Change Log of ${PRODUCT_NAME} v${PRODUCT_VERSION}"
  !define MUI_LICENSEPAGE_TEXT_BOTTOM " "
  !define MUI_LICENSEPAGE_BUTTON "Next" # or "Next" if you have other pages between the changelog and the  InstFiles page
  !define MUI_PAGE_HEADER_TEXT  "Change Log"
  !define MUI_PAGE_HEADER_SUBTEXT "Overview of changes in Drive Content"

here is the code I am working with

!define FolderDocs "Included\Docs"

    !define FolderImages "Included\Images"
    !define FolderAudio "Included\Audio"
    !define FolderData "Included\Data"

    !define DocLicense "License.txt"
    !define DocChangeLog "ChangeLog.txt"
    !define DocMustRead "MustRead.txt"

    !define ImageIcon "Icon.ico"
    !define ImageHDR "HDR.bmp"
    !define ImageWF "WF.bmp"
    !define ImageSplash "Splash.bmp"


    !define PRODUCT_NAME "Test"
    !define PRODUCT_VERSION "1.0"

    !define MUI_ICON ".\${FolderImages}\${ImageIcon}"
    Icon ".\${FolderImages}\${ImageIcon}"

    !include WinVer.nsh
    !include LogicLib.nsh
    !include x64.nsh
    !include FileFunc.nsh
    !include MUI.nsh
    !include WinMessages.nsh
    !include InstallOptions.nsh
    !include Sections.nsh
    !include nsDialogs.nsh

      !define MUI_HEADERIMAGE
      !define MUI_HEADERIMAGE_BITMAP ".\${FolderImages}\${ImageHDR}"
      !define MUI_WELCOMEFINISHPAGE_BITMAP  ".\${FolderImages}\${ImageWF}"
      !define MUI_ABORTWARNING

   !define MUI_PAGE_HEADER_TEXT  "Change Log" #DOES NOT WORK
   !define MUI_PAGE_HEADER_SUBTEXT "Overview of changes in Drive Content" #DOES NOT WORK
   Page custom SetCustom ValidateCustom


    !insertmacro MUI_LANGUAGE "English"

Solution

  • See the "Custom pages" section of the readme?

    !include MUI2.nsh
    
    ...
    
    Page Custom MyPageCreate
    !insertmacro MUI_LANGUAGE "English"
    
    Function MyPageCreate
      !insertmacro MUI_HEADER_TEXT "Blah" "blah blah blah"
      nsDialogs::...
    FunctionEnd