Archive: Remove Header for Custom Final Page with NSDialogs?


Remove Header for Custom Final Page with NSDialogs?
hey guys,
I'm trying to convert my installer to use nsdialog. The current problem I'm having is with the custom final page. It carries the mui header from the last page shown, when I don't want any header at all. Obviously I can replace the text and image with blanks, but there's still a white banner across the top.

When I used InstallOptions to create this page it was not a problem.

Is it possible to remove this through mui or nsdialogs, or am I stuck with InstallOptions?

Thanks!


its not supposed to be like that, you must be doing something wrong.


keep in mind that, at least according to the nsDialogs docs, you're supposed to use a different dialog ID;
http://nsis.sourceforge.net/Docs/nsDialogs/Readme.html

nsDialogs::Create rect

Creates a new dialog. rect specific the identifier of the control whose location will be mimiced. This should usually be 1018, which is control mimiced for creation of built-in pages. The Modern UI also has control 1040 for the welcome and the finish page.

Yes, i tried 1040, but that didn't work at all. Here is my current code, does anything stick out?

------------------

Push $0
Push $1
Push $2
Push $3
Push $4

nsDialogs::Create 1018
Pop $0

${If} $0 == error
Abort
${EndIf}

${NSD_CreateBitmap} 0 0 100% 100% ""
Pop $1
${NSD_SetImage} $1 "$PLUGINSDIR\${SIDE_BANNER}" $2

${NSD_CreateLabel} 120u 0u 100% 100% "$(INSTALLATION_COMPLETE)"
${NSD_CreateLabel} 120u 17u 100% 100% "$(INSTALL_SUCCESS_DESC)"

StrCpy $1 $(^FontSize)
IntOp $1 $1 + 4
CreateFont $1 "$(^Font)" "$4" 700
GetDlgItem $3 $0 1201
SendMessage $3 ${WM_SETFONT} $1 0

nsDialogs::Show

${NSD_FreeImage} $2
Pop $4
Pop $3
Pop $2
Pop $1
Pop $0


IntOp $1 $1 + 4
CreateFont $1 "$(^Font)" "$4" 700


$4 should be the font height, but $4 is not given a value in this routine. Perhaps you meant to do that with the IntOp instruction like this
IntOp $4 $1 + 4

Don

when using MUI, you need to use !insertmacro MUI_HEADER_TEXT "aaaa" "bbb" to set the header text. If you don't want a header at all, don't use the modern ui ;) If you want MUI but no header on that page, you must do some trickery with the system plugin.

You could hide the top header, but then your page would look funny with a big gray spot on the top. Your best bet is to GetDlgItem $0 $hwndparent 0x414, then call GetClientRect on that window with the system plugin and CreateWindowEx another static control that is slightly smaller than 0x414 and use that as the parent for nsDialogs


Thanks Anders, I'll give it a try and let you know how it goes


ah, odd - might be a typo in the nsDialogs doc? Or maybe I'm just doing something funky.

Quick check with WinSpy++ told me it should be 1044, not 1040 (though note that in some earlier threads there were some other ID mismatches).

Regardless.. the below code should show a standard MUI custom page with the header, and a customized Finish page-style custom page which, with MUI, doesn't have the header.
I've stuck a button control in both so you can check the size of the nsDialogs-created dialog area.


!include "MUI2.NSH"
!include "nsDialogs.nsh"
outfile 'test.exe'

Section
MessageBox MB_OK "test"
SectionEnd

Page custom custom_pre
Page custom customfinish_pre

!insertmacro MUI_LANGUAGE "English"

Function custom_pre
nsDialogs::Create 1018
Pop $0
${NSD_CreateButton} 0 0 100% 100% "button!"
Pop $1
nsDialogs::Show
FunctionEnd

Function customfinish_pre
nsDialogs::Create 1044
Pop $0
${NSD_CreateButton} 0 0 100% 100% "button!"
Pop $1
nsDialogs::Show
FunctionEnd

Hi, I'm new here. I just registered to say thanks Animaether!!

1044 was the answer to all my problems! :D

BTW, Can someone please update nsDialogs documentation??

http://nsis.sourceforge.net/Docs/nsD...tml#ref-create still states 1040 is the identifier of the control for the welcome and finish pages.

Regards