从网站启动桌面应用程序 [英] Launching a desktop application from a web site
问题描述
通过浏览器/ URL启动应用程序是否可行?这样做有什么选择?
Is it feasible to launch an application via a browser / URL? What are the options for doing this?
我知道用IE和Windows做这件事的方法(通常不起作用)。理想情况下,我希望这与浏览器无关。
I know the way to do it with IE and Windows (which usually doesn't work). Ideally, I would like this to be browser independent.
我们的应用程序是RCP,因此理论上Java Web Start可以工作,我们只需要做一些重大更改我们如何向用户提供我们的应用程序,我想避免。如果有所不同,我们的Web服务器代码目前都是Java。
Our application is RCP, so in theory Java Web Start could work, we would just have to do some significant changes to how we deliver our application to users, which I would like to avoid. Our web server code is currently all Java if that makes a difference.
我几乎放弃了这一点,直到我点击Apple网站上的网址,然后又推出了iTunes。
I pretty much gave up on this until I clicked a url on Apple's site, which in turn launched iTunes.
Apple如何做到这一点?
How does Apple do that?
推荐答案
iTunes 将自己注册为协议处理程序,用于自定义 itms://
和 itmss ://
协议。当您使用该协议点击URL时 - 在Apple的Web服务器上进行间接步骤后,在这种情况下 - iTunes会启动处理它,就像您的浏览器启动以处理 http://
网址或您的电子邮件程序启动以处理 mailto:
网址。
iTunes registers itself as a protocol handler for custom itms://
and itmss://
protocols. When you hit a URL with that protocol - after a step of indirection on Apple's web servers, in this case - iTunes launches to handle it, much like your browser launches to handle http://
URLs or your email program launches to handle mailto:
URLs.
这不是交叉平台本身,但它确实适用于每个平台,因为URL处理程序存在并在任何地方做同样的事情。
This isn't "cross-platform", per se, but it does work on every platform out there, as URL handlers exist and do the same thing everywhere.
它的缺点是只有工作如果应用程序已经安装,这就是为什么你可能想要一个指示人们在必要时安装应用程序的启动页面。
It has the disadvantage of only working if the application is already installed, which is why you may want to have a splash page that instructs people to install the application if necessary.
这篇关于从网站启动桌面应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!