Missing welcome image in NSIS / MUI2

I am trying to add an image to the first page of an installer written using NSIS / MUI2 .

Here's the 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 title is displayed correctly on the license page, but I can not show it on the welcome page. I tried using a 164x314 image (as doc recommends), with bitmaps saved in 16b or 24b or 32b, with the same image as the title (to make sure that this is not a problem with the bitmap), compiling the installation under Win2k and Linux ... Nothing works.

The bitmap image is correctly saved in the setting:

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

Any idea what I'm doing wrong?

+7
nsis
source share
7 answers

MUI_LANGUAGE macro should appear after the MUI_PAGE_* macros in the source file

+10
source share

Even with the guidance provided by Anders, I couldn't get this to work. My problem was with the image itself.

These steps helped me using GIMP 2.8.10:

  • create an image using RGB mode (Image> Mode> RGB) using the appropriate size for everything you create ( 164x314 for MUI_WELCOMEFINISHPAGE_BITMAP , 150x57 for MUI_HEADERIMAGE_BITMAP )
  • File> Export As ...
  • name your file with the extension .bmp
  • click "Export"
  • in the "Export BMP image" window, expand "Compatibility Settings" and check the box "Do not record color space information"
  • In addition, in the "Export Image As BMP" window, expand "Advanced Options" and select the switch in the "24 bit" field next to "R8 G8 B8"
  • .click "Export"

Now recompile your nsi script, and your installer should use the images you specified.

+14
source share

For other people like me with the same problem, but a (slightly) different solution:

Make sure you have the MUI_LANGUAGE macro. (And, as the real answer suggests, this should be after the page macros). If you don’t turn it on at all, many things do not seem to work, not only images, but even some texts, etc.

 !insertmacro MUI_LANGUAGE "English" 
+5
source share

Make sure your image is 8bit

+3
source share

Your code looks great, but I noticed that you said:

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

the documentation actually recommends 164x314. Therefore, if this is not just a typo on your part, try resizing the image.

If this does not help, let us know what appears instead of your image. Is this the default image or is it just blank?

+1
source share

You want to see the nsis-welcome.bmp and paste it into the modern-wizard.bmp .

+1
source share

I ran into the same problem and the problem is resolved as stated in the original answer.

 !define MUI_ABORTWARNING !define MUI_ICON "my.ico" !define MUI_UNICON "my.ico" !define MUI_HEADERIMAGE !define MUI_HEADERIMAGE_BITMAP orange.bmp !define MUI_WELCOMEFINISHPAGE_BITMAP orange_b.bmp !insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_LICENSE "LicenseAgreement.rtf" !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_LANGUAGE "English" !insertmacro MUI_UNPAGE_CONFIRM !insertmacro MUI_UNPAGE_INSTFILES 

one interesting point here is if the language file is already loaded elsewhere in any header file using

 LoadLanguageFile "${NSISDIR}\Contrib\Language files\English.nlf" ;don't include while using MUI2 

NSIS then reports the following error.

 Error: can't load same language file twice. Error in macro MUI_LANGUAGE on macroline 9 

Any inclusion of a language file should be commented out to view header images.

0
source share

All Articles