Wine generated .desktop files don't work, but .lnk files do.

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Post Reply
User avatar
ineuw
Level 2
Level 2
Posts: 17
Joined: Mon Aug 12, 2013 11:08 am
Location: Canada

Wine generated .desktop files don't work, but .lnk files do.

Post by ineuw » Tue Jun 14, 2022 7:57 am

After a fresh LMC 20.3 install this week, my several attempts at using Wine installed Windo apps because the .desktop files generated by wine on installing Windows software don't work. However the .lnk files placed in the Windows Programs work perfectly well.

I use five simple apps: Textpad 8, Irfanview 4.60, Notepad++, Speq Maths Calculator, and SumatraPDF. Compare the drives listed in attached screenshot and the links in the .desktop file. There is no drive E: and drive W: everyone has full permissions with read and write access.
This is the Wine generated .desktop file for Irfanview.

Code: Select all

[Desktop Entry]
Name=IrfanView 64 4.60
Exec=env WINEPREFIX="/home/ineuw/.wine/dosdevices/e:/home/ineuw/.wine" wine "C:\\\\users\\\\ineuw\\\\AppData\\\\Roaming\\\\Microsoft\\\\Windows\\\\Start\\ Menu\\\\Programs\\\\IrfanView\\\\IrfanView\\ 64\\ 4.60.lnk"
Type=Application
StartupNotify=true
Icon=ADEF_i_view64.0
StartupWMClass=i_view64.exe
Comment=
Terminal=false
Attachments
220614_08-30_winedcfg_with_terminal_messages.jpg

User avatar
ineuw
Level 2
Level 2
Posts: 17
Joined: Mon Aug 12, 2013 11:08 am
Location: Canada

Re: Wine generated .desktop files don't work, but .lnk files do corrected

Post by ineuw » Wed Jun 15, 2022 5:02 pm

After a fresh LMC 20.3 install this week, my several attempts at using Wine installed Windows apps failed, because the .desktop files generated by wine don't work. However the wine generated .lnk files placed in the Windows Programs work perfectly well.

I use five simple apps: Textpad 8, Irfanview 4.60, Notepad++, Speq Maths Calculator, and SumatraPDF. Compare the drives listed in attached screenshot and the links in the .desktop file. There is no drive E: and drive W: everyone has full permissions with read and write access.

This is the Wine generated .desktop file for Irfanview.

Code: Select all

[Desktop Entry]
Name=IrfanView 64 4.60
Exec=env WINEPREFIX="/home/ineuw/.wine/dosdevices/e:/home/ineuw/.wine" wine "C:\\\\users\\\\ineuw\\\\AppData\\\\Roaming\\\\Microsoft\\\\Windows\\\\Start\\ Menu\\\\Programs\\\\IrfanView\\\\IrfanView\\ 64\\ 4.60.lnk"
Type=Application
StartupNotify=true
Icon=ADEF_i_view64.0
StartupWMClass=i_view64.exe
Comment=
Terminal=false
[/quote]

jkfloris
Level 12
Level 12
Posts: 2074
Joined: Thu Aug 14, 2014 10:10 am

Re: Wine generated .desktop files don't work, but .lnk files do.

Post by jkfloris » Fri Jun 17, 2022 7:52 am

Indeed, the desktop file does not look good.
The variable WINEPREFIX indicates a prefix that is in a wineprefix.

How did you install Irfanview?
Does the following desktop file work?

Code: Select all

[Desktop Entry]
Name=IrfanView 64 4.60
Exec=env WINEPREFIX="/home/ineuw/.wine/" wine start /unix "/home/ineuw/.wine/drive_c/Program Files/IrfanView/i_view64.exe"
Type=Application
StartupNotify=true
Icon=ADEF_i_view64.0
StartupWMClass=i_view64.exe
Comment=
Terminal=false

User avatar
ineuw
Level 2
Level 2
Posts: 17
Joined: Mon Aug 12, 2013 11:08 am
Location: Canada

Re: Wine generated .desktop files don't work, but .lnk files do.

Post by ineuw » Sun Jun 19, 2022 2:20 am

jkfloris wrote:
Fri Jun 17, 2022 7:52 am

Code: Select all

[Desktop Entry]
Name=IrfanView 64 4.60
Exec=env WINEPREFIX="/home/ineuw/.wine/" wine start /unix "/home/ineuw/.wine/drive_c/Program Files/IrfanView/i_view64.exe"
Type=Application
StartupNotify=true
Icon=ADEF_i_view64.0
StartupWMClass=i_view64.exe
Comment=
Terminal=false
@jkfloris, much thanks!!! This works like a charm.

User avatar
ineuw
Level 2
Level 2
Posts: 17
Joined: Mon Aug 12, 2013 11:08 am
Location: Canada

Re: Wine generated .desktop files don't work, but .lnk files do.

Post by ineuw » Wed Jun 22, 2022 9:26 pm

I used this bash script to install wine.

Code: Select all

#!/usr/bin/bash
# 2022-06-02 00:15 - *13_install_wine.sh 

sudo dpkg --add-architecture i386
sudo apt update
wget -nc https://dl.winehq.org/wine-builds/winehq.key
sudo apt-key add winehq.key
sudo add-apt-repository "deb https://dl.winehq.org/wine-builds/ubuntu/ focal main"
sudo apt update && sudo apt upgrade
sudo apt install --install-recommends winehq-stable -y

Post Reply