Welcome! I am Jason Nguyen, a graduate student in ethnomusicology at Indiana University, Bloomington, and this blog is where I make observations about music, culture, and academic life.

# Windows File Associations in Linux WINE

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:

1. Go to the terminal and type
wine regedit
2. 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
3. Right-click HKEY_CLASSES_ROOT –> Select “New Key” –> type “doc.file” –> Press Enter
4. Navigate now to “doc.file” –> Right Click –> “New Key” –> type “shell”
5. “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”
6. 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\""
7. 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\""
8. 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:
9. 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\""

### 10 comments to Windows File Associations in Linux WINE

• blasious

Hi it is working for me till vlc pops up, but than I get this message from it:

VLC could not open the file “/home/blasious/Desktop/H:\Desktop\pi.avi”.

Instead of %1 is there anything I could put? The path is a kind of duplicated.

• Did you try the alternative option linked at the top of the page? It’s a bit more automated and does a bit more cleanup work.

Also, where is your file actually located? /home/blasious/Desktop/pi.avi ?

• blasious

Thank you for answering, no I have not tried that, but I have found an other solution… I put a script in the registry which translates the path, and it is working fine.
The script is:

#!/bin/bash
set -x
vlc “wine winepath -u “$1″” in registry [HKEY_CLASSES_ROOT] –> [.avi] = “avi.file” –> [avi.file] —-> [shell] ——> [open] ——–> [command] = C:\windows\command\start.exe /Unix /vlc-start %1 (vlc-start is the name of the script) • Hector blasious, I preferr your solution because I have a 32 bits wine and a 64 bits linux, but I am missing one point, where exactly do you put the script file? I tried with the wine windows dir, my home, etc and nothing • Ian Hi I have a problem, I followed your instructions and got evernote to associate doc and docx files with opening libreoffice. However I get an error message “/home/ian/.wine/drive_c/Program Files/Evernote/Evernote/.wine/dosdevices/C:/users/ian/Local Settings/Application Data/Evernote/Evernote/Databases/Attachments/Test document.docx does not exist.” I guess it is something to do with evernote placing a file in the attachments folder for editing purposes. I did check the attachments folder and the file is not there, only a backup. Any ideas? • Yeah, what you’ll have to do is figure out where Evernote is placing temporary editing copies when you try to launch a helper app, then make sure you know exactly what that path is. Do you know where Evernote is dumping those doc files as an absolute path? • Ian Hi Thanks for your prompt reply, I will have a look and see if I can sort it out, I think because I was trying all sorts of stuff I inside wine and having more than one wine prefix I could be looking in the wrong place. I will let you know, I may even get rid of it all and start from scratch now I know how to change the registry. • Ian Hi I checked the path and the files should open in .wine/dosdevices/C:/users/ian/Local Settings/Application Data/Evernote/Evernote/Databases/Attachments but the error message I get is “/home/ian/.wine/drive_c/Program Files/Evernote/Evernote/.wine/dosdevices/C:/users/ian/Local Settings/Application Data/Evernote/Evernote/Databases/Attachments/Test document.docx does not exist.” If you notice I am getting an extra bit because it is trying to find the path .wine/drive_c/Program Files/Evernote/Evernote/ .wine/dosdevices…… so the path it is following is through the Program Files directory. Not sure why this is. • Felipe Hi Ian. To edit pdf evernote attachments, you need to install a pdf reader (I used foxit 7.2.8) inside the same virtual drive evernote resides. In POL, go to configure, miscellaneous, run a .exe file in this virtual drive, select foxit installer. It worked for me (evernote 5.8, wine 1.7). Apparently, the problem occurs when evernote opens an attachment using apps outside the virtual drive (i.e. native linux apps). Evernote (or maybe wine?) cannot track if the attachment is open, so the temp file is deleted after opening. • EdwinWet Buy Zanaflex online uk paypal, Purchase Zanaflex No Prescription, Zanaflex canada prescription required We know how to ensure your ultimate health and optimism! Visit our trusted pharmacy! Buy Zanaflex Now and get 10% OFF!! BEST PRICES! Visit Our Online Pharmacy! Related: Maryland Health Services Cost Review Commission Announces New Secretary Robert Neall Announces Maryland Department Of Health Appointments. You may have heard of people suffering from spondylitis, a type of condition that causes pain and discomfort. While earlier it was most common in those who. Vidalta is licensed for the treatment of hyperthyroidism which is a common hormonal disease of middle aged to older cats. Vidalta tablets are prolonged release. Total, a French oil and gas giant with a$120 billion market cap, just offered to acquire French battery specialist Saft for \$1.1 billion. Bring to the boil then reduce the heat to a gentle simmer for 3-5 minutes, depending on how you like your egg cooked. After 3 minutes it will be really soft and. On Pingelap, a tenth of the population is totally colour-blind. Define E.e.s. granules. E.e.s. granules synonyms, E.e.s. granules pronunciation, E.e.s. granules translation, English dictionary definition of E.e.s. granules. n. In 2003 the Drug Enforcement Agency first detected levamisole in cocaine bricks. In 2008 officials in Alberta, Canada identified a cluster of.