TransWikia.com

I installed WINE on my device, can I make a WINE.desktop file to open *.exe s via GUI?

Ask Ubuntu Asked by Tem326 on February 4, 2021

I want to be able to open *.exe files via the built-in nautilus file explorer by simply double-clicking on *.exe . This would make using WINE much easier and convenient, as well as more natural. I already have some code written:

desktop configuration file
[Desktop Entry]
Type=Application
Exec=wine %u

I still cannot find it in the "Show Applications" menu or the one to select a program to open the file with.

2 Answers

Installing wine should either give you the right file association in order to launch them with wine on double-click, or at least a way of associating *.exe with wine.

On my 19.04, Mono runtime stole the file association, but I have 2 ways of launching *.exe files with Nautilus.

First way:

  1. Right click on the .exe
  2. In the menu, click Open with another application
  3. In the application list, look for something like "Wine Core ..."

Now you should be able to launch *.exe file by double-clicking on them in nautilus

Second Way

This way fits more with Wine's way of working. All Windows programs installed in your wine prefix should create desktop a entry in ~/.local/share/applications/wine/.

Desktop entries here are better because they contains the right command line, including env var WINEPREFIX and the full application path in Windows path format. Moreover, these desktop entries will be found by the universal search like any native Ubuntu app.

For example, after Diablo II installation, in ~/.local/share/applications/wine/Programs/Diablo II I got a Diablo II.desktop with this content :

[Desktop Entry]
Name=Diablo II
Exec=env WINEPREFIX="/home/user/.wine" wine "C:\Program Files\Diablo II\Diablo II.exe"
Type=Application
StartupWMClass=Wine
Path=/home/user/.wine/dosdevices/c:/Program Files/Diablo II
Icon=1086_diablo ii.0

When I hit the "Windows" super key of my keyboard and I start to type "Di", Diablo II app icons show up and I can start it.

This is just an example, you can create your own entries for specific wine prefixes, or for non-installed (just copied) application.

Answered by JRo on February 4, 2021

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

or
Code:

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

Then wine windows program loader will show up in the nautilus' "open with" list. 

Answered by Geezergeek on February 4, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP