10

How do I create a shortcut to start a Windows application with Wine?

For example I have Notepad++:

/media/DATA/Progs/Notepad++/notepad++.exe

and I would like to have a shortcut to it on the desktop.

andrew.46
  • 38,003
  • 27
  • 156
  • 232
UAdapter
  • 17,587
  • Here is my explanation how to work a desktop shortcut: https://askubuntu.com/questions/1437380/ubuntu-22-04-how-to-run-an-exe-file-by-the-desktop-shortcut/1437386#1437386 – luisito_36 Oct 27 '22 at 03:26

4 Answers4

11

WLCreator is a Python program (script) that creates Linux desktop launchers for Windows programs (using Wine).

Usage

WLCreator will try to extract icons from exe file, and to search for all ico files in exe's directory and its subdirectories, and to convert them to png files. Additionally, it will search for png files in application's main directory. After that, the user is presented with a graphical interface where he/she can choose the icon and launcher's name.

The program can also be integrated in Nautilus (as nautilus-script). This makes easy creation of launchers even easier!

You’ll need to ensure you have python-qt4, icoutils, and imagemagick installed to get full use of the application.

Download .deb package from here and once you have deb package you need to double click on it to install.

enter image description here

enter image description here

enter image description here

Source and further information

Tfb9
  • 681
  • 4
  • 13
  • 33
Maythux
  • 84,289
5
  • Right click on your Desktop and then select Create Launcher. alt text

  • Then enter the name and in command box enter the path of your wine application. alt text

  • Now you can simply click the launcher in your Desktop to open your wine application.
  • Also have a look at this link.
karthick87
  • 81,947
  • 4
    Right-clicking my ubuntu desktop does not present a create launcher menu, only create new folder, create new document. – Mittenchops Oct 17 '13 at 13:42
  • this does not work with 13.10 at least - there is no such right-click option. – comrademike Mar 05 '14 at 12:09
  • 1
    For new versions of Ubuntu which no longer have the Create Launcher option, instructions on how to create a launcher can be found here : http://askubuntu.com/a/139530/14601 – gene_wood Mar 04 '15 at 21:05
2

"Create Launcher" isn't an option in the context menu anymore.

Here's what i do. It's not the easiest but once it's in place you can just duplicate/edit the existing files.

  1. Open a terminal session

  2. Create a storage folder for the launcher script

    mkdir $HOME/.bin
    
  3. Create the launcher script

    nano $HOME/.bin/appname.sh
    

    Insert the following code without the quotes

    #!/bin/bash
    
    cd "$HOME/.wineprefix/drive_c/Program\ Files/programfolder/"
    
    WINEPREFIX="$HOME/.wineprefix" wine exefilename.exe
    

    Press Ctrl+X
    Press Y to save changed
    Press Enter to confirm file name

  4. Make the script executable

    sudo chmod +x ~/.bin/appname.sh
    
  5. Create the desktop link

    nano /Desktop/appname.desktop
    

    Insert the following code. Don't use ~/<path> to indicate home directory, it does not work in .desktop files. I made a subdirectory in .bin for icons. If you don't have an icon you can leave the line blank.

    [Desktop Entry]
    
    Name=<Appname>
    
    Comment=Wine Program
    
    Exec=$HOME/.bin/appname.sh
    
    Icon=$HOME/.bin/ico/icofilename.ico
    
    Terminal=false
    
    Type=Application
    
    Categories=Game;
    
    GenericName=appname
    

    Press Ctrl+X
    Press Y
    Press Enter

Now your done.

To create additional launchers just copy the existing file and edit it in terminal

cp $HOME/.bin/appname.sh $HOME/.bin/newappname.sh

nano $HOME/.bin/newappname.sh

Edit and Close

cp $HOME/Desktop/appname.desktop $HOME/Desktop/newappname.desktop

nano $HOME/Desktop/newappname.desktop

Edit and Close

Danatela
  • 13,243
  • 11
  • 45
  • 72
ODTech
  • 21
  • 2
1

I want a shortcut for Fox, so here's what I did:

$ touch "$HOME/Desktop/fox.desktop"
$ sudo touch "/opt/fox.sh"

$ chmod +x "$HOME/Desktop/fox.desktop"
$ sudo chmod +x "/opt/fox.sh"

$ editor "$HOME/Desktop/fox.desktop"  # Add the data
$ editor "/opt/fox.sh"  # Add the data

$ cat "/opt/fox.sh"
#!/bin/bash

WINEPREFIX="$HOME/.wineprefix" wine "$HOME/.wine/drive_c/Program Files (x86)/firstobject/foxe.exe"

$ cat "$HOME/Desktop/fox.desktop"
[Desktop Entry]
GenericName=Fox
Exec=/opt/fox.sh
Icon=/home/<username>/.wine/drive_c/Program Files (x86)/firstobject/foxe.exe_14_128_1033_1_32x32x4.png
MapNotify=true
Type=Application
Name=Fox

EDIT: If you want to grab the icon from the exe; follow this guide or use the "gExtractWinIcons" GUI (available with apt-get install).

A T
  • 2,528