Archive: double quoation in macros


double quoation in macros
Hi,

I need a little helü with double quotation in marcro parameters.

I wrote a macro like this:
!macro CreateShellCommand EXTENSION APPLICATION COMMAND DESCRIPTION ACTION
WriteRegStr HKCR "${APPLICATION}.${EXTENSION}\shell\${COMMAND}" "" "${DESCRIPTION}"
WriteRegStr HKCR "${APPLICATION}.${EXTENSION}\shell\${COMMAND}\command" "" "${ACTION}"
!macroend

I wanted to call it this way:
!insertmacro CreateShellCommand 'slcr' 'SLCRechner' 'open' 'Oeffnen' '"$INSTDIR\slcrechner.exe" "%1"'

Then I get the error:
Error: unterminated string parsing line at macro:CreateShellCommand:2

If I change the last parameter to '$INSTDIR\slcrechner.exe %1' everything is fine.

Can somebody help me understand the bug in my code?

Thanks,
Sascha


Imagine placing '"$INSTDIR\slcrechner.exe" "%1"' in "${ACTION}". It would become:
""$INSTDIR\slcrechner.exe" "%1""

Then you've got three paramaters with text in between...
"", " ", ""

-Stu


Hi,

thanks for the reply, but I can still not figure out how to do it.

If I leave out the quote marks and write ${ACTION} instead of "${ACTION}", it still doesn't work.
Now it complains: WriteRegStr expects 4 parameters, got 5.

How would I have to write a macro to pass a string containing quotes?


Try to use

WriteRegStr HKCR "${APPLICATION}.${EXTENSION}\shell\${COMMAND}\command" "" '${ACTION}'
and
!insertmacro CreateShellCommand 'slcr' 'SLCRechner' 'open' 'Oeffnen' '$INSTDIR\slcrechner.exe "%1"'

Great, it works. Thanks a lot.