Archive: File Association Problem ?


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:


How about this?
http://nsis.sourceforge.net/File_Association

Stu


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.


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.


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]


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


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

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.)


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?