How to ensure Wine does not auto run .exe files?
When you install the wine
package, it registers itself so that .exe files, if run from the command line, will "auto run via wine" if they match a specific signature and have executable bit set (like via chmod +x
).
To prevent accidental direct execution of exe
s from console like
/path/to/program.exe
you can setup binfmt_misc
kernel module with the following command:
sudo update-binfmts --disable wine
This will disable support for direct execution of files with magic MZ
.
CAVEAT: this appears to be undone on restart or Wine upgrade.
If you really want to get rid of it (until wine upgrade!), run
sudo update-binfmts --package wine --remove wine /usr/bin/wine
Wine does not run files automatically (poor wording choice on your part).
However, if you want exe files to open with something else by default, you need to change the associated program for exe files to something other than Wine (you can do this from the properties window in Nautilus).
To run your program, you can create a .desktop file or simply use "Open With" from the context menu.