- NSIS Discussion
- Customizing the welcome message
Archive: Customizing the welcome message
SteveRussell
19th January 2007 23:22 UTC
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
19th January 2007 23:31 UTC
Discussed already a few threads below,
http://forums.winamp.com/showthread....hreadid=263442
SteveRussell
19th January 2007 23:56 UTC
Well, thanks, but I do not see how that thread answers my questions.
SteveRussell
20th January 2007 00:02 UTC
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
20th January 2007 00:07 UTC
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
20th January 2007 00:49 UTC
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?
Red Wine
20th January 2007 01:18 UTC
you may use caption instead
e.g.
name "this&&this"
caption "this&this"
SteveRussell
20th January 2007 01:43 UTC
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
20th January 2007 10:40 UTC
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
20th January 2007 13:32 UTC
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.
kichik
20th January 2007 13:41 UTC
Use:
Name "this&this" "this&&this"
Red Wine
20th January 2007 13:47 UTC
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
20th January 2007 13:52 UTC
It seems that everything is being rendered correctly now, after using kichik's suggestion. Thank you both very much!
SteveRussell
20th January 2007 15:22 UTC
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
20th January 2007 16:22 UTC
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
20th January 2007 19:26 UTC
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
20th January 2007 19:41 UTC
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,
http://nsis.sourceforge.net/Adding_3...e-Finish_Pages
For all other pages see these wiki pages to get a frame on how you may deal with their controls,
http://nsis.sourceforge.net/Changing...s_on_MUI_Pages
http://nsis.sourceforge.net/Demonstr...Pre_Show_Leave
SteveRussell
20th January 2007 20:30 UTC
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
20th January 2007 20:47 UTC
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
21st January 2007 06:03 UTC
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
21st January 2007 06:58 UTC
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
21st January 2007 14:49 UTC
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
25th January 2007 23:37 UTC
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
26th January 2007 00:02 UTC
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
26th January 2007 01:35 UTC
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?
Red Wine
26th January 2007 05:14 UTC
You haven't specified all needed values regarding to width/height e.g.
top=10
bottom=20
SteveRussell
26th January 2007 11:15 UTC
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
26th January 2007 11:55 UTC
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
24th October 2007 20:13 UTC
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. :cool: