Browser and exe

classic Classic list List threaded Threaded
24 messages Options
12
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Browser and exe

Marcos Douglas B. Santos
Hi,

If you have some apps or components which was written in Object Pascal and you would like to use them in Web applications (client-side, previously installed) what is the best option to choose nowadays?

My users use Windows so, I thought in ActiveX. It works, but I think Chrome do not use anymore, right?

Is there a way to call an Exe (previously installed, no problem with that) to interact with an Exe, working in IE and Chrome?

Best regards,
Marcos Douglas



_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Browser and exe

leledumbo
Administrator
> Is there a way to call an Exe (previously installed, no problem with that) to interact with an Exe, working in IE and Chrome?

Not from client side AFAIK. You'll need to create a local server side app, let that one executes the exe and response back to the client (if needed).
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Browser and exe

Felipe Monteiro de Carvalho
That's why Model-View-Controller is such a great design pattern. If
you use MVC you can simply create a new View component and keep the
Model and Controller without changes.

You can use fcl-web to write the web server:
http://wiki.lazarus.freepascal.org/fcl-web

You will need to rewrite the GUI in html/javascript which is served to
the web browser.

In the past there was stuff like ActiveX and a Java similar, but
nowadays they are pretty much all deprecated sometimes even
unsupported at all, people should use html+javascript for web
interfaces.

--
Felipe Monteiro de Carvalho
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Browser and exe

Marcos Douglas B. Santos
In reply to this post by leledumbo
On Tue, May 23, 2017 at 6:23 AM, leledumbo via fpc-pascal
<[hidden email]> wrote:
>> Is there a way to call an Exe (previously installed, no problem with that)
> to interact with an Exe, working in IE and Chrome?
>
> Not from client side AFAIK. You'll need to create a local server side app,
> let that one executes the exe and response back to the client (if needed).

I need to call an EXE in client site. For example: digital signature.
The client would use his token to sign a document (locally) and then
send to the Web app.

Best regards,
Marcos Douglas
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Browser and exe

Marcos Douglas B. Santos
In reply to this post by Felipe Monteiro de Carvalho
On Tue, May 23, 2017 at 8:04 AM, Felipe Monteiro de Carvalho
<[hidden email]> wrote:
> That's why Model-View-Controller is such a great design pattern. If
> you use MVC you can simply create a new View component and keep the
> Model and Controller without changes.
>
> You can use fcl-web to write the web server:
> http://wiki.lazarus.freepascal.org/fcl-web

I've been written Web applications using fcl-web for a while... this
isn't my problem.

> You will need to rewrite the GUI in html/javascript which is served to
> the web browser.

I can't. For security reasons I need to have an app installed on client.
Did you see my email before, about digital signature? That is one of
these features...

> In the past there was stuff like ActiveX and a Java similar, but
> nowadays they are pretty much all deprecated sometimes even
> unsupported at all, people should use html+javascript for web
> interfaces.

ActiveX works but as you said, all these are deprecated...

I will take a look on NativeMessaging:
https://developer.chrome.com/extensions/nativeMessaging

Another option, that I thought, is make an app that is a local web
server after the user has installed.
The web real app could make requests to http//localhost and have a
communication between them.

Best regards,
Marcos Douglas
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Browser and exe

Felipe Monteiro de Carvalho
On Tue, May 23, 2017 at 2:39 PM, Marcos Douglas B. Santos
<[hidden email]> wrote:
> I can't. For security reasons I need to have an app installed on client.
> Did you see my email before, about digital signature? That is one of
> these features...

In this case I have no idea how it is done. But it can be done, I know
that Banco Itau does this, but I don't know what exactly they use.

--
Felipe Monteiro de Carvalho
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Browser and exe

Marcos Douglas B. Santos
On Tue, May 23, 2017 at 10:34 AM, Felipe Monteiro de Carvalho
<[hidden email]> wrote:
> On Tue, May 23, 2017 at 2:39 PM, Marcos Douglas B. Santos
> <[hidden email]> wrote:
>> I can't. For security reasons I need to have an app installed on client.
>> Did you see my email before, about digital signature? That is one of
>> these features...
>
> In this case I have no idea how it is done. But it can be done, I know
> that Banco Itau does this, but I don't know what exactly they use.

This idea. I think Banco do Brasil does this too.
Maybe if I develop an Extension for the browser (I need Chrome and IE)
would be simpler but I don't know how to do this yet.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Browser and exe

noreply
In reply to this post by Marcos Douglas B. Santos
On 2017-05-22 21:53, Marcos Douglas B. Santos wrote:

> Hi,
>
> If you have some apps or components which was written in Object Pascal
> and you would like to use them in Web applications (client-side,
> previously installed) what is the best option to choose nowadays?
>
> My users use Windows so, I thought in ActiveX. It works, but I think
> Chrome do not use anymore, right?
>
> Is there a way to call an Exe (previously installed, no problem with
> that) to interact with an Exe, working in IE and Chrome?
>

Exe is a security hazard that could barf up a person's hard drive
instantly or create viruses..

ActiveX is indeed the closest thing to it, as it is like a program that
is run from the browser, but in some kind of sandbox that does not allow
it to do too much damage, although someone probably found a security
issue with it and wrote a virus maybe years ago..
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Browser and exe

Marcos Douglas B. Santos
On Tue, May 23, 2017 at 9:29 PM,  <[hidden email]> wrote:
> Exe is a security hazard that could barf up a person's hard drive instantly
> or create viruses..

I understand these security reasons and I agree, of course...
But this Exe that I am talking about should be installed for all
machines that want use the system so, won't be a problem for security.

> ActiveX is indeed the closest thing to it, as it is like a program that is
> run from the browser, but in some kind of sandbox that does not allow it to
> do too much damage, although someone probably found a security issue with it
> and wrote a virus maybe years ago..

Unfortunatelly I think either Chrome doesn't use it or there are some
restrictions... and they can cut off — if still working — in the
future, I don't know.
I would like to use something simpler, that doesn't depends of
Microsoft's stuff.

I'm still thinking on these options:

1. NativeMessaging:
https://developer.chrome.com/extensions/nativeMessaging

2. to make an app that will be a local web server, after the user has installed.
The web real app could make requests to http//localhost and have a
communication between them.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Browser and exe

noreply
On 2017-05-23 20:52, Marcos Douglas B. Santos wrote:
> On Tue, May 23, 2017 at 9:29 PM,  <[hidden email]> wrote:
>> Exe is a security hazard that could barf up a person's hard drive
>> instantly
>> or create viruses..
>
> I understand these security reasons and I agree, of course...
> But this Exe that I am talking about should be installed for all
> machines that want use the system so, won't be a problem for security.
>

Well there is always XUL Runner (Firefox embedded) or Chromium Embedded,
to run a local browser on the computer machine that is just like
chrome/firefox, but can communicate with real exe code.


> I'm still thinking on these options:
>
> 1. NativeMessaging:
> https://developer.chrome.com/extensions/nativeMessaging
>
> 2. to make an app that will be a local web server, after the user has
> installed.
> The web real app could make requests to http//localhost and have a
> communication between them.

Or a local chromium embedded/firefox embedded web browser that can talk
to any native code you want, then the person does not need a web server
running but will have to install the chromium embedded CEF dll's
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Browser and exe

Michael Van Canneyt
In reply to this post by Marcos Douglas B. Santos


On Tue, 23 May 2017, Marcos Douglas B. Santos wrote:

> 2. to make an app that will be a local web server, after the user has installed.
> The web real app could make requests to http//localhost and have a
> communication between them.

I think this is your best option.

Michael.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Browser and exe

Marcos Douglas B. Santos
In reply to this post by noreply
On Tue, May 23, 2017 at 11:02 PM,  <[hidden email]> wrote:

> On 2017-05-23 20:52, Marcos Douglas B. Santos wrote:
>> ...
>> I'm still thinking on these options:
>>
>> 1. NativeMessaging:
>> https://developer.chrome.com/extensions/nativeMessaging
>>
>> 2. to make an app that will be a local web server, after the user has
>> installed.
>> The web real app could make requests to http//localhost and have a
>> communication between them.
>
>
> Or a local chromium embedded/firefox embedded web browser that can talk to
> any native code you want, then the person does not need a web server running
> but will have to install the chromium embedded CEF dll's

Well, I didn't know about chromium embedded so, I have searched:
"The Chromium Embedded Framework (CEF) is a simple framework for
embedding Chromium-based browsers in other applications."

This is not I want, unfortunatelly.
I will explain:
You are thinking that my Desktop app (components) is the main app and
the Web app is only one more piece. No. The Web app is the main
application and it's not mine. My job is to make some especific
components that will be used for this Web app. But the problem is that
I need to be local access so, I need to install my app — and that
isn't a problem for the custumers — to provide these features for the
Web app.

Best regards,
Marcos Douglas
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Browser and exe

Marcos Douglas B. Santos
In reply to this post by Michael Van Canneyt
On Wed, May 24, 2017 at 6:01 AM, Michael Van Canneyt
<[hidden email]> wrote:
> On Tue, 23 May 2017, Marcos Douglas B. Santos wrote:
>
>> 2. to make an app that will be a local web server, after the user has
>> installed.
>> The web real app could make requests to http//localhost and have a
>> communication between them.
>
>
> I think this is your best option.

I think so.
Thanks for your advice.

Best regards,
Marcos Douglas
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Browser and exe

Graeme Geldenhuys-6
In reply to this post by Michael Van Canneyt
On 2017-05-24 10:01, Michael Van Canneyt wrote:
>> 2. to make an app that will be a local web server, after the user has installed.
>> The web real app could make requests to http//localhost and have a
>> communication between them.
> I think this is your best option.


I've done this before in a project for one of my previous employers. Out
desktop application did user logins, reporting and for some
functionality offloaded it to the web browser (which was launched
automatically for them). This worked under Linux, Windows and FreeBSD,
and worked very well. We could also switch between Synapse or Indy for
the embedded HTTP server component. At the time FPC didn't have its own
HTTP Sever component.

Regards,
   Graeme

--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Browser and exe

Marcos Douglas B. Santos
On Wed, May 24, 2017 at 10:40 AM, Graeme Geldenhuys
<[hidden email]> wrote:
> I've done this before in a project for one of my previous employers. Out
> desktop application did user logins, reporting and for some functionality
> offloaded it to the web browser (which was launched automatically for them).
> This worked under Linux, Windows and FreeBSD, and worked very well. We could
> also switch between Synapse or Indy for the embedded HTTP server component.
> At the time FPC didn't have its own HTTP Sever component.

We are in the same page. I would ask about the embedded HTTP server...
What do you propose to use to make an embedded HTTP server nowadays?

I am using FPC 3.0.2 and Lazarus trunk. Thanks.

Best regards,
Marcos Douglas
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Browser and exe

Graeme Geldenhuys-6
On 2017-05-24 14:52, Marcos Douglas B. Santos wrote:
> What do you propose to use to make an embedded HTTP server nowadays?

I really like Indy components. They are complete and well tested for
over a decade. There support is fantastic too, and you have tons of
resources available on the internet. So this is my first choice.

Synpase is okay, but they leave a lot of implementation up to you. In
comparison, Indy supplies every TCP protocol under the sun with client
and server components.

I've never had the chance to use the FPC included HTTP server component,
but if Michael van Canneyt wrote it, it should be good and well tested.

Regards,
   Graeme

--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Browser and exe

Marcos Douglas B. Santos
On Wed, May 24, 2017 at 11:07 AM, Graeme Geldenhuys
<[hidden email]> wrote:

> n 2017-05-24 14:52, Marcos Douglas B. Santos wrote:
>>
>> What do you propose to use to make an embedded HTTP server nowadays?
>
>
> I really like Indy components. They are complete and well tested for over a
> decade. There support is fantastic too, and you have tons of resources
> available on the internet. So this is my first choice.
>
> Synpase is okay, but they leave a lot of implementation up to you. In
> comparison, Indy supplies every TCP protocol under the sun with client and
> server components.
>
> I've never had the chance to use the FPC included HTTP server component, but
> if Michael van Canneyt wrote it, it should be good and well tested.

I've searched the code and don't know whether that I found is the
official or the more updated repository.
So, I found this http://www.indyproject.org/Sockets/Download/svn.EN.aspx
If I understood right, the good version to use with FPC is 10.  Am I correct?

About your known in this area, because you've already done the same as
I wish to develop, do you have others tips?

For example:
1. Did you have problems with Windows firewall?
2. How did you garantee that others applications aren't being using
the same port as your application to avoind conflicts?
3. How was the best way to start the application as a server and
keeping it alive?

Thanks.

Best regards,
Marcos Douglas
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Browser and exe

Graeme Geldenhuys-6
On 2017-05-24 18:36, Marcos Douglas B. Santos wrote:
> I've searched the code and don't know whether that I found is the
> official or the more updated repository.
> So, I found this http://www.indyproject.org/Sockets/Download/svn.EN.aspx
> If I understood right, the good version to use with FPC is 10.  Am I correct?

Yes, use the latest code from SVN trunk v10. There is no more difference
between Delphi and FPC versions for Indy - they are now common code.

SubVersion repo:
    https://svn.atozed.com:444/svn/Indy10/trunk


> 1. Did you have problems with Windows firewall?

No problems, and neither on Linux or FreeBSD. Simply make sure you use a
port number greater than 1024 (otherwise *nix systems will require root
access).

> 2. How did you garantee that others applications aren't being using
> the same port as your application to avoind conflicts?

I looked at the official IANA list of registered port numbers and chose
a port number that hasn't been taken yet.

    http://www.iana.org/assignments/port-numbers

Under FreeBSD you can review the /etc/services file. I believe Linux has
something similar. Or simply use the URL above.


> 3. How was the best way to start the application as a server and
> keeping it alive?

In our case, the user double clicked our application icon on the
desktop. This started a desktop GUI application, which at the same time
started the embedded HTTP server (which was built into that desktop
application). They then searched and scheduled their assigned tasks for
the day/lesson. They then clicked "view module", which then launched the
installed web browser with the correct URL as parameter - thus
connecting to the embedded HTTP server. In the mean time the desktop
application stayed open - otherwise the embedded HTTP server will
obvious shut down. We also had a user configurable option that when they
clicked "view module", it could also minimise the desktop application
before launching the web browser.

We thought of implementing a Windows Service & *nix Daemon, but that
would require more effort to install etc. The desktop application was
the simplest solution and worked perfectly.

Regards,
   Graeme

--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Browser and exe

Marcos Douglas B. Santos
On Wed, May 24, 2017 at 4:23 PM, Graeme Geldenhuys
<[hidden email]> wrote:

>> 2. How did you garantee that others applications aren't being using
>> the same port as your application to avoind conflicts?
>
>
> I looked at the official IANA list of registered port numbers and chose a
> port number that hasn't been taken yet.
>
>    http://www.iana.org/assignments/port-numbers
>
> Under FreeBSD you can review the /etc/services file. I believe Linux has
> something similar. Or simply use the URL above.

Thanks for that link, I didn't know.
But I meant, how do you know if another app is already using a port
that you want to use?

>> 3. How was the best way to start the application as a server and
>> keeping it alive?
>
>
> In our case, the user double clicked our application icon on the desktop.
> This started a desktop GUI application, which at the same time started the
> embedded HTTP server (which was built into that desktop application). They
> then searched and scheduled their assigned tasks for the day/lesson. They
> then clicked "view module", which then launched the installed web browser
> with the correct URL as parameter - thus connecting to the embedded HTTP
> server. In the mean time the desktop application stayed open - otherwise the
> embedded HTTP server will obvious shut down. We also had a user configurable
> option that when they clicked "view module", it could also minimise the
> desktop application before launching the web browser.

Maybe you or me has understood wrong...
I understood that your desktop application open an URL in the browser
— I didn't understand either it is an embedded one inside in the GUI
or using the default browser — which was given by desktop app as a
parameter, when they click in "view module".
But as I understood, your main application is the desktop, which uses
a browser to show the content.

In my case, the website is the main app which ones was installed in a
webserver on the web, not locally. So, my idea is to use the local
webserver only in a few cases. The main website will request for the
URL http://localhost/myapp , get and process which was returned and
still continue in the main website — all this using asyncronous
JavaScript.

What do you think about it?

> We thought of implementing a Windows Service & *nix Daemon, but that would
> require more effort to install etc. The desktop application was the simplest
> solution and worked perfectly.

Yeah, simple is better.

Best regards,
Marcos Douglas
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Browser and exe

Free Pascal - General mailing list
2017-05-25 15:14 GMT+02:00 Marcos Douglas B. Santos <[hidden email]>:

> On Wed, May 24, 2017 at 4:23 PM, Graeme Geldenhuys
> <[hidden email]> wrote:
>>> 2. How did you garantee that others applications aren't being using
>>> the same port as your application to avoind conflicts?
>>
>>
>> I looked at the official IANA list of registered port numbers and chose a
>> port number that hasn't been taken yet.
>>
>>    http://www.iana.org/assignments/port-numbers
>>
>> Under FreeBSD you can review the /etc/services file. I believe Linux has
>> something similar. Or simply use the URL above.
>
> Thanks for that link, I didn't know.
> But I meant, how do you know if another app is already using a port
> that you want to use?

You'll get an error by the OS if someone is already listening on the
port that you want to listen on yourself.

Regards,
Sven
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
12
Loading...