Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 10th February 2009, 20:55   #1
Spilly
Junior Member
 
Join Date: Aug 2007
Posts: 46
Question 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!
Spilly is offline   Reply With Quote
Old 10th February 2009, 21:48   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 2,810
its not supposed to be like that, you must be doing something wrong.

IntOp $PostCount $PostCount + 1
Anders is online now   Reply With Quote
Old 10th February 2009, 22:35   #3
Animaether
Major Dude
 
Join Date: Jun 2001
Posts: 1,173
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

Quote:
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.
Animaether is offline   Reply With Quote
Old 11th February 2009, 16:34   #4
Spilly
Junior Member
 
Join Date: Aug 2007
Posts: 46
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
Spilly is offline   Reply With Quote
Old 11th February 2009, 17:55   #5
demiller9
Senior Member
 
Join Date: Mar 2006
Location: Dallas
Posts: 442
code:
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
code:
IntOp $4 $1 + 4

Don
demiller9 is offline   Reply With Quote
Old 11th February 2009, 18:32   #6
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 2,810
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

IntOp $PostCount $PostCount + 1
Anders is online now   Reply With Quote
Old 11th February 2009, 18:47   #7
Spilly
Junior Member
 
Join Date: Aug 2007
Posts: 46
Thanks Anders, I'll give it a try and let you know how it goes
Spilly is offline   Reply With Quote
Old 11th February 2009, 19:17   #8
Animaether
Major Dude
 
Join Date: Jun 2001
Posts: 1,173
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.

code:

!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


Last edited by Animaether; 11th February 2009 at 19:34.
Animaether is offline   Reply With Quote
Old 12th September 2012, 14:26   #9
regodon
Junior Member
 
Join Date: Sep 2012
Posts: 6
Hi, I'm new here. I just registered to say thanks Animaether!!

1044 was the answer to all my problems!

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
regodon is offline   Reply With Quote
Reply
Go Back   Winamp Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump