ijerkovi
19th August 2003 18:52 UTC
File Association
I read through all the documentation but I am still having trouble with the following file association. Here are the requirements
1) A third party application installs itself under this HKCR
>ReadRegStr $0 HKCR "Applications\cView.exe\shell\open\command" ""
I can read this value with no problem (I get this string back: "C:\Program Files\cView\cView.exe" "%1")
2) Now I need to associate ".rpt" files with this application. I try doing the following:
;create file association
ReadRegStr $0 HKCR "Applications\cView.exe\shell\open\command" ""
WriteRegStr HKCR ".rpt" "" "Applications\cView.exe"
WriteRegStr HKCR ".rpt\DefaultIcon" "" $0,0
WriteRegStr HKCR "Applications\cView.exe" "" "cView File"
WriteRegStr HKCR "Applications\cView.exe\shell" "" "open"
It does not work!
Any help would be greatly appreciated.
Joost Verburg
19th August 2003 20:45 UTC
ReadRegStr $0 HKCR "Applications\cView.exe\shell\open\command" ""
WriteRegStr HKCR ".rpt" "" "cView"
WriteRegStr HKCR "cView" "" "cView File"
WriteRegStr HKCR "cView\DefaultIcon" "" "$0,0"
WriteRegStr HKCR "cView\shell\open\command" "" "$0"
Afrow UK
19th August 2003 20:49 UTC
You should use the scripts on the NSIS Archive:
http://nsis.sourceforge.net/archive/...instances=0,11
-Stu
ijerkovi
19th August 2003 20:56 UTC
I got the association working but
I can not get DefaultIcon to work....the code I have so far is:
Function fileAssociation
;create file association
ReadRegStr $0 HKCR "Applications\cView.exe\shell\open\command" ""
StrCpy $9 " $\"%1$\""
StrCpy $1 $0
; remove end characters
Call removeFromString
; remove inital quote
StrCpy $9 "$\""
Call removeFromString
; remove end quote
StrCpy $9 "$\""
Call removeFromString
WriteRegStr HKCR ".rpt" "" "Applications\cView.exe"
WriteRegStr HKCR ".rpt\DefaultIcon" "" $1,0
WriteRegStr HKCR "Applications\cView.exe" "" "cView File"
WriteRegStr HKCR "Applications\cView.exe\shell" "" "open"
FunctionEnd
Joost Verburg
19th August 2003 21:17 UTC
I've updated my code. Please try my code again.