Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 8 of 8 total
Thread ShellExecute
Mon, Sep 16 2013 3:54 AMPermanent Link

E.B

Hello,


ShellExecute in Delphi, exec in PHP, does EWB and JS offer the same thing ?

Regards,

Falcon.
Mon, Sep 16 2013 5:08 AMPermanent Link

Matthew Jones

>  ShellExecute in Delphi, exec in PHP, does EWB and JS offer the
> same thing ?

I'd be very surprised if it did. This is all "in browser" and designed to be secure.
You can store some data, but you don't have access to a file system. Running code
on the client end isn't going to happen. Of course what you do on the server side
(which is yours) is up to you, but EWB isn't running there.

Short answer: No.

If you really must run code locally, have the user click on a link to download
something to run.

/Matthew Jones/
Mon, Sep 16 2013 8:35 AMPermanent Link

E.B

(Matthew Jones) wrote:

>  ShellExecute in Delphi, exec in PHP, does EWB and JS offer the
> same thing ?

I'd be very surprised if it did. This is all "in browser" and designed to be secure.
You can store some data, but you don't have access to a file system. Running code
on the client end isn't going to happen. Of course what you do on the server side
(which is yours) is up to you, but EWB isn't running there.

Short answer: No.

If you really must run code locally, have the user click on a link to download
something to run.


Matthew, I was aware of Web/local exec philosophy. But I asked that question because, strangely, PHP (with Exec function) and JAVA (If I'm not wrong,and  I don't remember how) allow executing a local .exe file.

So why JS wouldn't have allow the same thing ? It doesn't --> ok.

Clicking on a link, downloading/executing the exe is heavy but possible way.

But I would like users to launch directly my .exe by clicking on a web link.  Does EWB can be used to execute a PHP file stored on the server ?

Regards.

Falcon.





/Matthew Jones/
Mon, Sep 16 2013 8:51 AMPermanent Link

Raul

Team Elevate Team Elevate

On 9/16/2013 8:35 AM, E.B wrote:
>   was aware of Web/local exec philosophy. But I asked that question because, strangely, PHP (with Exec function) and JAVA (If I'm not wrong,and  I don't remember how) allow executing a local .exe file.

It's more than philosophy - it's a enforced sandboxing. Allowing to run
any code on client side outside of browser would be a massive security
vulnerability.

Neither of PHP/Java are client-side execution like JS/EWB. In case of
PHP the execution is on server hosting PHP, not on client side.

You can still do the exact same thing - have EWB call your web service
which runs in the back end server (and can be written in PHP/Java or any
other language) that will then execute the app.

> Does EWB can be used to execute a PHP file stored on the server ?

Yes of course - just make a http request to the appropriate URL. This is
normal browser/php behavior and same as you visiting the same link with
the browser after all.

Raul
Mon, Sep 16 2013 1:38 PMPermanent Link

E.B

Raul wrote:

On 9/16/2013 8:35 AM, E.B wrote:
>   was aware of Web/local exec philosophy. But I asked that question because, strangely, PHP (with Exec function) and JAVA (If I'm not wrong,and  I don't remember how) allow executing a local .exe file.

It's more than philosophy - it's a enforced sandboxing. Allowing to run
any code on client side outside of browser would be a massive security
vulnerability.

Neither of PHP/Java are client-side execution like JS/EWB. In case of
PHP the execution is on server hosting PHP, not on client side.

You can still do the exact same thing - have EWB call your web service
which runs in the back end server (and can be written in PHP/Java or any
other language) that will then execute the app.

> Does EWB can be used to execute a PHP file stored on the server ?

Yes of course - just make a http request to the appropriate URL. This is
normal browser/php behavior and same as you visiting the same link with
the browser after all.


Raul, Java is a client-side bytecode execution machine (JVM), but you are right
PHP is a server side one. Executing an app with Java is possible, I tested it, with success:
http://forum.hardware.fr/hfr/Programmation/Java/lancer-application-java-sujet_75795_1.htm

JS is client side and executing an exe is possible too :
http://www.developpez.net/forums/d47134/webmasters-developpement-web/javascript/en-javascript-peux-t-on-lancer-programme-en-local/  it works too.

This is why I asked my question (running an exe with JS).


Falcon.
Mon, Sep 16 2013 3:05 PMPermanent Link

Raul

Team Elevate Team Elevate

On 9/16/2013 1:38 PM, E.B wrote:
> Raul, Java is a client-side bytecode execution machine (JVM), but you are right
OK - since we referred to PHP I assumed server side (i.e. JSP).

> Executing an app with Java is possible, I tested it, with success:
> http://forum.hardware.fr/hfr/Programmation/Java/lancer-application-java-sujet_75795_1.htm
Understood - if you have an option to to have the JRE installed and user
accept the prompts then this would work.

> JS is client side and executing an exe is possible too :
> http://www.developpez.net/forums/d47134/webmasters-developpement-web/javascript/en-javascript-peux-t-on-lancer-programme-en-local/  it works too.
Fair enough - i personally don't consider this useable (requires IE and
active x script permissions).

Either option should be useable with TPage control in EWB.

Raul

Mon, Sep 16 2013 4:02 PMPermanent Link

Fernando Dias

Team Elevate Team Elevate

Raul,

<< Fair enough - i personally don't consider this useable (requires IE and active x script permissions).>>

Or desirable - but it's only my personal opinion.

--
Fernando Dias
[Team Elevate]
Tue, Sep 17 2013 1:56 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com


<< JS is client side and executing an exe is possible too :
http://www.developpez.net/forums/d47134/webmasters-developpement-web/javascript/en-javascript-peux-t-on-lancer-programme-en-local/
it works too. >>

Yes, but it is IE-only and requires changing the security settings in the
browser in order to allow it to execute without error.

You can do the same thing with EWB like this:

interface

type

  external TShellApplication = class
     public
        function ShellExecute(const File: String): Integer;
        function ShellExecute(const File: String; const Arguments: String;
                              const Directory: String; const Operation:
String;
                              const Show: Integer): Integer;
     end;

...... form stuff

implementation

uses WebDOM;

procedure TMyForm.MyButtonClick(Sender: TObject);
begin
  if IsIE then
     TShellApplication(CreateActiveXObject('Shell.Application')).ShellExecute('c:/monprog.exe')
  else
     ShowMessage('Cannot execute - not running on IE');
end;

Tim Young
Elevate Software
www.elevatesoft.com
Image