saschagottfried
13th October 2006 18:47 UTC
can't use quotes in string for MUI_WELCOMEPAGE_TITLE
Hi folks,
wanted to use this string in a welcome page. Got the string from NSIS help showing usage of quoted strings. I don't really need this feature, but you should know about it. Either this not implemented or the string in the MUI macros for the welcome page is not properly used. Any comments on this?
!define MUI_WELCOMEPAGE_TITLE "$\"A quote from a wise man$\" said the wise man"
!insertmacro MUI_PAGE_WELCOME
NSIS compiler reports this:
Error in macro MUI_INSTALLOPTIONS_WRITE on macroline 5
Error in macro MUI_FUNCTION_WELCOMEPAGE on macroline 10
Error in macro MUI_PAGE_WELCOME on macroline 23
Anders
14th October 2006 19:16 UTC
If you dont mind single qoutes you can do:
!define MUI_WELCOMEPAGE_TITLE "'A quote from a wise man' said the wise man"
otherwise, write to the .ini directly:
function fixwelcomepage
WriteIniStr "$pluginsdir\ioSpecial.ini" "Field 2" "Text" '"A quote from a wise man" said the wise man'
functionend
!define MUI_PAGE_CUSTOMFUNCTION_PRE fixwelcomepage
!insertmacro MUI_PAGE_WELCOME
the MUI docs say you should be able to escape so I guess this is a bug
Afrow UK
14th October 2006 20:41 UTC
Escape it twice like so:
!define MUI_WELCOMEPAGE_TITLE "$\$\"A quote from a wise man$\$\" said the wise man"
This has to be done because the unescaping is done twice. Probably when the text is passed via a macro parameter or something.
-Stu
Anders
14th October 2006 21:56 UTC
the docs should be updated then
saschagottfried
16th October 2006 09:04 UTC
@Anders: single quotes work. Thanks, but my text needs double quotes.
@AfrowUK: this works like a charm.
Comm@nder21
16th October 2006 16:18 UTC
what about using:
`'"blabla"'` ?
nsis will then remove one quotation after another and if it removes 2 quotations, hey, there is still the third one, the double quotes.
saschagottfried
17th October 2006 09:07 UTC
Thanks for all proposals. The challenge with this example is the documentation that leads the average NSIS user or even the beginner to proper usage of such quotes constructs. How this knowledge goes into the docs???