Talk:FileAssoc: Difference between revisions

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


Cedric.
Cedric.
: Even better, backticks. Done. --[[User:Kichik|kichik]] 03:45, 31 December 2005 (PST)

Revision as of 11:45, 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.

Even better, backticks. Done. --kichik 03:45, 31 December 2005 (PST)