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
Locked
User avatar
ineuw
Level 2
Level 2
Posts: 28
Joined: Mon Aug 12, 2013 11:08 am

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

Post by ineuw »

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: 28
Joined: Mon Aug 12, 2013 11:08 am

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

Post by ineuw »

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: 3136
Joined: Thu Aug 14, 2014 10:10 am

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

Post by jkfloris »

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: 28
Joined: Mon Aug 12, 2013 11:08 am

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

Post by ineuw »

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: 28
Joined: Mon Aug 12, 2013 11:08 am

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

Post by ineuw »

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
Locked