1

I have a application in ASP.NET / C# located on a server, my problem is how to run another application (.exe) but in the client that visit the website (the application on server)

question

(client)------------(server)
run browser         website 
   and              (asp.net/c#)
**execute           instruction     
app.exe**           for execute app.exe 

I developed ext.net, a soft using asp.net + c# which is an updated version of an old soft made in powerbuilder (v2 is the new soft, v1 is the powerbuilder one). V2 has not all the functionality included on V1, so after executing V2, I have to execute V1. so if the user is using V2 on the browser, I should be able to open V1 (V2 is located in a server, V1 installed in client. Since client opens browser to connect to V2).

*translated with google

desarrollé un software en ext.net(asp+c#) el cual es una version actualizada de otro software anterior hecho en PowerBuilder (los llamaré v2 y v1 respectivamente). Por razones de tiempo, el software V2 no tiene todas las funcionalidades de V1, por lo cual, al finalizar el procedimiento con V2 se debe abrir V1. Vale decir, estando en el browser usando V2 debiera poder abrir V1 (.exe)

cmujica
  • 1,304
  • 1
  • 18
  • 27
  • 1
    you cannot execute a `.exe` from a browser if is that what do you want to accomplish – Jorge Oct 18 '11 at 22:13
  • in JavaScript i see examples but not works – cmujica Oct 19 '11 at 14:32
  • Can you be more clear about if V2 runs on the server or client??? How V1 runs now??? If this two version needs to be installed, then why do you need them to go to a web site to start them? – gbianchi Oct 19 '11 at 18:14
  • V2 is located in a server, V1 installed in client. Since client opens browser to connect to V2 – cmujica Oct 19 '11 at 18:51

6 Answers6

2

It is, unfortunately, not possible due to security reasons. Had it been possible, hackers could have created havoc on client machines. However, you may be able to, may be, on older IE version using ActiveX. This may require lowering the security setting to bare minimum. Here's the link any way:

http://www.governmentsecurity.org/forum/index.php?showtopic=23488

Kumar Kush
  • 2,495
  • 11
  • 32
  • 42
  • 5
    I would change that wording to be "fortunately that is not possible". – E.J. Brennan Oct 19 '11 at 00:05
  • +1 Depending on what he needs to do, ActiveX may fulfill his needs without "Lowering security to the bare minimum." ActiveX was created to do exactly what he is trying to do, run executable code on the client side of a web session. – Scott Chamberlain Oct 19 '11 at 00:33
  • @Scott Chamberlain I tried running a sample on IE9 on Windows 7 with UAC set to just above minimum security. It did not work. – Kumar Kush Oct 19 '11 at 07:58
  • @kush.impetus I did not mean the above example. I meant turning his application in to a proper ActiveX application. Not just using ActiveX to launch his .exe – Scott Chamberlain Oct 19 '11 at 14:13
  • @Scott Chamberlain : Sorry, but I was not aware of such a thing. BTW, could you please provide a link a link supporting your answer? It might be useful in one of my projects. – Kumar Kush Oct 19 '11 at 14:43
  • @kush.impetus See [my answer](http://stackoverflow.com/questions/7814339/how-execute-a-application-on-client-from-a-website/7823804#7823804) to the OP's question for examples – Scott Chamberlain Oct 19 '11 at 15:29
2

What is the purpose of the application, click once may be a solution .

http://msdn.microsoft.com/en-us/library/t71a733d(v=vs.80).aspx

The fact you cannot execute code directly from a browser is no unfortunate thing, it is a wonderful security feature.

BenMorel
  • 34,448
  • 50
  • 182
  • 322
Sabre
  • 2,350
  • 2
  • 18
  • 25
1

the only thing you can do in this direction is give a link to the application so that the user can decide to click on it, download the file and execute it locally.

Apparently Sys Internals does this, check here: Windows SysInternals

but in fact their live service simply gives you the link to this page: http://live.sysinternals.com/ from where you can then download and execute locally.

Davide Piras
  • 43,984
  • 10
  • 98
  • 147
  • mmmm, this solution is not viable, for example if I download/execute a .exe file, the files asociated (dlls for example) are located in a client, is posible in my case, but if i execute 1000 times, the .exe is created 1000 times in the computer of client ( .exe,.exe(1),.exe(2),.exe(3)....exe(999) ) – cmujica Oct 19 '11 at 13:07
1

We need more details on what your exe needs to do as it will affect the technology you use but the correct way to do what you want to do is either:

  1. Use ActiveX. Have the user install your ActiveX control once and you will be able to run it from then on. ActiveX is basically running a DLL on the client computer for you. There are some sand-boxing limitations and it is falling out of favor as it is IE only and a larger and larger % of the internet is not using IE.
  2. Use Silverlight. This will be easier to program with and will be more like what you are familiar with. However (I think) it has more sandbox limitations than ActiveX, but it is cross browser and cross platform supported.

The Microsoft All-In-One Code Framework has examples of both ActiveX and Silverlight. I reccomend trying the All-In-One Sample Browser it's a little ruff around the edges but it works. There is a VS2010 extension too but it does not work with the express version of VS2010 or with VS2008.

For a simple example on how to set up ActiveX for a web page see the example HTMLEmbedActiveX. I do not know a specific silverlight example to point you to.

Please provide more details in your main post of what you are actually trying to do on the client side and I can tell you if one of these methods will work.

Scott Chamberlain
  • 124,994
  • 33
  • 282
  • 431
  • Scott, my situation is the following... I developed a software in EXT.NET (asp+c#), this software is a second version of a old program, for time reason, my software no have code lines to printer (various formats to print), as old program because we reutilice the old program... thus ,I execute the new software in the browser (chrome), used complete ,and after run old program (execute since new version) – cmujica Oct 19 '11 at 16:00
  • I am sorry, but I am having a hard time understanding your English. Also please post this information by clicking edit on your original question, you may want to try and re-read and re-write this statement before you post it. I do not understand what you said. You may want to put under your main question a copy of it explained in your native tong. We do not allow questions to be asked in languages other than English, but posting in both English and your native language may help some of the people reading your question understand you better. – Scott Chamberlain Oct 19 '11 at 16:04
0

@Scott Chamberlain: This is how I have been able to interpret the original question:

I have an application in ASP.NET / C# running on a server. What I want is to run other application (.EXE), but on the client who visit the server in question

question

(client)------------(server)
run browser         website 
   and              (asp.net/c#)
**execute           instruction     
app.exe**           for execute app.exe 

The application has been developed in EXT.NET (ASP + C#) which is an updated version of another old application built ​​in PowerBuilder. (Lets call them V2 and v1 respectively).

For the time being, the V2 has all the features of V1, so at the end of the procedure should be opened V1 and V2. That is, in the browser using both V1 and V2 should be able to open .EXE on the client.

I could not understand the last paragraph completely

Kumar Kush
  • 2,495
  • 11
  • 32
  • 42
  • I edited the question translating backwards (from spanish to english).. Unfortunately, since I don't have full privileges, you will have to wait for reading it.. anyway the spanish version has some problems (I asked for clarification, see my comment)... – gbianchi Oct 19 '11 at 18:23
0

If you define your V1 application as a URL handler then you can call it from any recent web browser. No need for ActiveX!

This works perfect. I use it for app-to-app links from web applications into a running PB win32 application. I have a separate PB win32 app acting as the URL handler. The URL handler looks for the running application. If it finds the running application it sends an event to that main application. It it doesn't it starts the main application sending the command from the web site as a commandline argument. Works perfect!