Wine automatically adds certain mimetypes and file associations (e.g. notepad.exe for .ini files). There already is an answer that explains how to remove these associations.
But how can one prevent Wine from adding them again and again?
Wine automatically adds certain mimetypes and file associations (e.g. notepad.exe for .ini files). There already is an answer that explains how to remove these associations.
But how can one prevent Wine from adding them again and again?
Disabling winemenubuilder.exe altogether will prevent wine from hijacking your file associations, but it will also prevent it from creating menu entries for newly installed software, which may be an undesired behavior. The better solution is this:
Remove existing wine hijacks (from wine FAQ):
rm -f ~/.local/share/mime/packages/x-wine*
rm -f ~/.local/share/applications/wine-extension*
rm -f ~/.local/share/icons/hicolor/*/*/application-x-wine-extension*
rm -f ~/.local/share/mime/application/x-wine-extension*
Edit /usr/share/wine/wine.inf
(as root), find the [Services]
section:
[Services]
HKLM,%CurrentVersion%RunServices,"winemenubuilder",2,"%11%winemenubuilder.exe -a -r"
...
and edit it so it says:
[Services]
HKLM,%CurrentVersion%RunServices,"winemenubuilder",2,"%11%winemenubuilder.exe -r"
...
(namely, to start winemenubuilder.exe
without the -a
switch).
This will prevent updating file associations on new user accounts (or with new WINEPREFIX
es).
Edit your $WINEPREFIX/system.reg
file (if it exists) in similar fashion. Where it says
[SoftwareMicrosoftWindowsCurrentVersionRunServices]
"winemenubuilder"="C:windowssystem32winemenubuilder.exe -a -r"
remove the -a
switch. (By default, WINEPREFIX=$HOME/.wine
.)
This will prevent wine from stealing your preferred mimeapps, but the winemenubuilder will still run and create convenient desktop entries for your Windoze software.