Trouble with shortcuts in Wine

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
sullik

Trouble with shortcuts in Wine

Post by sullik »

Hi,
I use Mint14 Mate and have some funny experiences in Wine 1.4 - shortcuts in the Menu (not all) or on the desktop will not open a program properly. There is a window saying "Cannot find file" (in Norwegian) and part of the program opens with a error message. If I browse the C drive and open the .exe file directly everything is fine.
Anyone got an idea?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
karlchen
Level 23
Level 23
Posts: 18173
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: Trouble with shortcuts in Wine

Post by karlchen »

Hello, sullik.

Check the commandlines behind the icons (behind the launchers). Copy and paste them (the commandlines) into a terminal window and find out whether they generate any errors and whether they launch the Windows programmes correctly.

If you are using Cinnamon desktop, you may get and use "alacarte" in order to find out which commandline each icon launches.
If you are using Xfce, you should use "lxmed" instead of "alacarte" for the same purpose.
If you are using KDE, hm, no idea. Have never been a KDE user for long enough to bother and find out.
In all cases you may find the launchers in the folders /usr/share/applications and in particular the Wine launchers in ~/.local/share/applications. You can always use gedit or any other text editor to view the content of the .desktop files.

Kind regards,
Karl
Image
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 762 days now.
Lifeline
sullik

Re: Trouble with shortcuts in Wine

Post by sullik »

Hello Karl,
I use Mate desktop at the moment and have tried what you describe. If I make a shortcut in the program folder and use it everything works fine. When moved to the desktop - trouble! Have also copied the script to the shortcut in the Menu folder, same result, that is just what make me so pissed!!
User avatar
karlchen
Level 23
Level 23
Posts: 18173
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: Trouble with shortcuts in Wine

Post by karlchen »

Hello, sullik.

Could you, please, post one of the .desktop files
+ which works fine when it is in the program folder
+ which fails when put on the desktop or added to the Mint menu

.desktop files are pure text files. So you can copy their content and paste it here between 2 code tags ([ code ] [ /code ]).

Hm, I hope you are not trying to add a Windows .lnk file to the desktop or the menu.

P.S.:
Thought I might give an example of what I am talking:
  • Linux Mint13, same on Mint 14, only I am logged in to Mint 13, so I'll be using this exampe now.
  • Wine 1.4 installed
  • Through Wine installed Total Commander 8.01
    Program folder in Windows notation: C:\Totalcmd
    Program folder in Mint notation, because C: is just a symlink: ~/.wine/drive_c/totalcmd
  • Windows .lnk file launching Total Commander: C:\users\Public\Start Menu\Programs\Total Commander\Total Commander.lnk
    Same .lnk file in Mint notation: ~/.wine/drive_c/users/Public/Start\ Menu/Programs/Total\ Commander/Total\ Commander.lnk
  • Note:
    I just verified it.
    Contrary to what I had stated before, the installation of Wine has made sure that double clicking a Windows .lnk file in Nautilus will launch Wine and pass the .lnkfile to Wine. Wine will know what to do with the .lnkfile and launch Total Commander correctly.
    Contrary to what I had stated before, copying this .lnkfile to my Mint desktop with the help of Nautilus and double-clicking the copied .lnkfile on my desktop will launch Total Commander.
  • Although Wine can launch a Windows programe with the help of its Windows .lnkfile Wine will put Mint .desktop files in the Mint Menu which conform to the Linux Mint rules.
  • In the given example the .desktop file which Wine has created for Total Commander is this file: ~/.local/share/applications/wine/Programs/Total\ Commander/Total\ Commander.desktop
  • This is the content of the Total\ Commander.desktop file:

    Code: Select all

    [Desktop Entry]
    Name=Total Commander
    Exec=env WINEPREFIX="/home/karl/.wine" wine C:\\\\windows\\\\command\\\\start.exe /Unix /home/karl/.wine/dosdevices/c:/users/Public/Start\\ Menu/Programs/Total\\ Commander/Total\\ Commander.lnk
    Type=Application
    StartupNotify=true
    Comment=c:\totalcmd\totalcmd.exe
    Icon=7832_totalcmd.0
    
  • As the line starting with the string Exec= reveals Wine reads the Windows .lnk file of Total Commander and executes the commandline in the .lnk file, much in the same way as Windows would.
As has been cleared up by investigating the example of Total Commander on my Mint13 / Mint 14 - Wine 1.4 environment,
+ the installation of Wine makes sure that Nautilus will pass Windows .lnk files to Wine, Wine will execute them
+ therefore double clicking .lnk files in the "Windows" start menu folder works, but also double clicking them on the Mint desktop works
+ Wine creates a Linux .desktop file which it puts in the Mint Menu


As a Wine .desktop file may in fact launch a commandline stored in a Windows .lnk file, the reason why a Windows program fails to start up may be in side the .desktop file or inside the Windows .lnk file. After all both files may hold (in)correct pathnames.

Therefore I still wonder whether your problem that you reported is about the Windows .lnk file or about the Wine .desktop file for the same program. And still an example would be highly appreciated.

Karl
Last edited by karlchen on Sun Mar 17, 2013 5:09 pm, edited 1 time in total.
Image
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 762 days now.
Lifeline
sullik

Re: Trouble with shortcuts in Wine

Post by sullik »

Hi Karl,
Here are Screendumps of the same shortcut for a Windows program running in Wine. The Desktop one loads fine the Menu one misses files and cannot be used.
Johannes
User avatar
karlchen
Level 23
Level 23
Posts: 18173
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: Trouble with shortcuts in Wine

Post by karlchen »

Hello, Johannes.

The desktop launcher works fine, you say. The launcher file holds a link target (lenkemal) which points to a "PSU Desginer II.desktop" file.
As explained in my previous post, only using Total Commander as an example, the .desktop file is a pure text file which is understood by Mint. It holds the complete commandline which Mint should launch.
As can be seen in my example, too, for Wine this may include a pretty long and complex looking prefix.
The desktop launcher works fine very likely because the given link target holds all needed details for Mint so that it launches Wine and Wine launches ""PSU Desginer II".

The menu launcher does not seem to have such a link target (lenkemal). I assume that this is the reason why it fails.
Possibly prefixing the right Wine specific details to the commandline might make the menu launcher work as well.
Currently the commandline reads

Code: Select all

"/home/inge/.wine/drive_c/Program Files (x86)/Duncan Amplification/Power Designer 2/psud2.exe"
Adapting the Wine prefix from my example you might prefix this to the given commandline

Code: Select all

env WINEPREFIX="/home/inge/.wine" wine 
The complete commandline would read (all on one line, no linebreaks)

Code: Select all

env WINEPREFIX="/home/inge/.wine" wine "/home/inge/.wine/drive_c/Program Files (x86)/Duncan Amplification/Power Designer 2/psud2.exe"
Potentially there is a much easier solution:

Copy the "PSU Desginer II.desktop" to /home/inge/.local/share/applications.

Code: Select all

cp "/home/inge/.local/share/applications/wine/Programs/Duncans Amp Tools/PSU Desginer II.desktop" /home/inge/.local/share/applications"
I am not sure where in the menu structure the entry will appear. You may have to look around a bit.

Kind regards,
Karl
Image
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 762 days now.
Lifeline
sullik

Re: Trouble with shortcuts in Wine

Post by sullik »

Hello Karl,
Not able to find a solution here. Did install Total Commander (new to me - looks interesting), this is what happened;
desktop lnk file and shortcut opens (both created by TC), Menu shortcut cannot find file.
Johannes
Total Commander Menu.png[attachment=0]Total Commander Desktop.png[attachment=0]Total Commander desktop.lnk.png
sullik

Re: Trouble with shortcuts in Wine

Post by sullik »

Hello Karl,
The Menu file was too long to fit the screen Snapshot, here is all;
env WINEPREFIX="/home/inge/.wine" wine C:\\windows\\command\\start.exe /Unix /home/inge/.wine/dosdevices/c:/users/inge/Start\ Menu/Programs/Total\ Commander/Total\ Commander\ 64\ bit.lnk
User avatar
karlchen
Level 23
Level 23
Posts: 18173
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: Trouble with shortcuts in Wine

Post by karlchen »

Hello, sullik.
sullik wrote:The Menu file was too long to fit the screen Snapshot, here is all;
env WINEPREFIX="/home/inge/.wine" wine C:\\windows\\command\\start.exe /Unix /home/inge/.wine/dosdevices/c:/users/inge/Start\ Menu/Programs/Total\ Commander/Total\ Commander\ 64\ bit.lnk
Hm, this looks much like the sample commandline which I had taken from my computer and posted to illustrate what a complete Wine commandline that works from the menu might look like.

Unless you have taken the pain of getting and installing Total Commander on your machine, then this commandline cannot do anything useful on your machine.
So what is the posted commandline supposed to tell?
Does it work or does it not?
(Telling from my Mint 13 64-bit system running Wine 1.4 and Total Commander 8.01 32-bit/64-bit, it should. But does it in your case?)

Karl
Image
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 762 days now.
Lifeline
sullik

Re: Trouble with shortcuts in Wine

Post by sullik »

Hello Karl,
I get "Cannot find file" and that is it. Desktop icons work fine.

Johannes
sullik

Re: Trouble with shortcuts in Wine

Post by sullik »

Hello Karl,
Message "Cannot open file" is not correct, it is "Cannot find file"

Best regards,
Johannes
User avatar
karlchen
Level 23
Level 23
Posts: 18173
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: Trouble with shortcuts in Wine

Post by karlchen »

Good evening, Johannes.

"cannof find file" is a pretty useless error message indeed. In fact it is kind of mean. The programme which displays it should clearly state which file it cannot find and give its own name as well. Both details should be known to the programme which displays the message.
By simply stating "Cannot find file", it just gives us a double riddle: which programme cannot find which file?
Coming back to the commandline

Code: Select all

env WINEPREFIX="/home/inge/.wine" wine C:\\windows\\command\\start.exe /Unix /home/inge/.wine/dosdevices/c:/users/inge/Start\ Menu/Programs/Total\ Commander/Total\ Commander\ 64\ bit.lnk
there are quite a few filenames in this commandline. Any of these filenames could be the one not finding another file. Any of these filenames could be the one that cannot be found:
  • env: a programme file.

    Code: Select all

    which env
    should return the reply

    Code: Select all

    /usr/bin/env
    Does it do so?
  • wine: a programme file.

    Code: Select all

    which wine
    should return the reply

    Code: Select all

    /usr/bin/wine
    Does it do so?
  • C:\\windows\\command\\start.exe is Wine programme file. Does it exist?
  • /home/inge/.wine/dosdevices/c:/users/inge/Start\ Menu/Programs/Total\ Commander/Total\ Commander\ 64\ bit.lnk is the Windows link file which in turn holds the Windows commandline to launch Total Commander 64-bit, TOTALCMD64.exe. Does the link file exist?
  • If so far all questions yield the answers, yes, the files can be found, then there is a chance that the commandline inside the link file "Total Commander 64 bit.lnk" is incorrect.
So there are a lot of files and places to check.
There is the chance that for some reason something quite different cannot be found which we have not even identified, yet.
There is also the chance that the root cause is pretty trivial, but I do not run Mate and cannot try myself, and I do not really see what you see and I do not see what you do exactly. It might even be a bug in Mate. I simply do not know.

In short words I do not think I can give you a step by step instruction on how to analyze and solve this mystery.

Kind regards,
Karl
Image
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 762 days now.
Lifeline
sullik

Re: Trouble with shortcuts in Wine

Post by sullik »

Hello Karl,
Thank you for assisting me here. I went through all you listed and the answer is YES, all were there. I then opened Properties for the Menu shortcut, selected Browse and went to TOTALCMD.EXE - that shortcut works. "/home/inge/.wine/dosdevices/c:/totalcmd/TOTALCMD64.EXE". Doing the same for psud2 do not solve that problem, so I am still puzzeled but will try more options when time allows.
Thank you Karl!!

Best regards,
Johannes
Locked

Return to “Software & Applications”