views:

82

answers:

3

I want to access a desktop application and launch it on navigating to a 'http' URL. How can i achieve this?

Here's what i have found so far - iTunes (i want almost the same functionality with my application) registers a handler for 'itms' and does a javascript call to this 'itms://' URL when the http URL is invoked. I have tried this out and this works well (and is fairly straightforward).

I have also heard about IE MIME-Types. Do they work on a similar mechanism? Or are they different? What are the advantages or otherwise of going with this approach over the iTunes approach?

Are there any other ways of achieving what i want to?

A: 

If You want to launch a program via http:// , you can run a small web server on Your desktop, write a simple script to change some file after accessing you server via http://, and monitor the change on that file via a file alternation monitor. When the file changes, simply make an action (execution of an file, or something) via the file alternation monitor.

astropanic
It would not be possible for me to run a web server on all the desktops that my application would be installed and to assume that they would be up and running.
Anirudh
+1  A: 

You can do that by registering a protocol handler in the Registry (there is no need to run a web server on your desktop):

Registering an Application to a URL Protocol

(Please also note the security alert mentioned in that article. URL handlers might open security holes on your desktop)

0xA3
Divo, this is the way that iTunes does it. I have tried this out. I was wondering if this is the best way to do it or if there is a better way.
Anirudh
+1  A: 

Using a URI scheme just for that purpose is in conflict with the Web Architecture (see http://www.w3.org/TR/2004/REC-webarch-20041215/#URI-scheme). And yes, this applies to Apple's schemes (itms, ical...) too.

The proper way to achieve that goal is to mint a media type, to serve content with that media type, and to register the application as handler for that type. An example for a specification where this was used is RFC 4709 (http://greenbytes.de/tech/webdav/rfc4709.html).

Julian Reschke