Trouble with shortcuts in Wine

Questions about applications and software
Forum rules
Before you post please read how to get help

Trouble with shortcuts in Wine

Postby sullik on Thu Mar 14, 2013 4:17 pm

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?
sullik
Level 1
Level 1
 
Posts: 43
Joined: Mon May 28, 2012 12:58 pm

Linux Mint is funded by ads and donations.
 

Re: Trouble with shortcuts in Wine

Postby karlchen on Thu Mar 14, 2013 7:20 pm

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
User avatar
karlchen
Level 12
Level 12
 
Posts: 4178
Joined: Sat Dec 31, 2011 7:21 am

Re: Trouble with shortcuts in Wine

Postby sullik on Sat Mar 16, 2013 6:01 pm

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!!
sullik
Level 1
Level 1
 
Posts: 43
Joined: Mon May 28, 2012 12:58 pm

Re: Trouble with shortcuts in Wine

Postby karlchen on Sun Mar 17, 2013 8:35 am

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.
User avatar
karlchen
Level 12
Level 12
 
Posts: 4178
Joined: Sat Dec 31, 2011 7:21 am

Re: Trouble with shortcuts in Wine

Postby sullik on Sun Mar 17, 2013 3:55 pm

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
Attachments
PSUDesignerMenu.png
PSUDesignerDesktop.png
sullik
Level 1
Level 1
 
Posts: 43
Joined: Mon May 28, 2012 12:58 pm

Re: Trouble with shortcuts in Wine

Postby karlchen on Sun Mar 17, 2013 6:06 pm

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
User avatar
karlchen
Level 12
Level 12
 
Posts: 4178
Joined: Sat Dec 31, 2011 7:21 am

Re: Trouble with shortcuts in Wine

Postby sullik on Mon Mar 18, 2013 10:12 am

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 desktop.lnk.png
Desktop lnk
Attachments
Total Commander Desktop.png
Desktop shortcut
Total Commander Menu.png
Menu
sullik
Level 1
Level 1
 
Posts: 43
Joined: Mon May 28, 2012 12:58 pm

Re: Trouble with shortcuts in Wine

Postby sullik on Mon Mar 18, 2013 10:15 am

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
sullik
Level 1
Level 1
 
Posts: 43
Joined: Mon May 28, 2012 12:58 pm

Re: Trouble with shortcuts in Wine

Postby karlchen on Mon Mar 18, 2013 7:27 pm

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
User avatar
karlchen
Level 12
Level 12
 
Posts: 4178
Joined: Sat Dec 31, 2011 7:21 am

Re: Trouble with shortcuts in Wine

Postby sullik on Tue Mar 19, 2013 2:50 am

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

Johannes
sullik
Level 1
Level 1
 
Posts: 43
Joined: Mon May 28, 2012 12:58 pm

Re: Trouble with shortcuts in Wine

Postby sullik on Tue Mar 19, 2013 3:46 am

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

Best regards,
Johannes
sullik
Level 1
Level 1
 
Posts: 43
Joined: Mon May 28, 2012 12:58 pm

Re: Trouble with shortcuts in Wine

Postby karlchen on Tue Mar 19, 2013 4:32 pm

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
User avatar
karlchen
Level 12
Level 12
 
Posts: 4178
Joined: Sat Dec 31, 2011 7:21 am

Re: Trouble with shortcuts in Wine

Postby sullik on Wed Mar 20, 2013 10:02 am

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
sullik
Level 1
Level 1
 
Posts: 43
Joined: Mon May 28, 2012 12:58 pm

Linux Mint is funded by ads and donations.
 

Return to Software & Applications

Who is online

Users browsing this forum: No registered users and 23 guests