- NSIS Discussion
- HEADER IMAGE sizes
Archive: HEADER IMAGE sizes
bnicer
10th February 2005 02:09 UTC
HEADER IMAGE sizes
Hi!
I have two MUI header images. One for the installer and one for the uninstaller:
!define MUI_HEADERIMAGE_BITMAP "tigph.bmp"
!define MUI_HEADERIMAGE_UNBITMAP "pirate.bmp"
So far so good.
Now I want to increase the size of the bitmaps.
I edit modern_headerbmp.exe (with Resource Hacker) to implement bigger bitmaps, compile and then save as modern_headerbmp_2.exe, and add the following line to my script file:
!insertmacro MUI_DEFAULT MUI_UI_HEADERIMAGE "${NSISDIR}\Contrib\UIs\modern_headerbmp_2.exe"
This works. All header images increase in size by a few pixels.
That is the problem. I don't want "all" header images to be changed. I need bigger uninstaller ones. (Something to do with the bitmap being unshrinkable, sort of.)
ChangeUI IDD_UNINST "${NSISDIR}\Contrib\UIs\modern_2.exe"
would be nice, but I don't think it applies, or I haven't discovered how.
modern_2.exe is my personalized version of modern.exe in which make similar changes to the ones I make in modern_headerbmp_2.exe. I'm guessing "dialog 105" contains the header image controls. Is that correct?
Can anyone help out?
Thanks.
bnicer
10th February 2005 17:42 UTC
Hi again!
re: How do you change the header image size on the uninstaller pages without changing it on the installer pages?
To increase the header image size you can edit the resources in modern_headerbmp.exe. I now have modern_headerbmp_2.exe with modified controls.
What do I do next?
ChangeUI all "${NSISDIR}\Contrib\UIs\modern_headerbmp_2.exe"
and:
ChangeUI IDD_INST "${NSISDIR}\Contrib\UIs\modern_headerbmp_2.exe"
change the header image size on all pages, whereas:
ChangeUI IDD_UNINST "${NSISDIR}\Contrib\UIs\modern_headerbmp_2.exe"
is an error.
Does this mean that you cannot have two different header image sizes?
I'm new to this forum stuff -- a great institution, like democracy. I wouldn't know if anyone ever slips through the net and doesn't get a reply.
"I won't, I did," I replied to myself.
It's not an unreasonable question.
Thanks.
kichik
10th February 2005 20:50 UTC
ChangeUI is not the way way to change the UI using the MUI. The MUI uses ChangeUI too. You need to tell the MUI to use it differently to avoid conflicts. To do that, there are some defines. MUI_UI is one of them.
To your question, you can't have different UI for the installer and the uninstaller. You can add some empty space to the installer bitmap.
bnicer
10th February 2005 22:00 UTC
Thank you, Kichik!
I only wanted to change the default MUI header image on the uninstall pages by swapping modern_headerbmp.exe for modern_headerbmp_2.exe.
Is that not possible, or rather, can you only do that once (per script), because the change is universal and applies to all pages?
kichik
10th February 2005 22:59 UTC
You cannot change just the uninstaller image size. The installer and the uninstaller share the same dialog.
IDD_UNINST is the confirmation page, not the container dialog.
bnicer
10th February 2005 23:54 UTC
Thanks! I really appreciate it. It would appear you're right.
I have come across this line, which can be used only one time (and further instances are ignored by the compiler):
!insertmacro MUI_DEFAULT MUI_UI_HEADERIMAGE "${NSISDIR}\\Contrib\\UIs\\modern_headerbmp_2.exe"
You can't switch back to the original default later on.
I'm not complaining, just asking. NSIS beats INNO and it beats Setup Factory, anyone else reading this.
The other approach you mentioned was adding space to the installer bitmap. Do you mean by a
!define statement?
What do you recommend?
Getting late. Must quit.
kichik
10th February 2005 23:57 UTC
MUI_DEFAULT is an internal macro and should not be used. To change the UI you should define MUI_UI.
In the space suggestion I was referring to the image itself, not any define. Simply add some white space to the installer image so its size will match the uninstaller image size.
bnicer
11th February 2005 00:41 UTC
Sorry, I have to ask you another question, Kichik.
If you don't use the internal macro or ChangeUI, that leaves only defining MUI_UI:
!define MUI_UI ${NSISDIR}\Contrib\UIs\modern_headerbmp_2.exe
Why does this result in an error? The error line is:
!insertmacro MUI_PAGE_WELCOME.
I'm tempted to go back to using ChangeUI IDD_INST ... coupled with your suggestion of adding white space to the image.
Thanks again.
kichik
11th February 2005 10:55 UTC
I can't tell much without the exact error message, but if that define line was copied from your script verbatim, you are missing quotes. The NSISDIR define might contain spaces, so the path must be quoted.
bnicer
11th February 2005 15:08 UTC
There were two MUI_UIs that I had to predefine. It was the wrong "define". The Modern User Interface page in the NSIS user manual is a very useful source of information, if you take the time to read it carefully enough as I finally did last night.
MUI_UI ui_file
The interface file with the dialog resources. Change this if you have made your own customized UI.
Default: ${NSISDIR}\Contrib\UIs\modern.exe
MUI_UI_HEADERIMAGE ui_file
The interface files with the dialog resource IDD_INST that contains a bitmap control and space for the header bitmap.
Default: ${NSISDIR}\Contrib\UIs\modern_headerbmp.exe
It was my mistake. Once I defined the headerimage, I didn't need
ChangeUI. You were right.
exe
>!define MUI_UI_HEADERIMAGE ... modern_headerbmp_2.exe
>
One thing still puzzles me. If
modern.exe contains no resources for the headerimage, should you even alter the dialog controls to accommodate the larger header bitmap within
modern.exe, just to play it safe? I did, so I have two modified files. Is that necessary?
It may not be that important. On the other hand, what if something gets misinterpreted. Windows 95 maybe? It could make a difference whether
modern_2.exe reflects the changes made to
modern_headerbmp_2.exe.
It continues to be Thanks.
kichik
11th February 2005 15:16 UTC
The resources in the UI defined by MUI_UI_HEADERIMAGE (modern_headerbmp.exe by default) override those in the UI defined by MUI_UI (modern.exe by default). It is not necessary to alter the resource in modern.exe that are overridden anyway.