How to create desktop shortcut/link to application installed in wine?

I would like to install an application in custom wineprefix and winearch
let say that I’ll install a software like this:
WINEARCH=win64 WINEPREFIX=~/wineapps/test wine installer.exe

Application executable is going to be in:
~/wineapps/test/Program\ Files/test/start.exe

How should I create a shortcut on Manjaro desktop?
I’ve found:
https://wiki.archlinux.org/index.php/Desktop_entries

But I’m not sure how to use the information.

I need to create .destkop file in the:
/usr/share/applications/ or /usr/local/share/applications/
Does it matter where I create this file?

And in this file there should be:
[Desktop Entry]

# The type as listed above
Type=Application

# The name of the application
Name=test

# The path to the folder in which the executable is run
Path=~/wineapps/test/Program\ Files/test/

# The executable of the application, possibly with arguments.
Exec=WINEPREFIX=... WINEARCH=... wine '~/wineapps/test/Program\ Files/test/start.exe'

# The name of the icon that will be used to display this entry
Icon=...

# Describes whether this application needs to be run in a terminal or not
Terminal=false

# Describes the categories in which this entry should be shown
Categories=Graphic;

I believe that Type=Application is ok. Patch to icon is self-explanatory.
I have no idea if the Path and Exec are even close to ok.

And what to do next? When I’ll have .desktop file what I should do next?

  1. /usr/share/applications/

  2. Split this in 2:

    Exec=WINEPREFIX=... WINEARCH=... wine '~/wineapps/test/Program\ Files/test/start.exe'
    
    • Set the environment variables in /etc/environment where they belong and then they’re set for all applications
    • set Exec=wine '~/wineapps/test/Program\ Files/test/start.exe'
  3. Path is optional and only needed if you have an application like NOTEPAD.EXE and is the directory you want to see when you do File Open.
    Whether the Exec is correct or not: I cannot tell you: that depends on the actual application :man_shrugging:

  4. Go to your menu and click the icon that just appeared! (or create a link to it on your desktop, or whatever you want to do next…)

:innocent:

4 Likes

I don’t understand this
Should I edit /etc/environment and add lines:

WINEPREFIX=...
WINEARCH=...

and in .desktop file line with Exec should look like this:
set Exec=wine '~/wineapps/test/Program\ Files/test/start.exe'
?
I don’t want to change wine environment settings permanently. I want to have separate WINEPREFIX for every application.

Hello :wave:

Normally wine will create a desktop file in ~/.local/share/applications/wine/ when running an installer that creates a windows shortcut.

Desktop Entry look like this then, if you need to make use of the *.ink files

[Desktop Entry]
Name=Name of the Application
Exec=env WINEPREFIX="/path/to/wineprefix" wine /path/to/custom/wine /Unix /path/to/the/wineprefix/dosdevices/c:/ProgramData/Microsoft/Windows/Start\\ Menu/Programs/My\\ Awesome\\ Application.lnk
Type=Application
StartupNotify=true
Path=/path/to/wineprefix/workingdir/
Icon=image.icon
StartupWMClass=application.exe
2 Likes

Then you should do as @megavolt eloquently wrote…

:innocent: