Talk:FileAssoc: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
No edit summary
(quotes fix for COMMAND)
Line 20: Line 20:


/Pontus
/Pontus
== quotes fix for COMMAND ==
Hi,
previous post: obvisously the File Class description is missing in the sample after the file class ID.
In the command if you use double quotes like in myExe.exe "%1", the script will think you have 5 parameters to WriteRegExp ( Nsis 2.12 ).
Since it's unlikely anyone will use single quotes in a command, I suggest to fix it by remplacing the double quotes around {COMMAND} in the macro by single quotes:
WriteRegStr HKCR "${FILECLASS}\shell\open\command" "" '${COMMAND}'
Cedric.

Revision as of 01:02, 31 December 2005

There is a bug in the script (I think...)

In the example you call with five parameters:

; !insertmacro APP_ASSOCIATE "txt" "myapp.textfile" "$INSTDIR\myapp.exe,0" \

; "Open with myapp" "$INSTDIR\myapp.exe $\"%1$\""

but in the fuction header there is six patrameters declared:


!macro APP_ASSOCIATE EXT FILECLASS DESCRIPTION ICON COMMANDTEXT COMMAND


There must be somthing wrong here or?

/Pontus

quotes fix for COMMAND

Hi,

previous post: obvisously the File Class description is missing in the sample after the file class ID.

In the command if you use double quotes like in myExe.exe "%1", the script will think you have 5 parameters to WriteRegExp ( Nsis 2.12 ). Since it's unlikely anyone will use single quotes in a command, I suggest to fix it by remplacing the double quotes around {COMMAND} in the macro by single quotes:

WriteRegStr HKCR "${FILECLASS}\shell\open\command" "" '${COMMAND}'

Cedric.