从网站启动桌面应用程序 [英] Launching a desktop application from a web site

查看:51
本文介绍了从网站启动桌面应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过浏览器/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.

苹果是如何做到这一点的?

How does Apple do that?

推荐答案

iTunes 将自己注册为用于自定义 itms://itmss:// 协议的协议处理程序.当您使用该协议访问 URL 时 - 在这种情况下,在 Apple 的网络服务器上进行间接步骤后 - iTunes 启动以处理它,就像您的浏览器启动以处理 http:// URL 或您的启动电子邮件程序以处理 mailto: URL.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆