Skip to content
⌘ NSIS Forum Archive

Customizing the welcome message

29 posts

SteveRussell#

Customizing the welcome message

How do I go about changing the welcome/instructions text in my installer? And possibly add a bitmap and/or icon? (I have not yet found this in the help areas I've searched, or I would not be posting such a simple question.)
Red Wine#
Discussed already a few threads below,

Are you a developer who uses NSIS to distribute your application? Are you a Winamp plug-in developer who wants to use NSIS to distribute your plug-in? Have suggestions for other people like you? This is the place.
SteveRussell#
Okay, I guess you're referring me to the Modern User Interface, which I must admit I almost -- but didn't quite -- examine. Thank you very much.
Red Wine#
I'm definitely referring to MUI 🙂
I redirected you to that page mainly because of the attached picture (even from UMUI) so we'd know about what we're talking 🙂
SteveRussell#
Related to this situation: The name of my software includes an ampersand (&), such as This&That. If I use a double ampersand, i.e. This&&That, the name is rendered correctly everywhere but in the title bar, where the string is rendered exactly as typed in my nsi file. Any suggestions?
SteveRussell#edited
I sure appreciate the help, Red Wine! But I still have a lingering ampersand problem. When I cancel the installation, I get the message "Are you sure you want to quit This&&That setup?"

The only place I am now using the double ampersand is in the name.

!define PRODUCT_NAME "This&&That"
Red Wine#
Sorry Steve perhaps I'm not getting your point correctly,
if you need to use the product name on several different places in your script and the single & causes problems everywhere but the name, you may use,
!define PRODUCT_NAME "This&That"
!define PRODUCT_DESCRIPTION "This&&That"
Name "${PRODUCT_NAME}"
on every other place where you're referring that it causes the problem use ${PRODUCT_DESCRIPTION}
SteveRussell#
Thank you. I am further experimenting with your suggestions. However, let me state myself more clearly:

After I tried your prevous directions:

name "this&&this"
caption "this&this" ,

all was well except for the double ampersand in the Cancel message. I don't know how to control that.
Red Wine#
See my last post above, should do the trick.
Either remove caption or use caption "${PRODUCT_NAME}" or something else that you may desire as caption.
Now messagebox's title should be equal with the name definition.
SteveRussell#
It seems that everything is being rendered correctly now, after using kichik's suggestion. Thank you both very much!
SteveRussell#
Coming back now to the bigger picture, I want to completely replace the Welcome page text. In looking for an example of this, the closest I have come is http://forums.winamp.com/printthread...readid=263388.

Could I get a little direction in how to proceed? Or perhaps point me to a clear example of this very thing?
SteveRussell#
After experimenting with variations on the link I mentioned above, I am starting to see the light. I don't want to be posting unnecessary questions, so I'll see how far I can get before asking any more.
SteveRussell#
I have implemented a few lines for my Welcome page, based on http://forums.winamp.com/printthrea...hreadid=263388.

!define MUI_PAGE_CUSTOMFUNCTION_PRE 'WelPre'
; Welcome page
!insertmacro MUI_PAGE_WELCOME
. . .
Function WelPre
WriteINIStr '$PLUGINSDIR\iospecial.ini' 'Settings' 'NumFields' '2'
WriteINIStr '$PLUGINSDIR\iospecial.ini' 'Field 2' 'Text' 'This&&That is ready to install.'
WriteINIStr '$PLUGINSDIR\iospecial.ini' 'Field 3' 'Text' 'Click "Next" to get going!'
FunctionEnd

But I can't seem to get something similar to work for the Directory page. My testing looks like this:

!define MUI_PAGE_CUSTOMFUNCTION_PRE 'WelPreDir'
; Directory page
!insertmacro MUI_PAGE_DIRECTORY
. . .
Function WelPreDir
WriteINIStr '$PLUGINSDIR\ioB.ini' 'Field 1' 'Text' 'Now choose the install directory.'
WriteINIStr '$PLUGINSDIR\ioB.ini' 'Field 2' 'Text' 'field 2 test'
WriteINIStr '$PLUGINSDIR\ioB.ini' 'Field 3' 'Text' 'field 3 test'
FunctionEnd

Any comments?
Red Wine#
Steve allow me to say that you seem a bit confused so far 🙂
To change the Welcome/Finish page title and text you need
MUI_PAGE_HEADER_TEXT text
Text to display on the header of the page.

MUI_PAGE_HEADER_SUBTEXT text
Subtext to display on the header of the page.

See MUI documentation http://nsis.sourceforge.net/Docs/Mod...UI/Readme.html
Also see this wiki page,


For all other pages see these wiki pages to get a frame on how you may deal with their controls,

SteveRussell#
Thanks, Red Wine. This too is enlightening, but I still don't see a relationship with the text below the subtitle, i.e. in the gray area of the Directory page. How do I get to that area?
Red Wine#
Open the MUI WelcomeFinish.nsi example and add the following line along with other Language Strings descriptions
  LangString ^DirText ${LANG_ENGLISH} "my text"
Should be repeated for every language that included in your installer.
SteveRussell#
I guess what I was looking for was
MUI_WELCOMEPAGE_TEXT, etc. Your comments led me to relevant documentation.

Thank you again for helping me as I have been taking my first deeper look into NSIS.
Red Wine#
guess what I was looking for was
MUI_WELCOMEPAGE_TEXT, etc. Your comments led me to relevant documentation.
Certainly this is what you were looking related to welcome/finish page. I got confused with the text from MUI readme while I was trying to copy/paste a part in order to show the way to go! Sorry 🙂
What about the directory page, did you change the DirText?
SteveRussell#
Yes, I did change the text on the Directory page too, as well as all bitmaps. But I have not yet found it possible to place my gradient bitmap across the entire window without wiping out the text. So maybe I need to learn some more about using .ini files and laying out the areas of the dialog.
SteveRussell#
What would I have to do to make this ioSpecial.ini configuration show the text of Field 2 against the wide bitmap, rather than apparently being wiped out by the bitmap?

[Settings]
Rect=1044
NumFields=3
[Field 1]
Type=bitmap
Left=0
Right=-1 ;109
Top=0
Bottom=193
Flags=RESIZETOFIT
[Field 2]
Type=label
Left=120
Right=315
Top=10
[Field 3]
Type=label
Left=120
Right=315
Red Wine#
Edit: From InstallOptions manual,

TRANSPARENT:

Used by "Bitmap" controls. Hides every pixel with the same color as of the top left pixel. This allows to see-through to controls behind it. This flag doesn't work well with a combination of the RESIZETOFIT flag and bitmaps with more than 256 colors.
SteveRussell#
Thank you for that, Red Wine. Here's what I now have, using a pure red bitmap that fits the window, and again the text is no longer visible:

[Settings]
Rect=1044
NumFields=3
[Field 1]
Type=bitmap
Left=0
Right=-1 ;109
Top=0
Bottom=193
Flags=TRANSPARENT ;| RESIZETOFIT
[Field 2]
Type=label
Left=120
Right=315
Top=10
[Field 3]
Type=label
Left=120
Right=315

What am I missing?
SteveRussell#
Which field are you referring to? Except for a few changes, this is the actual ioSpecial.ini file. Why would I need to change dimensions of any field other than the bitmap in order to see the text?

I did experiment after your response, but I still can't see anything but red where there had been text.
Red Wine#
Hmm, I didn't realize that you were referring to iospecial.ini that is used by MUI in order to display the welcome/finish pages.
This file edited dynamically by MUI macro system within .onGuiInit function, (see the file system.nsh at contrib\modern ui folder).
You need either edit the file dynamically within welcome/finish pages custom functions pre/show, or use MUI_SPECIALINI, (see MUI manual chapter Customize standard dialogs).
pospec#
Here are my notes about customizing the welcome message on MUI_PAGE_WELCOME via defining MUI_WELCOMEPAGE_TEXT.
My task was to add some text after string $(MUI_TEXT_WELCOME_INFO_TEXT) (This wizard will guide you...). Problem was that this string uses $\r and $\n but MUI_WELCOMEPAGE_TEXT expects \r and \n. (If you pass original $(MUI_TEXT_WELCOME_INFO_TEXT) value then it is trimmed after first \r\n.) Easy solution was to use StrReplace and delete 'control' characters.
I feel ashamed that my first attempt was editing the ioSpecial.ini. 🙂
Finally, after comparing this two ways I decide to create another label because I want to have the added text BOLD. 😎