How does one create a custom application launcher for Wine installed apps?

54,661

Solution 1

You can create a Launcher item in /usr/share/applications. For Wine applications, say foobar.exe, you can create a foobar.desktop file like:

[Desktop Entry]
Name=FooBar
Comment=Foo & Bar
Exec=sh -c "cd /home/USER/.wine/drive_c/Program\ Files/FOOBAR_FOLDER; wine foobar.exe"
Icon=wine
Terminal=false
Type=Application
Categories=Wine;
StartupNotify=true

replacing USER and FOOBAR_FOLDER with appropriate values.

So you'll be able to locate your application in the Launcher by typing "FooBar".

Solution 2

To get a wine application into the unity bar, the following worked for me:

  • Start alacarte.
  • Go to wine - programs - ... (where your wine program is located).
  • Move the program icon to another folder (outside of wine; e.g., office).
  • Close Alacarte.

Now I could find the program in the unity dash and just move it to the unity bar.

Solution 3

Tested with

Ubuntu 14.10 (Utopic Unicorn)
Wine-1.7.34
Foxit Reader 7

When you install an app through wine, a corresponding .desktop file is created in the /home/ash/.local/share/applications folder.

Important:

  1. Replace ash in the path above with your username.
  2. In Unity Desktop Environment, press Ctrl+h in your home directory to see the hidden file .local

Once you locate that file, go through the following steps:

  1. Right click and check Properties.
  2. Go to the Permissions tab and check Allow executing file as program.
  3. Go to the Basic tab and change the Command field as follows:

    original: C:\Program Files (x86)\Foxit Software\Foxit Reader\FoxitReader.exe

    changed: wine "C:\Program Files (x86)\Foxit Software\Foxit Reader\FoxitReader.exe"

  4. Close the Properties window. An icon of the application should come forth.
Now that we have got all the necessary changes made, we are to do either of the following two options:

  1. Drag the file to the launcher.
  2. Start the program by double-clicking. When started, a launcher icon will show up in the launcher. Right click on that and check Lock to Launcher.

We are done. Cheers ...

Solution 4

Didn't work out of the box for me, but with a small detail I got it working. Simply give the full path for sh like:

Exec=/bin/sh -c "cd /home/USER/.wine/drive_c/Program\ Files/FOOBAR_FOLDER; wine foobar.exe"

Solution 5

The best solution by some distance is to use a script such as wine-launcher-creator which will take care of creating the desktop launcher, and also do nice things like extract the necessary icons and so on. No need to fiddle around doing it by hand :)

Share:
54,661

Related videos on Youtube

Sn3akyP3t3
Author by

Sn3akyP3t3

Updated on September 18, 2022

Comments

  • Sn3akyP3t3
    Sn3akyP3t3 over 1 year

    I'm able to locate stuff with the dash home then drag it down to the launcher bar on the left of the desktop, but what if the application installed via Wine isn't found via the dash search? I've right clicked on the application in the .wine directory and found no options to create a launcher either.

    • Sn3akyP3t3
      Sn3akyP3t3 almost 12 years
      Why strip away Ubuntu version in editing? Does the suggested methods work on all versions of Ubuntu then?
  • max
    max over 11 years
    Entering Main Menu in the Dash showed no results.
  • Tiit Papp
    Tiit Papp about 11 years
    I should have probably mentioned you need the Main Menu app installed if it isn't there by default...some versions of Ubuntu it is and some it isn't. "sudo apt-get install alacarte" or just install "alacarte" from the Ubuntu Software Center and that keyword will work.
  • fotanus
    fotanus over 10 years
    Why not simply sh -c "wine /home/USER/.wine/drive_c/Program\ Files/FOOBAR_FOLDER/foobar.exe" ?
  • twigmac
    twigmac over 10 years
    I had to use /bin/sh -c "cd /home/USER/.wine/drive_c/Program\ Files/FOOBAR_FOLDER; wine foobar.exe" without the Exec= to make it work in Ubuntu 12.04.
  • Eugene van der Merwe
    Eugene van der Merwe over 10 years
    I'm struggling with this method on Ubuntu 13.10. The problem is that when I launch alacarte it appears but I am unable to move (or create) any new items. Also, it doesn't seem to be installed by default, I had to do apt-get install alacarte.
  • simon
    simon about 10 years
    why is this downvoted? anyone care to explain?
  • utapyngo
    utapyngo about 10 years
    How to configure Icon so it is extracted from the exe?
  • Wilf
    Wilf almost 10 years
    You can also create the launchers locally in ~/.local/share/applications
  • gene_wood
    gene_wood about 9 years
    @fotanus With the Windows application I'm creating a launcher for, not first changing directory into the directory where the .exe lives caused an error in the Windows application. When I changed to the cd into the directory method, it worked fine. It may have to do with the Windows application being confused if the working directory is outside of a possible Windows `C:` directory.
  • Matt
    Matt almost 7 years
    great tool. I tried to create a .desktop entry manually, but it didn't work.
  • mloskot
    mloskot over 5 years
    The program can work even without being installed in Wine, e.g. a portable installation at any location or in some cases even a program installed in Windows itself on the separate partition (tested with Civ5 installed in Win10 from Ubuntu 18.04 with Wine 3.0). The Exec line can also take the form Exec=sh -c "wine 'path/to/foobar.exe'".
  • mloskot
    mloskot over 5 years
    Exec=wine "path/to/foobar.exe" worked too.
  • Wildcard
    Wildcard over 5 years
    Handy. Except I'm trying to create launchers in /usr/share/applications so they'll be accessible to all users, and the application doesn't seem to like that. (Won't prompt for sudo access.) Still, the icon extraction is nice.