By default, after install wine or its helper like CrossOver, PlayOnLinux… Wine can really mess up with your system file associations at the moment. Some file extension was associated with Open with winebrowser.exe automatically. I faced with this inconvenience problem when open a pdf file by enter button or double click in file manager. The wine will creating a lot of file dependencies to start a new wine.exe instance, it costs time and garbage files per folder where you store the pdf file.

CrossOver
I used CrossOver as Wine helper to run Windows programes on Linux, here is the method to stop Open with "winebrowser.exe"
action on file manager context menu. That means it will be opening by your choosen viewer.
- Start CrossOver, select default bottle.
- Navigate to
Edit Associations
inControl Panels
menu.
Edit Associations - Uncheck
Show common file types only
to unhide the hidden extensions. - Go to
.pdf
then selectIgnore Extensions
.
Select Ignore extension - Click
OK
then re-start your current file manager.
PlayOnLinux
PlayOnLinux has build-in file associations at Settings > File Associations
. It’s very easy to add/remove/change file types with default applications.
Wine
If you use wine
without any helpers, since wine-3.14, winecfg has a Manage File Associations checkbox on the Desktop Integration tab. Checking it enables winemenbuilder
to create file associations and unchecking it disables that behavior. It doesn’t consider whether user want to add file association linked to specific program. Instead, winemenubuilder.exe
builds links between file types and programs without any user interaction or acceptance by default.
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.
To remove all of the file associations in one fell swoop without winemenubuilder.exe
, here are some bash’s commands to make it done:
$ rm -f ~/.local/share/applications/wine-extension*.desktop
$ rm -f ~/.local/share/icons/hicolor/*/*/application-x-wine-extension*
$ rm -f ~/.local/share/applications/mimeinfo.cache
The first command removes all of the Wine extension .desktop
files that Windows programs have created while the second clears out any icons that Wine might have associated with them.
Don’t forget to remove the old cache with these commands:
$ rm -f ~/.local/share/mime/packages/x-wine*
$ rm -f ~/.local/share/applications/mimeinfo.cache
$ rm -f ~/.local/share/mime/application/x-wine-extension*
or
$ update-desktop-database ~/.local/share/applications
$ update-mime-database ~/.local/share/mime/
Notes: Make sure to never run these commands unnecessarily, though, since they really will reset the MIME types that Nautilus, PCManFM, Thunar and other file managers use to associate different extensions with different programs.
Once Wine has polluted your Linux file open dialogs and you want to get rid of all that stuff, the only certain solution is to remove all wine-extension entries in
.local/share/mime/
.local/share/applications/
.local/share/icons/16x16/apps/
.local/share/icons/32x32/apps/
.local/share/icons/48x48/apps/
Notes: Removing the associations from ~/.local/share/*
will work temporarily, until you install something new and winemenubuilder runs again.