Archive: WriteRegStr problem


WriteRegStr problem
Hi,
I want to add to the registry:
HKEY_CLASSES_ROOT\MyApp\shell\open\command
@="C:\program files\MyAppDir\MyApp.exe" "%1"
My problem that if I write in the nsi file:
WriteStrReg HKEY_CLASSES_ROOT "MyApp\shell\open\command" '"$INSTDIR\MyApp.exe" "%1"' then the translation is:
WriteStrReg: HKEY_CLASSES_ROOT\MyApp\shell\open\command="$INSTDIR\MyApp.exe" "%1"
and the parser think the "%1" is another parameter and aborts.
how can I solve this problem
Thanks
-- Gilad


Use this if you want to create a file association (which I can only assume you do, because that's what it looks like):


WriteRegStr HKCR ".crap" "" "crapfile"
WriteRegStr HKCR "crapfile\DefaultIcon" "" "$INSTDIR\MyApp.exe,0" ;use this if your icon is part of MyApp.exe, use $INSTDIR\MyIcon.ico if your icon is a separate file
WriteRegStr HKCR "crapfile\shell\open\command" "" '"$INSTDIR\MyApp.exe" "%1"'


And now, an explanation of the above.

"Blah Blah Blah Blah" use double quotes (") when you have no need to put other quotes inside them.f

'Blah "Blah Blah" Blah' use single quotes (') when you need to put double quotes (") inside them.

`Blah "Blah" 'Blah' Blah` Use these quotes (`) when you need to put double (") and single (') quotes inside them.