UPDATE: Easier version available here.
Normal readers can ignore the following tech geek asplosion…
I recently transitioned to Ubuntu from Windows and it’s been a pretty awesome journey. For the most part, the native apps are great–OpenOffice.org (word processor), Firefox for Linux, Pidgin (instant messaging), etc.–but I’ve had to use one Windows application, Evernote, which I am running through the WINE abstraction layer.
Evernote 3.1 works great in Evernote (the new Evernote 3.5 beta will not work because it uses the .NET 3.5 Framework) save for some graphical glitches and the following technical issues:
- no easy way to open attachments (.doc ; .pdf ; etc)
- no file drag and drop for attachments
Today I’m going to deal with the first problem…
Setting up file associations
If I try to launch a .doc file in Evernote, it throws an error because there’s no Windows program associated with it. But I don’t want to install Word or Office in Wine, I’d much rather run the Linux-native OpenOffice. So I have to get Wine to run a Linux program…
Windows file associations are handled in the registry, so our edits will have to be made there:
- Go to the terminal and type
wine regedit
- A clone of the Windows registry editor will show up. Navigate to HKEY_CLASSES_ROOT and look for the “.doc” key. The key will have one (default) value in it. Right-click the value–> Modify –> type “doc.file” (no quotes) –> Press Enter
- Right-click HKEY_CLASSES_ROOT –> Select “New Key” –> type “doc.file” –> Press Enter
- Navigate now to “doc.file” –> Right Click –> “New Key” –> type “shell”
- “shell” should now be a child to “doc.file”. Repeat step 4 to create “open” as a child to “shell” and then “command” as a child to “open”
- Add the following value to command like we did in step 2 (replace “/usr/bin/oowriter” with the path to whatever editor you are using)
c:\windows\command\start.exe /Unix "/usr/bin/oowriter \".wine/dosdevices/%1\""
- So, the following changes should have been made to the registry:
[HKEY_CLASSES_ROOT] --> [.doc] = "doc.file" --> [doc.file] ----> [shell] ------> [open] --------> [command] = c:\windows\command\start.exe /Unix "/usr/bin/oowriter \".wine/dosdevices/%1\""
- This SHOULD work, but it probably won’t, because Wine seems to use lowercase “c:” for the main drive whereas windows uses “C:”. That’s easy. Go back to the terminal and do this (makes a symbolic link to a “C:” drive):
ln -s ~/.wine/drive_c ~/.wine/dosdevices/C:
- Done!
Whew. This same process should work for any file type being called by a Windows program in Wine by repeating steps 1-7 for the file extension and program of your choice. (Tip: if you are associating an extension to the same program, just use the same name in step 2 and you’re done. E.g. I can just set the value of the [.docx] key to “doc.file” and forgo the rest.)
I might figure out drag-and-drop at some point. Maybe.
c:\windows\command\start.exe /Unix "/usr/bin/oowriter \".wine/dosdevices/%1\""