14 June 2013

452. Briefly: Wine and MIME nuisance: MS Modelling is associated with everything...

I've battled with this on and off for a long time.

And it's not problem unique to me: http://wiki.winehq.org/FAQ#head-c847a3ded88bac0e61aae0037fa7dbd4c7ae042a. The problem with that particular solution is that it's no good once the damage has happened. It's also a blanket method.

So, in a weak moment some winters ago I installed MS Modelling in Wine. I actually never use it, because there are better tools, but that's besides the point.

Unfortunately, MS Modelling has associated itself with most common (and uncommon) file types, such as .dat, .txt and .pgp:

I decided it was time to explore it in greater detail and remove all MS Modelling associations

The first step is to see how deep the rabbit hole goes:

grep "MS Modeling" $HOME/.local/share/applications/*.desktop
/home/verahill/.local/share/applications/wine-extension-3cam.desktop:Name=MS Modeling /home/verahill/.local/share/applications/wine-extension-accin.desktop:Name=MS Modeling /home/verahill/.local/share/applications/wine-extension-acx.desktop:Name=MS Modeling /home/verahill/.local/share/applications/wine-extension-arc.desktop:Name=MS Modeling [..] /home/verahill/.local/share/applications/wine-extension-xsd.desktop:Name=MS Modeling /home/verahill/.local/share/applications/wine-extension-xtd.desktop:Name=MS Modeling /home/verahill/.local/share/applications/wine-extension-xyd.desktop:Name=MS Modeling /home/verahill/.local/share/applications/wine-extension-xyz.desktop:Name=MS Modeling

85 file types. Not acceptable.

grep "MS Modeling" $HOME/.local/share/applications/*.desktop|sed 's/:/\t/g'|gawk '{print $1}'| xargs -I {} rm {}
grep "Materials Studio" $HOME/.local/share/mime/application/*.xml|sed 's/:/\t/g'|gawk '{print $1}'| xargs -I {} rm {}
update-mime-database ~/.local/share/mime

I also remove mime.cache, although I'm not sure whether that's a good idea. I haven't suffered for it yet though:
rm ~/.local/share/applications/mimeinfo.cache
update-mime-database ~/.local/share/mime

That solves the problem - temporarily.

Here's the issue: the files in $HOME/.local/share/mime/application/ get re-created when you start a wine program though.

And I think the problem is this: http://wiki.winehq.org/FileTypesIntegration

In other words, whatever associations are listed in the wine windows registry pollutes Gnome. And that's not acceptable. Anyway, let's put a stop to it using the method recommended on the Wine FAQ:

echo '[HKEY_CURRENT_USER\Software\Wine\DllOverrides] "winemenubuilder.exe"=""'> ~/.wine/disable-winemenubuilder.reg
regedit ~/.wine/disable-winemenubuilder.reg 

It seems to have worked. Opening a program in wine no longer recreates any of the files in ~/.local/share/mime/application.

No comments:

Post a Comment