tags:

views:

681

answers:

3

Hello,

I'm struggling to add an image to the first page of an installer written with NSIS/MUI2.

Here's a trimmed down version of the code I'm using.

!include "MUI2.nsh"

!define MUI_HEADERIMAGE
    !define MUI_HEADERIMAGE_BITMAP nsis-header.bmp

!define MUI_WELCOMEFINISHPAGE_BITMAP nsis-welcome.bmp

OutFile "Setup.exe"

# Set language
!insertmacro MUI_LANGUAGE "English"

# Pages for installation
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "..\LICENSE"
!insertmacro MUI_PAGE_FINISH

Section Foo
SectionEnd

The header is shown correctly on the license page, but I can't get it to show on the welcome page. I tried with a 164x314 image (as the doc recommends), with bitmaps saved in 16b or 24b or 32b, with the same image as the header (to make sure it wasn't a problem with the bitmap), compiling the setup under Win2k and Linux... Nothing works.

The bitmap is correctly stored in the setup:

$ 7z l demyo-1.4.exe  | grep modern- | awk '{ print $4 }'
$PLUGINSDIR/modern-header.bmp
$PLUGINSDIR/modern-wizard.bmp

Any idea of what I'm doing wrong?

+1  A: 

Your code appears fine, but I noticed you said:

I tried with a 164x364 image (as the doc recommends)

The documentation actually recommends 164x314. So if that's not just a typo on your part, try resizing your image.

If that doesn't help, tell us what's showing up instead of your image. Is it the default image or is it just blank?

Kyle Gagnet
Yeah, that was a typo, sorry.
Xr
A: 

MUI_LANGUAGE macro(s) have to come after the MUI_PAGE_* macros in the source file

Anders
This is incredibly silly (of me), and absolutely correct. Thanks a lot.
Xr
A: 

Ensure your image it's 8bit

diego2k
Thanks but Anders' answer above was the right one.
Xr