View Issue Details

IDProjectCategoryView StatusLast Update
0000679Far ManagerFile associationspublic2008-12-26 12:30
Reportertheultramage Assigned Toalexy  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Fixed in Version2.0 
Summary0000679: option "use windows registered types" doesn't work
DescriptionI have a windows system where it seems WMP 11 has taken over all media file associations. Whenever I try to run an mp3 file by pressing 'Enter' on it, I get "No application is associated with the specified file for this operation" (GetLastError() 1155).

But I have overridden the default program to be MPC, and when I open the file in Explorer, or use ctrl+Enter in FAR, it works. Another workaround is to delete the .mp3 registry key and re-associate the file extension. Or define a custom association within FAR. All these work, but I want the default 'Enter' action to work!
Additional InformationI tried to trace the problem, but got buried under heaps of code that mess with the registry. I also saw that FAR uses a fairly low-level approach - direct reading of data from multiple locations in the registry. It is possible that the code isn't 100% vista-compatible. I suggest tossing out all that problematic code and replacing it with a proper WinAPI call, if one exists.
TagsNo tags attached.
Build695

Activities

alexy

2008-12-25 18:30

administrator   bugnote:0002244

Well there is no single api call, as far does all that registry stuff to find out which executable will be used to run the file to know if it a console program or gui so it will know if to run in the in its own window or use ShellExecute.
Basically far looks in HKEY_ROOT_CLASSES for .mp3, to find out where it points to and the goes there and tries to find out the default action and then check what is run for that default action. So we need to see your registry setting to understand what goes wrong.

theultramage

2008-12-25 19:52

reporter   bugnote:0002245

Alright, here's a trace (for a .mid file):

GetShellAction() opens HKCR\.mid and fetches the default value. This is 'WMP11.AssocFile.MIDI'.
Then it opens HKCR\WMP11.AssocFile.MIDI\shell and fetches the default value. This is 'play'.
Then it opens HKCR\WMP11.AssocFile.MIDI\shell\play\command and fetches the default value. This is '"%ProgramFiles%\Windows Media Player\wmplayer.exe" /Play "%L"'.

Afterwards the shellexecute struct is filled (cbSize=60, fMask=1344, lpVerb="play", lpFile="<the path>", lpParameters="", nShow=1, rest are zeroes).
ShellExecute() fails, GetLastError() returns 1155 ("No application is associated with the specified file for this operation."), FAR prints error and the whole operation ends.

Windows has a list of registered applications for the extension (along with the default one), and it has no problems executing the player I use when I doubleclick on a media file in Windows Explorer (or use the EMenu and either choose Open With, or just Open). This leads me to believe that FAR is not performing the 'use windows registered types' feature correctly (or is using some deprecated method).

If you need more info I'm available for realtime communication at any time.

alexy

2008-12-25 22:21

administrator   bugnote:0002249

fixed in 693

theultramage

2008-12-26 11:28

reporter   bugnote:0002252

Alright, seems to be working now :3
So it was the case that Microsoft changed the association mechanism in Vista. Thanks for researching and implementing it in r2368 :)

Issue History

Date Modified Username Field Change
2008-12-22 23:12 theultramage New Issue
2008-12-22 23:12 theultramage Status new => assigned
2008-12-22 23:12 theultramage Assigned To => alexy
2008-12-25 18:30 alexy Note Added: 0002244
2008-12-25 19:52 theultramage Note Added: 0002245
2008-12-25 22:21 alexy Note Added: 0002249
2008-12-25 22:21 alexy Status assigned => feedback
2008-12-26 11:28 theultramage Note Added: 0002252
2008-12-26 12:30 alexy Build => 695
2008-12-26 12:30 alexy Status feedback => closed
2008-12-26 12:30 alexy Resolution open => fixed
2008-12-26 12:30 alexy Fixed in Version => 2.0