- NSIS Discussion
- File Association Problem ?
Archive: File Association Problem ?
anandharaja
2nd May 2009 09:09 UTC
File Association Problem ?
hi
I have lots of file like ".mkv .avi .wmv .mov .rm etc" iam not like to install more player to watch this type of file.
my question is using NSIS I want to associate the file types to media player classic, and i double click on the above mentioned file i should open in media player classic as my default player.
Thanks in advance :up:
Afrow UK
2nd May 2009 12:38 UTC
How about this?
http://nsis.sourceforge.net/File_Association
Stu
anandharaja
2nd May 2009 15:29 UTC
I tried that FileAssociation.nsh but the files are not associated with media player classic. whenever i double click the file it launches openwith window, if i right click that file means it shows " Edit C:\Media Player classic\mplayerc.exe"
please any one attach a script & .nsh for me.
anandharaja
6th May 2009 07:30 UTC
can any one correct errors in this script for file association
hai i attached the nsis script for file association can any one check and correct the errors in that script.
my problem is after installing the package if i double click the avi file means it opens openwith window, if i right click the file means it shows " Edit $INSTDIR" ". how to i associate my files with mediaplayer classic.
Comperio
7th May 2009 01:12 UTC
I see a couple things:[list=1][*]You have RequestExecutionLevel set to 'user', but you are modifying the HKCR registry hive which requires admin privileges.
[*]After you change the extension, you should call SHChangeNotify. (See http://forums.winamp.com/showthread....readid=140254, which is referenced on the main File Association wiki article.) One way you can do this is by adding !include "FileFunc.nsh" to the top of your script, and then adding this just after you register the extension: ${RefreshShellIcons}[/list=1]
anandharaja
7th May 2009 03:57 UTC
Thank for your suggestion, i tried it but still my problem not solved. if anyone modifiy my script and attach it again. past 3 months i searching solution for file association. please any one write a simple script and attach it.
Thankyou
anandharaja
8th May 2009 15:18 UTC
File Association Solution
Finally i found solution
; Avi file Association
WriteRegStr HKCR ".avi" "" "MPC.avi"
WriteRegStr HKCR "MPC.avi" "" "AVI File"
WriteRegStr HKCR "MPC.avi\shell" "" "Play"
WriteRegStr HKCR "MPC.avi\shell\Play\command" "" '"$PROGRAMFILES\Media Player Classic\mplayerc.exe" "%1"' WriteRegStr HKCR "MPC.avi\DefaultIcon" "" "$PROGRAMFILES\Media Player Classic\Icons\movie.ico"
Thank you
Comperio
8th May 2009 17:42 UTC
I think that's basically what ${registerExtension} is supposed to do. The only advantage I see is that the ${registerExtension} also tries to create a backup so that you can put the system back the way you found it during an uninstall.
I've been super-swamped with work and personal issues that I have not had a chance to look at the RegisterExtension header. Aside from the 2 things I pointed out earlier, it seems like it should have worked.
But if your method works, then that's probably better for you anyway. (And the plus side is that you have better control over what you're doing rather than relying on the "man behind the curtain" so to speak.)
anandharaja
9th May 2009 04:29 UTC
i tried FileAssociation.nsh but that is not working. may be the problem in script but no one try to correct my script. comperio my script is right or wrong, any suggestion about my script. its working fine for me. what about you?