Archive: Escaped quotes working inconsistantly


Escaped quotes working inconsistantly
I had sucessfully used the section description text of:

!insertmacro MUI_DESCRIPTION_TEXT ${Section1} "If $\"GNU tar$\" is checked, the installer for GNU tar (Windows version) will be executed when you click $\"next$\"."

without getting an error, but then I inserted it in a different location, and now the escaped quotes in the line above give me the error:

SendMessage expects 4-6 parameters, got 34.
Usage: SendMessage hwnd message [wparam|STR:wParam] [lparam|STR:lParam] [$(user_var: return value)] [/TIMEOUT=X]
Error in macro MUI_DESCRIPTION_TEXT on macroline 8
Error in script "C:\Program_Files_2\EZ_TAR_INSTALLER.nsi" on line 96 -- aborting creation process

Line 96 is the line with the escaped quotes. If I replace the escaped quotes with single quotes, it works. I don't remember if I used the text with the !insertmacro instruction before, but I know I somehow got the escaped-quotes version to work when hovering over an item in the component menu, with no error.

No big deal to use the single quotes, but it made me waste some time, so incase it's a bug, I figured I'd mention it.

This happened with "Compile and run" in HM NIS Edit, but I'm assuming it's a NSIS problem.


I recommend you use e.g. 'hello my name is "bobo"'

-Stu


That worked for that case, but needed to use quotes in a different part of the script and the only quoting that worked was the following (I put backslashes between the dollar signs and the single quotes, but they don't show in this post):

!insertmacro MUI_DESCRIPTION_TEXT ${GNU_tar}'Check box next to $'GNU tar and EZ tar$' to install EZ TAR and execute the GNU tar installer. EZ TAR requires a separate, command line tar utility such as GNU tar.'

When I replaced the escaped single quotes with double quotes, I got the following error (whether or not I escaped the double quotes):

!insertmacro: MUI_DESCRIPTION_TEXT
SendMessage expects 4-6 parameters, got 32.
Usage: SendMessage hwnd message [wparam|STR:wParam] [lparam|STR:lParam] [$(user_var: return value)] [/TIMEOUT=X]
Error in macro MUI_DESCRIPTION_TEXT on macroline 8
Error in script "C:\123123123.nsi" on line 77 -- aborting creation process
I just realized that I put the dollar sign before the backslash instead of after by accident, but that's the only way the quotes don't give me an error! Maybe there's a bug in NSIS due to a backslash being before the dollar sign, allowing my bug to work by accident.

Yikes! The dollar sign does before the backslash to represent characters like newlines, according to 4.2.4 Constants Used in Strings, but the dollar sign goes after the backslash when escaping a quote, according to 2.2 Script Files. Error in the documentation?

Originally posted by BarryB
Yikes! The dollar sign does before the backslash to represent characters like newlines, according to 4.2.4 Constants Used in Strings, but the dollar sign goes after the backslash when escaping a quote, according to 2.2 Script Files. Error in the documentation?
Thanks, fixed the error. It should be $\" not \$".

i'd rather use the following code:

!insertmacro MUI_DESCRIPTION_TEXT ${GNU_tar} 'Check box next to "GNU tar and EZ tar" to install EZ TAR and execute the GNU tar installer. EZ TAR requires a separate, command line tar utility such as GNU tar.'

Comm@nder21, that's the first thing I tried. Same error. Turns out that I won't be quoting anything anyway. I'd like to mention what the description refers to and put it in quotes, but my new description would get truncated because it's too long.

I wish there was a way to resize the description area. Is there?


Yes, you can use a custom interface resource file (see MUI_UI in the Modern UI Readme).