- NSIS Discussion
- MUI Background Image is blank
Archive: MUI Background Image is blank
asfarley
4th May 2009 17:12 UTC
MUI Background Image is blank
Hi everyone, I'm trying to use the MUI2 to give my installer a background image.
My understanding is that I need to
a) specify a bitmap background:
!define MUI_WELCOMEFINISHPAGE_BITMAP C:\WINNT\Profiles\kf1864\Desktop\InstallTest\Backdrop2.bmp
b) have a welcome/finish page:
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_FINISH
However, this results in a blank background for the welcome and finish pages. Is there something I need to do to "enable" or "activate" this background?
It appears that the NSIS compiler finds the .bmp file, so I don't think a missing file is the problem.
I have read another post concerning a blank background using MUI, but it appeared to me that a different method was being using (plugins?).
Thanks,
Alex
Afrow UK
4th May 2009 19:11 UTC
This doesn't give your installer a background image. This sets the image on the left hand side of the text on the welcome and finish pages.
If that is what you mean, make sure the bitmap is valid.
Stu
asfarley
4th May 2009 19:19 UTC
Thanks for the reply.
If the bitmap wasn't valid/wasn't being found, then wouldn't the compiler give an error?
Also, thanks for the explanation of how this image should appear. Is there a way to give the installer a true background image? I tried the BgImage plugin, but I don't want an image displayed "behind" the installer, I want a background similar to the background option in Visual Studio.
Thanks,
Alex
Afrow UK
4th May 2009 19:28 UTC
No there would be no compiler error as the image is only extracted and then loaded at run-time.
You can have a look at this:
http://nsis.sourceforge.net/Image_in...dow_background
Stu
asfarley
4th May 2009 19:57 UTC
To test, I tried compiling the script with a non-existant .bmp file. This causes the compiler to give an error. Since I'm not getting an error, is there a different way for the bitmap to be "invalid" aside from not existing?
One thing I noticed: the size of the .exe doesn't change significantly when I include the bitmap. Is additional code necessary for the compiler to copy the bitmap into the .exe?
Also, when I directly copy the code for a MUI header image, no header image appears.
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Header\nsis.bmp" ; optional
!define MUI_ABORTWARNING
In fact, this causes the normal icon to disappear.
Thanks for the pointer regarding the "real" background image, I'll try that out as well.
Alex
asfarley
5th May 2009 15:50 UTC
Hi, could anyone provide a barebones example that just creates a MUI2 and sets a MUI_WELCOMEFINISHPAGE_BITMAP?
Afrow UK
5th May 2009 16:42 UTC
There is a section in the Modern UI 2 readme "To upgrade a Modern UI 1.8 script, you should:"
Stu
asfarley
5th May 2009 17:06 UTC
Thanks, I read through that section:
-I didn't start with a working MUI 1.8 script, so I'm not really upgrading
-MUI2.nsh is included
-No MUI_INSTALLOPTIONS_* macros are used (as far as I know)
-The InstallOptions INI file is not being used (as far as I know)
-the path to the .bmp is absolute, so no escape characters should be necessary (right?)
When I say "as far as I know", I mean that I have not explicitly referenced these items.
Afrow UK
5th May 2009 18:53 UTC
If the script compiles and the installer looks fine then you should be fine.
Stu
CrushBug
13th August 2009 19:56 UTC
I am having the exact same problem as the OP. Neither Header nor Welcome images are appearing and there is no compiler error.
It must be a sequencing error in the defines and insertmacros. I have one installer that is working perfectly and another that is not.
Hopefully I can figure this out and post about it here.
CrushBug
13th August 2009 21:38 UTC
Well, it seems to have to do with the proper placement of the "!insertmacro MUI_LANGUAGE" command.
It seems you MUST have the "!insertmacro MUI_LANGUAGE" right before your Sections.
I made this change on my installer and now everything has shown up.