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

Merged to the master branch
User avatar
Josef Templ
Posts: 2047
Joined: Tue Sep 17, 2013 6:50 am

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

Post 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
Ivan Denisov
Posts: 1700
Joined: Tue Sep 17, 2013 12:21 am
Location: Russia

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

Post 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?
Ivan Denisov
Posts: 1700
Joined: Tue Sep 17, 2013 12:21 am
Location: Russia

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

Post 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.
User avatar
Josef Templ
Posts: 2047
Joined: Tue Sep 17, 2013 6:50 am

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

Post 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
Ivan Denisov
Posts: 1700
Joined: Tue Sep 17, 2013 12:21 am
Location: Russia

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

Post 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
Ivan Denisov
Posts: 1700
Joined: Tue Sep 17, 2013 12:21 am
Location: Russia

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

Post 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.
User avatar
Josef Templ
Posts: 2047
Joined: Tue Sep 17, 2013 6:50 am

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

Post 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
Zinn
Posts: 476
Joined: Tue Mar 25, 2014 5:56 pm
Location: Frankfurt am Main
Contact:

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

Post 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
Ivan Denisov
Posts: 1700
Joined: Tue Sep 17, 2013 12:21 am
Location: Russia

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

Post 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.
Post Reply