delux
delux

Reputation: 1876

Run desktop app via WEB app

I have desktop application that can be installed on the users computer with "setup" msi file like any other application.

I'm developing web application and I need somehow to integrate the desktop application with the web application. Web application is developed using PHP (desktop application is developed using C#), and when clicking on one button on the web application, the desktop application needs to be launched.

Is there a way of doing this? I was thinking about a few scenarios:

-Maybe if possible to install the app directly on the server and to launch it from there?

-Maybe to be required the user to have the app installed on his computer and to call the app from there?

If possible I would prefer to not use the second approach because it's better if the third party to not be involved - it will be more user friendly if the application is launched directly. But any help will be appreciated because at this point I'm not sure if that is possible to be done at all.

Upvotes: 0

Views: 3521

Answers (4)

Fotios Basagiannis
Fotios Basagiannis

Reputation: 1501

It can possibly be done with IIS but it can be cumbersome setting it up to run as the current user, especially since it would probably also need to run elevated for an app that needs to attach to the current user's desktop.

Easiest is to install a Windows LAMP distro (like WAMP: http://www.wampserver.com/en/) and then run the httpd.exe directly from an elevated (Admin) command prompt; do not run apache as a service!

Once you do this performing and exec("command"); call in php will bring up a desktop app as if it was invoked from an admin command prompt. Obviously you need to set up the apache server to be accessible from outside the local system, etc.

Upvotes: 0

If you ultimately decide to require your users to have the client application installed and expect majority of the users to be on Windows, you could register your application to handle specific scheme and parse its command line when started. More on this here:

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

You'd register a custom scheme and then intercept in in the application's command line arguments. The whole URL will be passed as an argument, e.g.:

myapp://parameter1,parameter2

The browser will mostly ask whether or not the user trusts the application to handle this scheme with an option to remember this setting.

If you don't have access to the source code of the client application, you can develop a middleware, some sort of a launcher that handles the URL and then runs the client application after maybe modifying some configuration files based on the URL or otherwise controlling the third-party application to do as you with.

As for solution #1, I don't think C# matters if your application can run on Mono, so you should be able to just run it from PHP. However, this probably won't work on web hosting and you will have to get a VPS for that.

Upvotes: 1

Craig Tullis
Craig Tullis

Reputation: 10497

There are very good (security) reasons why it is hard to launch client-side processes from web browsers.

Do you have access to the source code of the C# app? If so, you could consider modifying it to take advantage of Microsoft ClickOnce deployment.

Some references:

http://msdn.microsoft.com/en-us/library/t71a733d.aspx

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

http://msdn.microsoft.com/en-us/library/6ae39a7c.aspx

http://www.codemag.com/Article/0902031

Here's an old article on deploying WinForms applications via ClickOnce with Visual Studio 2005: http://msdn.microsoft.com/en-us/library/ms953320.aspx

Upvotes: 0

user3423805
user3423805

Reputation:

You can install app at server an run it with exec() or "`" operator - but to control gui of app you need to use some like autoit ant etc.

Upvotes: 1

Related Questions