Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I want to install Wine only for running a program, but I don't want to open any other Windows file (for security). Is it possible to ensure Wine does not execute .exe files automatically? Thank you.

share|improve this question
    
Why do you focus on Windows executables? Any executable file or executable shell script can be run with /path/to/executable or ./executable. Linux executables aren't magically more secure than Windows executables, especially when the latter run on Wine! –  David Foerster Sep 24 '13 at 23:13

4 Answers 4

up vote 3 down vote accepted
+50

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.

share|improve this answer
    
I wouldn't believe it unless I'd seen it, but if I open a console and cross compile "a.exe" then run it, like $ ./a.exe voila, wine appears and runs it for me. It is bizarre... –  rogerdpack Sep 24 '13 at 0:11
1  
That occurs because wine is set (by binformat support) to run exes when you attempt to execute them. I don't know if that can be disabled without removing wine though. BTW, your question is vague if that is what you mean. –  RolandiXor Sep 24 '13 at 3:15
    
Ok looks like the binfmt-support in question can be disabled via sudo update-binfmts --disable wine (you can see its list via update-binfmts --display) thanks for the tip. Finally it doesn't auto run my console exe's, which can be problematic when cross compiling. –  rogerdpack Sep 27 '13 at 18:46
    
Thank you all! Sorry for my bad English. –  Roque Apr 1 at 19:28

As far as I know, wine does NOT execute .exe files by default, based on my experience so far with Wine on Ubuntu 13.04.

I'm not sure if previous Ubuntu/Wine versions allowed it automatically run executables, but at least you can be fairly certain that that is not currently the case.

share|improve this answer
    
With 12.10 it certainly does...is there any way to disable it though? –  rogerdpack Sep 23 '13 at 22:48
    
With 13.04 it also (for me anyway) wine runs an exe files if you double click them in unity file explorer, and also if you run them in the command line like "./a.exe" it automatically invokes wine to run it for you. –  rogerdpack Sep 27 '13 at 18:42
  1. Wine doesn't associate with .exe files by default on most systems, and depending on your installation, it 'may'.

    The EASIEST way for you to do this would be to install the program Ubuntu Tweak, this can be downloaded from here: Ubuntu Tweak Download Instructions

    Once you have it downloaded you simply open it up, change to Admins tab and then under System choose File Type Manager. Once in here select the file category Text and using shift-click and/or control-click select all of the file types you want, then click Edit on the bottom right.

    This will allow you to multi-set the mimetype opener for all of the files.

    See screen:

    http://i.stack.imgur.com/BZtGN.jpg

  2. I believe that this is what you need in addition to the above point: How to prevent Wine from adding file associations?

Ref: how can I change file association globally?

share|improve this answer
    
Nice! I think this does work for the file explorer so that double clicking an .exe file doesn't automatically run it, which is nice, thanks! –  rogerdpack Sep 27 '13 at 18:47
    
@rogerdpack If it works for you, please accept the answer by clicking the green 'tick' icon so that those who visit the Q in future know what to try first. Thanks. :-) –  TomKat Sep 28 '13 at 4:48
    
Unfortunately I am not the original asker of the question... –  rogerdpack Sep 30 '13 at 15:26

Wine doesn't run .exe files by default unless you add such an association rule. If you did, remove it from Nautilus properties.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.