Search code examples
nsis

Nullsoft Installer NSIS not showing an image on the welcome page. Not even the default one


I'm trying to write an NSIS script using MUI2 and for some reason it refuses to show an image on the welcome page. I have tried using MUI_WELCOMEFINISHPAGE_BITMAP as instructed in the NSIS wiki and manual. I have used ${NSISDIR} to reference the included bitmaps. I have tried using a full path to the included bitmaps. I have tried using a path to a bitmap in my installation files directory.

No matter what I do, I end up with a Welcome page that has a title and text, but no image. The build process gives no warnings or errors concerning the welcome bitmap. The installer installs everything correctly. There's just no image on the welcome page and I cannot figure out why.

This is my first attempt at using NSIS, so there's probably something I'm missing. The section of my .nsi file with the page definitions is below. Any help would be appreciated.

!include MUI2.nsh

# Install Warcraft II BattleNet Edition and dependencies.
Name "Warcraft II Windows 10 Setup"
Outfile "Warcraft Win10 Setup.exe"
InstallDir "C:\ISO"
# !define MUI_WELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\orange.bmp"
!define MUI_WELCOMEPAGE_TITLE "Warcraft II for Windows 10"
!define MUI_WELCOMEPAGE_TEXT "Ready to work!$\r$\n$\r$\nWith just a few simple steps, our peons will have you ready to play Warcraft II on Windows 10."
!insertmacro MUI_PAGE_WELCOME
!define MUI_DIRECTORYPAGE_TEXT_TOP "Choose a location to store the Warcraft II CD-ROM (ISO) image."
!define MUI_DIRECTORYPAGE_TEXT_DESTINATION "ISO Image Folder"
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!define MUI_FINISHPAGE_TEXT "Work complete!"
!insertmacro MUI_PAGE_FINISH

Solution

  • I found the solution and am posting for anyone else experiencing the same problem.

    In short, the answer is: !insertmacro MUI_LANGUAGE "English"

    Apparently, one must specify a language for a bitmap to show up. Makes total sense, huh? And yes, Virginia, that was sarcasm.

    I figured this out by taking the example from the website below and commenting lines out until I reproduced my problem with the lack of a bitmap image appearing on the welcome page.

    https://nsis.sourceforge.io/Examples/Modern%20UI/WelcomeFinish.nsi

    The working code looks like this:

    !include MUI2.nsh
    
    # Install Warcraft II BattleNet Edition and dependencies.
    Name "Warcraft II Windows 10 Setup"
    Outfile "Warcraft Win10 Setup.exe"
    InstallDir "C:\ISO"
    !define MUI_WELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\orange.bmp"
    !define MUI_WELCOMEPAGE_TITLE "Warcraft II for Windows 10"
    !define MUI_WELCOMEPAGE_TEXT "Ready to work!$\r$\n$\r$\nWith just a few simple steps, our peons will have you ready to play Warcraft II on Windows 10."
    !insertmacro MUI_PAGE_WELCOME
    !define MUI_DIRECTORYPAGE_TEXT_TOP "Choose a location to store the Warcraft II CD-ROM (ISO) image."
    !define MUI_DIRECTORYPAGE_TEXT_DESTINATION "ISO Image Folder"
    !insertmacro MUI_PAGE_DIRECTORY
    !insertmacro MUI_PAGE_INSTFILES
    !define MUI_FINISHPAGE_TEXT "Work complete!"
    !insertmacro MUI_PAGE_FINISH
    !insertmacro MUI_LANGUAGE "English"