Page 2 of 10

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

Posted: Tue Feb 23, 2016 10:17 pm
by Josef Templ
Sorry, bhe current implementation is too primitive in several aspects and too complicated in others.
It is based on speculations about possible use cases instead of experience,

- Josef

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

Posted: Wed Feb 24, 2016 12:30 am
by Ivan Denisov
Josef Templ wrote:Sorry, bhe current implementation is too primitive in several aspects and too complicated in others.
It is based on speculations about possible use cases instead of experience.
Why do you think so?

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

Posted: Wed Feb 24, 2016 2:49 pm
by Ivan Denisov
I made simple demo to demonstrate the security issue.

1. Please, prepare the folder with clean BlackBox.
2. Open this file with BlackBox:
demo.rtf
(3.37 KiB) Downloaded 259 times
3. Click the link from imported file
4. Check is there a Docu folder still exists

It is working only under Wine. I noticed, that it does not work in Windows.

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

Posted: Sat Feb 27, 2016 9:22 am
by Josef Templ
Ivan Denisov wrote:
Josef Templ wrote:Sorry, bhe current implementation is too primitive in several aspects and too complicated in others.
It is based on speculations about possible use cases instead of experience.
Why do you think so?
I don't see the need to have actions involved.

I don't see a parameter that allows one to specify the current directory.

I am sorry, but I don't have much time now to go into more details.

I hope that in the next days I will be able to dig into this issue more deeply.

- Josef

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

Posted: Sun Feb 28, 2016 3:23 pm
by Ivan Denisov
I put request to the Russian board. Maybe they will help to find better solution. Alexander already gave an idea.
http://forum.oberoncore.ru/viewtopic.php?f=47&t=5629

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

Posted: Tue Mar 01, 2016 5:58 pm
by Ivan Denisov
I had found that changing of compilation list was my fault. After small cleaning the suggested changes are:
http://redmine.blackboxframework.org/pr ... 115335d51f

Now I am working on making BlackBox run Start and Open in new threads. This will not require actions and solve more problems.

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

Posted: Tue Mar 01, 2016 6:33 pm
by Ivan Denisov

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

Posted: Wed Mar 02, 2016 7:24 am
by Josef Templ
I didn't have time to look into this in full detail but it seems that it is getting even more complicated now.
The called process is executed in parallel anyway, only the startup would be in an additional thread,
as far as I understand it.
Now, if you press a link and the startup is slow for some reason, nothing happens and you don't know
what is going on. At some time later a window may pop up, or not.
For me a normal synchronous behavior would be much more usefull and it is much simpler.
It would also allow to report errors back to the caller, I think.

- Josef

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

Posted: Wed Mar 02, 2016 5:08 pm
by Zinn
Josef, I use currently another solution:

Code: Select all

	PROCEDURE (h: ExtCallHook) Open* (fileName: ARRAY OF CHAR);
		VAR res: INTEGER; win_fileName: ARRAY[untagged] 2048 OF CHAR;
	BEGIN
		IF Dialog.IsWine() THEN
			win_fileName := "winebrowser " + fileName$
		ELSE
			win_fileName := fileName$
		END;
		res := WinApi.ShellExecuteW(0, NIL, win_fileName, NIL, NIL, WinApi.SW_SHOWNORMAL);
	END Open;

	PROCEDURE (h: ExtCallHook) Start* (exeName: ARRAY OF CHAR);
		VAR res: INTEGER; info: WinApi.STARTUPINFOW; process: WinApi.PROCESS_INFORMATION;
	BEGIN
		WinApi.GetStartupInfoW(info);
		info.wShowWindow := WinApi.SW_NORMAL;
		res := WinApi.CreateProcessW(NIL, exeName, NIL, NIL, WinApi.FALSE, {}, 0, NIL, info, process)
	END Start;
Procedure Open uses the Wine test and the code from HostTextConv.ShellExecute
Procedure Start uses the code from HostDialog.Start

We can use this version also without Hook by deleting (h: ExtCallHook) and moving it from Host/Mod/Dialog to System/Mod/Dialog.
- Helmut

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

Posted: Thu Mar 03, 2016 1:20 am
by Ivan Denisov
Some applications like Total Commander can run very slow because they starting some disks in suspend mode. This will stop any execution. And if this application is like server, there will be the same problems like in the issue-#105. So in the case of mouse tracking you understand that hanging of blackbox is bad. However here, Josef, you saying that "this is not a bug, it is a feature".

Introducing this feature #104 into basic BlackBox I am trying to solve the problem of multiple versions of InfoCmds for running links. This delayed start was introduced by OberonCore team, so they think that this is essential. If we will not introduce this feature, we will not solve the problem of uniting all version of InfoCmds in basic BlackBox.
We can use this version also without Hook by deleting (h: ExtCallHook) and moving it from Host/Mod/Dialog to System/Mod/Dialog.
Helmut, WinApi should not appear in System subsystem because it is platform independent.