Windows executables are started with archive manager

I have Wine installed and several Windows applications installed there run fine, if I start them using the right mouse menu "Open with Wine program loader". But if I try starting an .exe file by just double clicking instead, the archive manager tries to open the executable.

How do I fix that?

And something like a bonus question as a former Windows user: Can this be done easily for a single file I currently see in the file manager (similar to the "Open with..." context menu in Windows) and for many file types together (like in Windows, using the menu "Folder settings" in the Explorer)?


Solution 1:

Right-click, select Properties, open the "Open With" tab, and make Wine the default application for EXE files.

Solution 2:

From 17.04, the wine packages have become wine-stable and wine-development. These are coinstallable, so the wine.desktop file is not installed in /usr/share/applications by either of these packages to avoid conflicts. Hence, Wine does not have an entry in the Open With menu. From /usr/share/doc/wine-stable/README.Debian.gz:

To enable system-wide support for .exe files execute the following command (replace /usr/share/doc/wine with /usr/share/doc/wine-development if you use wine-development):

$ sudo cp /usr/share/doc/wine/examples/wine.desktop /usr/share/applications/

To support this only for your current user execute:

$ cp /usr/share/doc/wine/examples/wine.desktop ~/.local/share/applications/

To remove these native file type associations again execute the following commands:

$ sudo rm -f /usr/share/applications/wine.desktop
$ sudo update-desktop-database
$ rm -f ~/.local/share/applications/wine.desktop
$ rm -f ~/.local/share/applications/wine-extension-*
$ update-desktop-database ~/.local/share/applications/

This is slightly mistaken, it's /usr/share/doc/wine-stable, not /usr/share/doc/wine.

sudo cp /usr/share/doc/wine-stable/examples/wine.desktop /usr/share/applications/

And Wine should start showing up in the Open With lists for selection.

Solution 3:

The reason why this occurs is in this bug report, which I provided a patch for about 2 years ago: https://bugs.launchpad.net/ubuntu/+source/file-roller/+bug/351429

Regardless, the workaround I generally use is to just right click the application and select open with Wine.