Archive: Customize installation page


Customize installation page
Hi! I'm trying to display an image and label above the progress bar.
I've added 2 controls to modern.exe dialog 106 with resource hacker.
The resources look like this (the last 2 are what I've added):

106 DIALOGEX 0, 0, 300, 140
STYLE DS_FIXEDSYS | DS_CONTROL | WS_CHILD
CAPTION ""
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
FONT 8, "MS Shell Dlg"
{
CONTROL "", 1027, BUTTON, BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE, 0, 79, 60, 14
CONTROL "", 1004, "msctls_progress32", WS_CHILD | WS_VISIBLE | WS_BORDER, 0, 63, 300, 11
CONTROL "", 1006, STATIC, SS_LEFTNOWORDWRAP | SS_NOPREFIX | WS_CHILD | WS_VISIBLE, 0, 52, 300, 10
CONTROL "", 1016, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_NOCOLUMNHEADER | WS_CHILD | WS_BORDER | WS_TABSTOP, 0, 79, 300, 56
CONTROL "", 1090, STATIC, SS_BITMAP | WS_CHILD | WS_VISIBLE | WS_GROUP, 2, 2, 51, 44
CONTROL "", 1091, STATIC, SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 58, 3, 239, 44
}


Then in a Section I'm using
SetBrandingImage /IMGID=1090 $PLUGINSDIR\myimage.bmp 

to change it, but it doesn't work! No image is displayed...
The image was decompressed and is there because I can see it in custom pages.

Any idea what's wrong? Also, how can I change the text of the label I created?

Thanks!

Have you tried quoting the filename?


SetBrandingImage /IMGID=1090 "$PLUGINSDIR\myimage.bmp"

Not sure, but you can only add images with SetBrandingImage to the dialog 105.

And to change the text of the label...
!include "WinMessages.nsh"

FindWindow $0 "#32770" "" $HWNDPARENT
GetDlgItem $1 $0 1091
SendMessage $1 ${WM_SETTEXT} 0 "STR:Your text"


I hadn't understood that restriction about SetBrandingImage!
That bit of code to change the label text works fine, thanks!

To change the bitmap I went to some of those system calls too:


function SetMainImage
Pop $R2
FindWindow $R0 "#32770" "" $HWNDPARENT

System::Call '${sysLoadImage} (0, "$R2", ${IMAGE_BITMAP}, 0, 0, ${LR_CREATEDIBSECTION}|${LR_LOADFROMFILE}) .r6'

GetDlgItem $R3 $R0 1090
SendMessage $R3 ${STM_SETIMAGE} ${IMAGE_BITMAP} $6
functionEnd



push "$PLUGINSDIR\mypic.bmp"
call SetMainImage


(this was based on what's in http://nsis.sourceforge.net/ModernUI...stalling_files
and in some other forum posts)

Although it's working ok now, if someone has a more elegant way of doing it please post...

Thanks a lot!