0

I face an issue for a client who need to launch an application from a ASP.Net website client side. For the moment the solution is using ActiveX, but we all want to find an other way to do this action.

I read this links to find informations : Is it possible to run an .exe or .bat file on 'onclick' in HTML

https://msdn.microsoft.com/en-us/library/aa767914%28v=vs.85%29.aspx

I know that for security issues, browsers don't allow the launch of client applications, but did someone find a hack to do something like that and have a sample to post ?

Have a good day

Community
  • 1
  • 1
Xavier W.
  • 1,270
  • 3
  • 21
  • 47

2 Answers2

1

The technology exists for YEARS and it's called ClickOnce.

https://msdn.microsoft.com/en-us/library/142dbbz4%28v=vs.90%29.aspx

It requires the .NET Framework at the client side and a support from a browser (some browsers require a plugin to correctly handle ClickOnce apps).

Applications are deployed either in a form of a self-extracting installer (setup.exe) or a link to an XML document, the manifest, that describes location of other components (appname.application). In any case, a client just clicks a link, the app is downloaded and run locally, using local client permissions.

In particular, the app can read/write local files, use certificates from the local store, print documents using local printers, call other services ever if they are cross-domain etc.

And note that such ClickOnce application can run client local processes without any restrictions. We use this feature for years and it sounds like this is exactly your scenario.

Wiktor Zychla
  • 47,367
  • 6
  • 74
  • 106
  • clickOnce allow me to deploy and install WPF applications for the client. What I need to do is launching an already installed application with the same path (from an other compagny) when i click on a button on the website. Is it possible with clickonce ? – Xavier W. Mar 24 '15 at 11:06
  • 1
    Yes, the very last sentence of my answer addresses that. We use this daily, in a production environment. The ClickOnce is deployed from the server from a link and locally it launches a local application. Note that ClickOnce DOESN"T have to be WPF, it can be a console app that doesn't even show up. – Wiktor Zychla Mar 24 '15 at 13:06
  • Thx for your help, i'll try to use ClickOnce to replace ActiveX and lunch application directly from client's browser. Have a good day. – Xavier W. Mar 24 '15 at 13:08
0

Theoretically it could happen if a service was listening on some predefined port and the application simply sent a specific request to that port.

Other than that, I don't think it's possible to directly execute an application on the user's computer.

Theodore Yankov
  • 369
  • 1
  • 6