Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 16th December 2004, 15:34   #1
khawkins123
Junior Member
 
Join Date: Dec 2004
Posts: 3
Header image in Modern UI

I am using the Modern UI with the following entries in my .nsi script.

!define MUI_ICON "Messenger.ico"
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "STPMessengerTitleSmall.bmp"

The icon displays fine but I can't get get the header image to display. Am I missing something?

Also the following colors command seems to have no effect:

!define MUI_INSTFILESPAGE_COLORS "F0F0F0 000000"

Any help would be appreciated.
khawkins123 is offline   Reply With Quote
Old 16th December 2004, 15:47   #2
Comm@nder21
Major Dude
 
Join Date: Jul 2003
Location: germany, b-w
Posts: 734
Send a message via ICQ to Comm@nder21
works just fine for me. could you plz attach your script, or an example, where it doesn't work?
Comm@nder21 is offline   Reply With Quote
Old 16th December 2004, 15:54   #3
khawkins123
Junior Member
 
Join Date: Dec 2004
Posts: 3
Here's the whole script

; main.nsi
; Main installer script for use with NSIS Installer
;--------------------------------

;--------------------------------
; Let's use the "Modern" UI style
!include "MUI.nsh"
;--------------------------------

!define VERSION "3.2.0"
!define MUI_ICON "Messenger.ico"
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "MessengerTitleSmall.bmp"

LangString MUI_TEXT_WELCOME_INFO_TEXT ${LANG_ENGLISH} "Welcome to Messenger Install"
LangString MUI_TEXT_WELCOME_INFO_TITLE ${LANG_ENGLISH} "Messenger Install"
LangString MUI_TEXT_INSTALLING_TITLE ${LANG_ENGLISH} "Installing Messenger"


; The name of the installer
Name "Messenger version ${VERSION}"

; The file to write
OutFile "InstallMessenger_v${VERSION}.exe"

; The default installation directory
InstallDir $PROGRAMFILES\Messenger${VERSION}

;--------------------------------
; Pages
;--------------------------------
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES


; The stuff to install
Section "" ;No components page, name is not important

; Set output path to the installation directory.
SetOutPath $INSTDIR

; Put files there
File /r ..\FilesToInstall\*.*

SectionEnd ; end the section
khawkins123 is offline   Reply With Quote
Old 16th December 2004, 19:54   #4
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
1. The header bitmap must be extracted to a temporary location using File/ReserveFile.
2. You must specify the full path to the bitmap.

E.g.
code:
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "$PLUGINSDIR\MessengerTitleSmall.bmp"
Function .onInit
InitPluginsDir
ReserveFile "/oname=$PLUGINSDIR\MessengerTitleSmall.bmp" "MessengerTitleSmall.bmp"
FunctionEnd



-Stu

Need an installer? http://www.afrowsoft.co.uk
Afrow UK is offline   Reply With Quote
Old 17th December 2004, 19:15   #5
khawkins123
Junior Member
 
Join Date: Dec 2004
Posts: 3
Thanks for the reply. After making the .onInit Entry change now a welcome page which wasn't displaying before is coming up. I still don't see the bitmap. The page is completely blank. NSIS seems very tempermental.
khawkins123 is offline   Reply With Quote
Old 17th December 2004, 20:25   #6
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
Sorry,
ReserveFile "/oname=$PLUGINSDIR\MessengerTitleSmall.bmp" "MessengerTitleSmall.bmp"
...won't work.

You'd need to use:
SetOutPath $PLUGINSDIR
ReserveFile "MessengerTitleSmall.bmp"

-Stu

Need an installer? http://www.afrowsoft.co.uk
Afrow UK is offline   Reply With Quote
Old 17th December 2004, 20:29   #7
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
Ok, I think the problem is being caused because you are using LangString's when you aren't including any seperate languages. If you are only using English then you don't need to use LangString's. If you do, MUI just seems to fall to pieces (I have found).

Just use plain !defines rather than LangString's.

-Stu

Need an installer? http://www.afrowsoft.co.uk
Afrow UK is offline   Reply With Quote
Old 17th December 2004, 21:26   #8
pengyou
Major Dude
 
Join Date: Mar 2003
Posts: 569
Quote:
If you do, MUI just seems to fall to pieces (I have found).
I have no trouble using language strings in my English-only MUI-based installers.

Did you remember to include the
code:
!insertmacro MUI_LANGUAGE "English"
line in your script ?
pengyou is offline   Reply With Quote
Old 17th December 2004, 22:09   #9
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
Quote:
Originally posted by pengyou
I have no trouble using language strings in my English-only MUI-based installers.

Did you remember to include the
code:
!insertmacro MUI_LANGUAGE "English"
line in your script ?
That's the reason that I said that LangStrings are pointless in his script because he isn't including the English language!

-Stu

Need an installer? http://www.afrowsoft.co.uk
Afrow UK is offline   Reply With Quote
Old 17th December 2004, 23:30   #10
pengyou
Major Dude
 
Join Date: Mar 2003
Posts: 569
Quote:
That's the reason that I said that LangStrings are pointless in his script because he isn't including the English language!
The script might only use English at the moment but perhaps there are plans to add more languages in the future? Adding the MUI_LANGUAGE line is an easier change than getting rid of all the language strings in the script.

Surely there is no harm in using language strings even if the script only uses one language, provided the necessary MUI_LANGUAGE line is used? Some of my installers start out as English-only and end up supporting several languages and I have found it easier to use language strings right from the start.
pengyou is offline   Reply With Quote
Old 18th December 2004, 10:57   #11
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
You need to include the English language:
!insertmacro MUI_LANGUAGE "English"

This must be put in after you insert the Page macro's and before you insert any LangStrings.

I think the reason that your installer isn't working properly is because you are currently using LangStrings specifying ${LANG_ENGLISH} when you do not have ${LANG_ENGLISH} set (using the MUI_LANGUAGE macro).

-Stu

Need an installer? http://www.afrowsoft.co.uk
Afrow UK is offline   Reply With Quote
Old 19th December 2004, 21:03   #12
Joost Verburg
NSIS MUI Dev
 
Join Date: Nov 2001
Posts: 3,717
There is absolutely no need to add that .onInit code in this topic. For a MUI header image you only need:

!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "STPMessengerTitleSmall.bmp"

But an installer always needs a language, if you are only using Ennglish, you have to include the MUI_LANGUAGE macro for English.
Joost Verburg is offline   Reply With Quote
Old 21st December 2004, 10:55   #13
bgosalci
Junior Member
 
Join Date: Dec 2004
Posts: 17
Uninstaller header image

Hi, I have a similar problem, I am successfully displaying my bitmaps in the header using the command !define MUI_HEADERIMAGE_BITMAP but when trying to change the header image of my uninstaller the same header image as the one set by !define MUI_HEADERIMAGE_BITMAP is shown.

How would I set the uninstaller header image. I am using
!define MUI_UNHEADERIMAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Header\orange-uninstall.bmp" but it does not work
bgosalci is offline   Reply With Quote
Old 21st December 2004, 11:14   #14
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
Use !define MUI_HEADERIMAGE_UNBITMAP "$PLUGINSDIR\file.bmp"
Also remeber it's the path to the Bitmap file on the user's computer, not yours!!!

-Stu

Need an installer? http://www.afrowsoft.co.uk
Afrow UK is offline   Reply With Quote
Old 22nd December 2004, 14:47   #15
Joost Verburg
NSIS MUI Dev
 
Join Date: Nov 2001
Posts: 3,717
That's not true, the MUI will extract the file to the users system automatically.
Joost Verburg is offline   Reply With Quote
Old 22nd December 2004, 21:14   #16
sirchris
Junior Member
 
Join Date: Dec 2004
Posts: 8
This doesnt work for me either

!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Header\nsis.bmp"

I get no header image without the mui_headerimage_bitmap line i'll get the default
sirchris is offline   Reply With Quote
Old 23rd December 2004, 11:45   #17
Joost Verburg
NSIS MUI Dev
 
Join Date: Nov 2001
Posts: 3,717
Did you include the language macro? Try to modify a basic example script to see whether the problem is related to your script.
Joost Verburg is offline   Reply With Quote
Old 23rd December 2004, 12:15   #18
sirchris
Junior Member
 
Join Date: Dec 2004
Posts: 8
!insertmacro MUI_LANGUAGE "English"

;--------------------------------
;Interface Configuration

!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Header\nsis.bmp"
!define MUI_ABORTWARNING

;--------------------------------
;Pages

!insertmacro MUI_PAGE_LICENSE "${NSISDIR}\Contrib\Modern UI\License.txt"

I was just modifying the basic script . I added the headerimage_bitmap line and moved the language line to the top
sirchris is offline   Reply With Quote
Old 23rd December 2004, 12:17   #19
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
Please see the MUI readme. It shows you how to make a script in steps. You always insert the MUI_LANGUAGE macro after all interface configuration and MUI_PAGE macro's.

-Stu

Need an installer? http://www.afrowsoft.co.uk
Afrow UK is offline   Reply With Quote
Old 23rd December 2004, 14:33   #20
sirchris
Junior Member
 
Join Date: Dec 2004
Posts: 8
I did have that there. The only reason I moved it was I was getting an error, which seems to be gone now interestingly enough. maybe it ws something else.
sirchris is offline   Reply With Quote
Reply
Go Back   Winamp Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump