issue-#104 calling URLs and commands (InfoCmds capabilities)

Merged to the master branch

Re: issue-#104 calling URLs and commands (InfoCmds capabilit

Postby Robert » Sat Nov 04, 2017 8:38 am

Do we want this hack at all?
It seems unnecessary to put into the standard BlackBox build a work-around for a bug in obsolete versions of Wine.

I call it a bug because it seems to be a case where Wine does not (or rather, did not) copy the Windows behaviour, which is its purpose.

There is not a backward compatibility issue as version 1.7 did not include OpenExternal (if I remember correctly).
User avatar
Robert
 
Posts: 1023
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

Re: issue-#104 calling URLs and commands (InfoCmds capabilit

Postby Josef Templ » Sat Nov 04, 2017 7:05 pm

issue-#104 was in release 1.7.

The problem with wine is that there are many old versions around, for a long time.
Even new Linux distributions often include rather old packages, not just wine.

If it is possible to find out the relevant version jump, it would be easy to
support both old and not-so-old wine versions.

- Josef
User avatar
Josef Templ
 
Posts: 2038
Joined: Tue Sep 17, 2013 6:50 am

Re: issue-#104 calling URLs and commands (InfoCmds capabilit

Postby Josef Templ » Sun Nov 05, 2017 6:23 am

I just tried wine 1.4.1 without the "winebrowser " prefix and it also worked.
This means that 1.4.1 accepts both versions, with and without prefix
and this in turn suggests that removing the "winebrowser " prefix would be
the right approach, as Robert suggested.

It is possible that there is no bug in wine at all but that this is a configuration issue.
ShellExecute opens the document with the "Windows" application that is associated with it.
Depending on the configuration there may not be any such association even if
under Linux there are such associations. winebrowser seems to use the Linux associations, which
may be the default for later wine versions.

- Josef
User avatar
Josef Templ
 
Posts: 2038
Joined: Tue Sep 17, 2013 6:50 am

Re: issue-#104 calling URLs and commands (InfoCmds capabilit

Postby Zinn » Sun Nov 05, 2017 7:08 am

I use Ubuntu 16.04 LTS with Wine 1.6.2 and I need the "winebrowser".

I installed Wine in the terminal via the command
$ sudo apt install wine

I added no repository for Wine.

Which is the actual version of Wine? How to install it?
-Helmut
Zinn
 
Posts: 472
Joined: Tue Mar 25, 2014 5:56 pm
Location: Frankfurt am Main

Re: issue-#104 calling URLs and commands (InfoCmds capabilit

Postby Josef Templ » Sun Nov 05, 2017 8:43 am

Zinn wrote:I use Ubuntu 16.04 LTS with Wine 1.6.2 and I need the "winebrowser".
-Helmut


Helmut, can you please check the return code of ShellExecuteW?
Use HostConsole (because this runs in a separate thread!) for logging in HostDialog.OpenExternal right
after calling WinApi.ShellExecuteW.

If there is a specific error code we could do a retry with the winebrowser prefix.

- Josef
User avatar
Josef Templ
 
Posts: 2038
Joined: Tue Sep 17, 2013 6:50 am

Re: issue-#104 calling URLs and commands (InfoCmds capabilit

Postby Zinn » Sun Nov 05, 2017 10:38 am

OpenExternal with winebrowser:
http://www.zinnamturm.eu works - returncode 33
explorer.exe works - returncode 33 (failed at the time where we introduce OpenExternal returncode was also 33)
Test/Docu/Buch.pdf works - returncode 33
Test/Docu/Buch2.pdf failed- returncode 33 (because file does not exist)

When I use winebrowser WinApi.ShellExecuteW returns always 33 decimal. I can't detect by BlackBox if the call was not successful.

OpenExternal without winebrowser:
http://www.zinnamturm.eu works - returncode 33
explorer.exe works - returncode 33
Test/Docu/Buch.pdf failed - returncode 31 (existing pdf file is not displayed)
Test/Docu/Buch2.pdf failed- returncode 2 (because file does not exist)

- Helmut
Zinn
 
Posts: 472
Joined: Tue Mar 25, 2014 5:56 pm
Location: Frankfurt am Main

Re: issue-#104 calling URLs and commands (InfoCmds capabilit

Postby Zinn » Sun Nov 05, 2017 11:19 am

An solution maybe to call it first without winebrowser and when it fails (return codes < 33 or # 33 or = 31 only) call it ones again with winebrowser.
- Helmut
Zinn
 
Posts: 472
Joined: Tue Mar 25, 2014 5:56 pm
Location: Frankfurt am Main

Re: issue-#104 calling URLs and commands (InfoCmds capabilit

Postby Josef Templ » Mon Nov 06, 2017 9:06 am

Zinn wrote:OpenExternal without winebrowser:
http://www.zinnamturm.eu works - returncode 33
explorer.exe works - returncode 33
Test/Docu/Buch.pdf failed - returncode 31 (existing pdf file is not displayed)
Test/Docu/Buch2.pdf failed- returncode 2 (because file does not exist)

- Helmut


According to msdn ShellExecute always returns > 32 on success.
31 means "no association found".

wine allows you to specify associations (protocol, extension) with wine applications.
If no association is found then 31 is returned.
winebrowser.exe is a wine application that forwards to the host system, the Linux desktop.
By always forwarding to winebrowser the wine associations are skipped and this is actually a mistake
although it may appear convenient in cases where there is no wine association specified.
You can use "wine regedit" for opening the registry editor and setting the required key/value pairs.
There may also be graphical wine tools for simplifying that.
The normal way is to specify winebrowser.exe explicitly in the wine associations, e.g. for http: or .html or .pdf associations.
On my Debian Linux this is pre-configured when installing wine but it may be different for other distributions.

The IMHO correct approach would be to remove the winebrowser prefix and report error conditions instead.
Then the user has a chance to see what the problem is. This works also for associations that are truly unknown.
For example if there is no association specified for .pdf for both wine and the Linux desktop then there would
be an error message indicating that there is no association specified.
A refinement may be to retry with the winebrowser prefix in case of error 31.

The only docu on winebrowser I found is this: https://wiki.winehq.org/Winebrowser.

- Josef
User avatar
Josef Templ
 
Posts: 2038
Joined: Tue Sep 17, 2013 6:50 am

Previous

Return to Resolved (Features)

Who is online

Users browsing this forum: No registered users and 2 guests

cron