Can't get links to open in Mint!

Questions about Wine on Linux
Locked
Kagashe
Newbie
Newbie
Posts: 4
Joined: Mon Sep 19, 2016 2:47 pm

Can't get links to open in Mint!

Post by Kagashe »

So this has been going on for about three weeks now, I have read the forums on useful regedit values and a couple of other forums that give steps to solving my issue. Basically I use a windows email app and I would like the links to open in my Linux browser and for email options like mailto to use the Windows based email app.
Thanks in advance to anyone that's able to help me sort through this!
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: Can't get links to open in Mint!

Post by Bob Wya »

Kagashe wrote:So this has been going on for about three weeks now, I have read the forums on useful regedit values and a couple of other forums that give steps to solving my issue. Basically I use a windows email app and I would like the links to open in my Linux browser and for email options like mailto to use the Windows based email app.
Thanks in advance to anyone that's able to help me sort through this!
Okay.
To run native applications from within a Wine environment...
Use this registry setting:

Code: Select all

REGEDIT4

[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment]
"PATHEXT"=".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;."
So you literally add a dot character at the end of the supported executable types (why? because that effectively is interpreted as no extension by the Windows shell).

That Wine Registry addition will disappear if you execute:

Code: Select all

wineboot -u
to update the Wineprefix. You've been warned!!

Verify that works:

Code: Select all

wine cmd /c /usr/bin/glxgears
That should run OK now!

Then see 6.6.3 How do I associate a native program with a file type in Wine?

For example to force wine to open all html files and links in your native Linux browser (only in the current Wineprefix):

Code: Select all

REGEDIT4

[HKEY_CLASSES_ROOT\htmlfile\Shell\Open\command]
@="winebrowser \"%1\"" 
[HKEY_CLASSES_ROOT\InternetShortcut\Shell\Open\command]
@="winebrowser \"%1\"" 
Because winebrowser is a shortcut for running the native Linux xdg-open command.
The %1 is just the shortcut for the 1st parameter - that Windows uses in the registry.

Yeah, the Wine FAQ - was not not written by me... It's really unclear - like the repository/ PPA instructions... But hey-ho I don't have admin / access rights to it - to fix the fuzziness :roll:

Bob
Kagashe
Newbie
Newbie
Posts: 4
Joined: Mon Sep 19, 2016 2:47 pm

Re: Can't get links to open in Mint!

Post by Kagashe »

Ok, please bare with me on this!
I added the additional file types to the first command for .xls and .doc and all that fun stuff, that went OK.
Ran the other command "wine cmd /c /usr/bin/glxgears"
which returned "Can't recognise '/usr/bin/glxgears' as an internal or external command, or batch script."
Then Tried The command to add the registry entries, which it accepted but I can't see the entries it added when I open regedit?
User avatar
dimesio
Moderator
Moderator
Posts: 13201
Joined: Tue Mar 25, 2008 10:30 pm

Re: Can't get links to open in Mint!

Post by dimesio »

Bob Wya wrote: Yeah, the Wine FAQ - was not not written by me... It's really unclear - like the repository/ PPA instructions... But hey-ho I don't have admin / access rights to it - to fix the fuzziness
I do. Is this better? https://wiki.winehq.org/FAQ#How_do_I_la ... ication.3F

FYI, you should be able to post suggestions on the FAQ discussion page without admin rights.

And what's wrong with our repository/PPA instructions?
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: Can't get links to open in Mint!

Post by Bob Wya »

Kagashe wrote:Ok, please bare with me on this!
I added the additional file types to the first command for .xls and .doc and all that fun stuff, that went OK.
Ran the other command "wine cmd /c /usr/bin/glxgears"
which returned "Can't recognise '/usr/bin/glxgears' as an internal or external command, or batch script."
Ha,ha... So - ironically speaking - you've proved my point for me!! Thanks!!

Anyway that's fine - all it means is that the PATHEXT(ension) registry value has not been updated correctly.

Wine has a useful little registry edit command line tool - just like Windows - called reg.

So you can add the extra global executable - single dot (.) - to your PATHEXT(ension) registry value on the Linux command line:

Code: Select all

wine reg ADD 'HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' '/v' 'PATHEXT' /t 'REG_SZ' /d '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.' '/f' 2>/dev/null
and check it's stuck with:

Code: Select all

wine reg QUERY 'HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' '/v' 'PATHEXT' 2>/dev/null
Usage:

Code: Select all

wine reg ADD /? 2>/dev/null 
REG ADD key_name [/v value_name | /ve] [/t type] [/s separator] [/d data] [/f]

wine reg QUERY /? 2>/dev/null
REG QUERY key_name [/v value_name | /ve] [/s]
That's the first thing to get working!
Kagashe wrote:Then Tried The command to add the registry entries, which it accepted but I can't see the entries it added when I open regedit?
Que? What does that mean? :?

Bob

btw see is it bear or bare?
Kagashe
Newbie
Newbie
Posts: 4
Joined: Mon Sep 19, 2016 2:47 pm

Re: Can't get links to open in Mint!

Post by Kagashe »

Right! Sorry been so quiet, hectic few days lately.
I did have a moment of contemplation over the whole bear/bare story, went with my gut which seems to have led me astray...anyway, here is the utput from the command looks like all went well for a change :lol:

Code: Select all

alistair@AL-Mint ~ $ wine reg ADD 'HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' '/v' 'PATHEXT' /t 'REG_SZ' /d '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.' '/f' 2>/dev/null
The operation completed successfully
alistair@AL-Mint ~ $ wine reg QUERY 'HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' '/v' 'PATHEXT' 2>/dev/null

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment
    PATHEXT    REG_SZ    .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: Can't get links to open in Mint!

Post by Bob Wya »

Kagashe wrote:Right! Sorry been so quiet, hectic few days lately.
I did have a moment of contemplation over the whole bear/bare story, went with my gut which seems to have led me astray...anyway, here is the utput from the command looks like all went well for a change :lol:

...
alistair@AL-Mint ~ $ wine reg QUERY 'HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' '/v' 'PATHEXT' 2>/dev/null

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment
PATHEXT REG_SZ .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.
[/code]
Hiya,

That's great to see!
You'll have to excuse me being so pedantic ... :lol:

Bob
Kagashe
Newbie
Newbie
Posts: 4
Joined: Mon Sep 19, 2016 2:47 pm

Re: Can't get links to open in Mint!

Post by Kagashe »

So all the file types seem to be opening correctly now except http, followed the same steps to add the registry entries from the WINE wiki but it still asks me to choose a default program?

Image


Also I need to try make it work the other way round as well, the wine application in question is my email program so how would I make mailto links and the send by email function work?

Once again thanks in advance!
I know dealing with noobs can be frustrating!
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: Can't get links to open in Mint!

Post by Bob Wya »

Kagashe wrote:So all the file types seem to be opening correctly now except http, followed the same steps to add the registry entries from the WINE wiki but it still asks me to choose a default program?
That's the native Linux xdg-open dialog prompt... Can you associate a native program (hint: it's not the firefox.exe option)? If the association is remembered (when you enable the remember my choice checkbox) then fine and dandy...
Otherwise it's off to the Minty forums - your desktop isn't working right... :cry:

I recall already saying previously:
Because winebrowser is a shortcut for running the native Linux xdg-open command.
The %1 is just the shortcut for the 1st parameter - that Windows uses in the registry.
The other way round is a Linux problem - not really a Wine problem!! Associate the Windows email application .desktop file, which winemenubuilder should auto-create, with your native Linux mail-to: handler.
  1. To find the desktop file for your Windows mail-client:

    Code: Select all

    find "${HOME}/.local/share/applications/" -iname "thunderbird*.desktop"
    Replacing thunderbird with the actual name of your mail-client.
  2. Code: Select all

    xdg-settings set default-url-scheme-handler mailto thunderbird.desktop
    Replacing thunderbird.desktop with the actual path of the .desktop file your found for your mail-client in step 1.
Good luck! :wink:
Bob
THN
Level 2
Level 2
Posts: 20
Joined: Tue May 31, 2016 2:24 pm

Re: Can't get links to open in Mint!

Post by THN »

@Bob Wya
Like Kagashe I also get stuck after modifying PATHEXT with the trailing dot.

Running a linux command/program through "wine cmd /c <something>" gives me a
"Can't recognise '<something>' as an internal or external command, or batch script."
while with "wine cmd /c start /unix <something>" I get other errors (wrong EXE format, no app associated).

Have you been verifying that your wine cmd actually works? Anything I'm missing?

I guess that the first variant (without start /unix) attempts to launch a linux pgm from (wine's implementation of) the windows cmd.exe pgm, which in my eyes cannot succeed.

The second variant (with start /unix) instructs cmd.exe to ask the host OS (linux?) to start the given pgm. This strangely works for me for linux shell scripts, but not for any programs (linux executables).

Does it make sense?

THN
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: Can't get links to open in Mint!

Post by Bob Wya »

THN wrote:@Bob Wya
Like Kagashe I also get stuck after modifying PATHEXT with the trailing dot.

Running a linux command/program through "wine cmd /c <something>" gives me a
"Can't recognise '<something>' as an internal or external command, or batch script."
while with "wine cmd /c start /unix <something>" I get other errors (wrong EXE format, no app associated).

Have you been verifying that your wine cmd actually works? Anything I'm missing?

I guess that the first variant (without start /unix) attempts to launch a linux pgm from (wine's implementation of) the windows cmd.exe pgm, which in my eyes cannot succeed.

The second variant (with start /unix) instructs cmd.exe to ask the host OS (linux?) to start the given pgm. This strangely works for me for linux shell scripts, but not for any programs (linux executables).

Does it make sense?

THN
What's the output from:

Code: Select all

'ls' -hl "${WINEPREFIX:-${HOME}/.wine}/dosdevices"
wine reg QUERY 'HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' '/v' 'PATHEXT'
Does the following test work?

Code: Select all

wine cmd.exe /c /usr/bin/glxgears
See the WineHQ: Wine Start manual page...

So basically your argument order is messed up... It would be valid to use:

Code: Select all

wine start cmd.exe /c /usr/bin/glxgears
I've emphasised the fact that cmd.exe is a Windows binary in the above examples (well to be pedantic a Wine wrapper).

Code: Select all

file "${WINEPREFIX:-${HOME}/.wine}/drive_c/windows/system32/cmd.exe"
cmd.exe: PE32 executable (console) Intel 80386, for MS Windows
Bob
THN
Level 2
Level 2
Posts: 20
Joined: Tue May 31, 2016 2:24 pm

Re: Can't get links to open in Mint!

Post by THN »

Bob,

thanks a lot for taking the time to reply. I appreciate.

Indeed it seems there's quite a confusing number of options:

wine <x> would run the (windows) pgm <x> through wine.
wine start <x> would run the app/pgm associated with <x> through wine (see here); in case of <x> being a pgm by its own (like cmd.exe), I guess it would be just the same as w/o "start".

Now cmd.exe itself can start things using its /c or /k command line options (see here).

To add to the confusion, "start" itself is a possible argument to what you can ask cmd.exe to do, as it is a valid DOS/windows command (see here).

Let me check all that out again later today, and report back.

Cheers,

THN
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: Can't get links to open in Mint!

Post by Bob Wya »

THN wrote:...

wine <x> would run the (windows) pgm <x> through wine.
wine start <x> would run the app/pgm associated with <x> through wine (see here); in case of <x> being a pgm by its own (like cmd.exe), I guess it would be just the same as w/o "start".

...
There some subtle differences between:

Code: Select all

wine ...
and

Code: Select all

wine start ...
For example wine start setups up additional environment variables and handles launching applications by file Mime type.

I filed a bug on behalf of a user a while back. The application they were trying to get to run wouldn't start without using: wine start.
Generally it's probably safer to use this form - when starting or installing applications under Wine...

wine start does tend to be more forgiving of starting applications without setting up a valid present working directory / using random Unix paths to start applications with Wine...

Bob
THN
Level 2
Level 2
Posts: 20
Joined: Tue May 31, 2016 2:24 pm

Re: Can't get links to open in Mint!

Post by THN »

OK, so let's go through this.

The wine drive mapping look like this:

Code: Select all

lrwxrwxrwx 1 user user  10 Jun  4 01:07 c: -> ../drive_c
lrwxrwxrwx 1 user user  10 Aug 11 23:40 d: -> /dos/DATA/
lrwxrwxrwx 1 user user  10 Aug 16 23:13 e: -> /dos/MEDIA
lrwxrwxrwx 1 user user   9 Jun  4 01:07 e:: -> /dev/sdd1
lrwxrwxrwx 1 user user   8 Jun  4 01:07 f:: -> /dev/sdd
lrwxrwxrwx 1 user user   8 Jun  4 01:07 g:: -> /dev/sde
lrwxrwxrwx 1 user user   8 Jun  4 01:07 h:: -> /dev/sdg
lrwxrwxrwx 1 user user   8 Jun  4 01:07 i:: -> /dev/sdf
lrwxrwxrwx 1 user user   8 Jun  4 01:07 j:: -> /dev/sdi
lrwxrwxrwx 1 user user   8 Jun  4 01:07 k:: -> /dev/sdh
lrwxrwxrwx 1 user user   9 Jun  4 01:07 l:: -> /dev/sde1
lrwxrwxrwx 1 user user   8 Jul 27 11:20 m: -> /mnt/iso
lrwxrwxrwx 1 user user  10 Jul 27 11:20 m:: -> /dev/loop0
lrwxrwxrwx 1 user user   8 Aug 11 23:40 n:: -> /dev/sr0
lrwxrwxrwx 1 user user  10 Aug 14 23:50 o: -> /dos/MEDIA
lrwxrwxrwx 1 user user   9 Aug 14 17:41 o:: -> /dev/sdi1
lrwxrwxrwx 1 user user   9 Aug 14 17:41 p:: -> /dev/sdh1
lrwxrwxrwx 1 user user   1 Jun  4 01:07 z: -> /
Then

Code: Select all

~$ wine reg QUERY 'HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' '/v' 'PATHEXT'
STUB QUERY - HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment PATHEXT 0 0
Then

Code: Select all

~$ wine cmd.exe /c /bin/nano
'/bin/nano' konnte nicht als interner oder externer Befehl
oder als Batch-Skript erkannt werden.
although

Code: Select all

~$ whereis nano
nano: /bin/nano /usr/share/nano /usr/share/man/man1/nano.1.gz /usr/share/info/nano.info.gz
Now let's go for some other options...

Code: Select all

~$ wine start cmd.exe /k /bin/nano
This opens a dos command box, saying the same text as just before; same with /c instead of /k

Code: Select all

~$ wine cmd.exe /c start /unix /bin/nano
Now a couple of things happen... first I get a console message that "wine: Fehlerhaftes EXE-Format für Z:\bin\nano" (invalid EXE format), followed by a popup saying that no pgm is associated with the file type. When I dismiss the warning, another console message says
"Es konnte keine Anwendung gestartet werden, oder es ist keine Anwendung mit der angegebenen Datei verknüpft.
ShellExecuteEx fehlgeschlagen: Erfolg."

I've tried some more combinations, but basically I always end up with wine (or cmd) not being able to run a linux program (although he can well find it at Z:\bin\nano)

Let me know what else I should try.

Best,

THN
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: Can't get links to open in Mint!

Post by Bob Wya »

THN wrote:...
Then

Code: Select all

~$ wine reg QUERY 'HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' '/v' 'PATHEXT'
STUB QUERY - HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment PATHEXT 0 0
...
That's wrong it should be:

Code: Select all

"PATHEXT"=".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;."
By default it will be:

Code: Select all

"PATHEXT"=".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH"
If it's not there at all - then you've broken your Wineprefix!

But I've posted information already - way back in September 2016 - on this very forum thread... :roll:
So whether you're hitting a locale issue or something else... I don't know.

Try just firing up the Wine Registry Editor and see what's going on in that key (HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment):

Code: Select all

wine regedit.exe
It should be created by default by Wine
But the default entry won't have the final dot .
This is added so that Wine treats any file - without an extension - as an executable file... Since Linux executables don't (typically) have a file extension.

Bob
THN
Level 2
Level 2
Posts: 20
Joined: Tue May 31, 2016 2:24 pm

Re: Can't get links to open in Mint!

Post by THN »

Well, so I have re-created my default WINEPREFIX to check what's wrong with your wine reg QUERY command.
Unfortunately, even under a brandnew WINEPREFIX (~/.wine), it's output remains just the same:

Code: Select all

STUB QUERY - HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment PATHEXT 0 0
However I can well run wine regedit and edit the PATHEXT to what's needed:

Code: Select all

.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.
No issues here.

Still, all above behaviours remain unchanged. :shock:

Anyways, since I can well call Linux scripts from a pgm running under wine, I currently don't need the option to call a Linux pgm.

THN
Locked