以最少的用户步骤部署 NPAPI 插件 [英] Deployment of NPAPI plugin with minimal user steps

查看:19
本文介绍了以最少的用户步骤部署 NPAPI 插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

情况:我已经为我的 IE 用户编写了一个完美运行的 ActiveX 控件.我构建了 .ocx,对其进行了 CAB,签名,然后将其放在带有 EMBED 标签的站点上.用户加载页面,黄色栏出现,询问他们是否要安装它:他们所要做的就是点击它,然后我们就离开了.

现在我需要构建对 FF、Chrome 和 Safari(在 Mac 上)的支持.根据我的研究,NPAPI 是做到这一点的方法,而 Firebreath 应该让它更容易.但从我所读到的内容来看,部署并不是那么容易.Windows 用户必须在 DLL 上运行regsvr32"(我的网络用户实际上都不会这样做).我不知道在 Mac 上会发生什么.我相信用户必须将其复制到/Library/InternetPlugins/之类的目录中,这也是部署的非启动项.Firefox 用户会下载/运行 .xpi.Chrome 应该运行 .crx.

有没有人有这方面的经验?您如何为其他三大浏览器部署一个易于用户运行的 NPAPI 插件?

解决方案

FireBreath 用户经常提出这个问题,所以我可能是时候在一个比项目谷歌小组.

首先澄清一下regsvr32的问题,FireBreath确实支持所有浏览器的自注册";这意味着当您调用 regsvr32 时,它不仅会为 IE 安装注册表项,还会使用 DReJ 链接的方法为 NPAPI 浏览器安装注册表项(该信息为 +1,顺便说一句,谢谢.许多人不知道在哪里可以找到它).

但是,安装程序世界和 Microsoft 强烈反对自注册 DLL.这有很多原因.您在帖子中总结了其他安装选项方面做得非常好;您可以在 IE 上使用 .cab 文件,在 Firefox 上使用 .XPI 文件,但当然这些在其他浏览器上对您没有帮助.

FireBreath 团队(由我领导)推荐的方法是对所有浏览器使用 MSI 安装程序.就我个人而言,我不喜欢在不同的浏览器上安装不同的东西,所以我使用 javascript 来检测插件的存在(或不存在),然后提示用户下载并运行 MSI 安装程序.

FireBreath 具有对使用 WiX 构建 MSI 安装程序的内置"支持.如果您在计算机上安装 WiX 3.0 或更高版本并重新运行准备脚本,它将创建一个 _WiXInstaller 项目,该项目将构建一个基本的 MSI,作为 Visual Studio 构建过程的一部分,为所有浏览器安装您的插件.您可以修改将保留在您的主目录中的 .wxs 模板以对其进行自定义.

可以在 FireBreath wiki 上找到更多信息:http://www.firebreath.org/display/documentation/WiX+Installer+Helphttp://www.firebreath.org/display/~me@iaincollins.com/Potential+Installer+Improvements

如果您真的很喜欢在 IE 上使用 .cab 安装程序(我遇到了它们的问题,但有些人似乎很幸运)您可以在 CAB 中分发 MSI 文件并让它在何时运行CAB 已安装.这样做的好处是,当您安装 MSI 时,它会为 IE、Firefox、Safari、Chrome 和 Opera(以及与这些浏览器使用的相同插件技术兼容的其他浏览器)安装所有内容.

快速说明一下,MSI 是安装插件的理想解决方案(而不是使用像 regsvr32 这样调用 DllRegisterServer 的东西)的原因是 MSI 是基于事务的,所以当你卸载它时,它总是会颠倒投放;这意味着您不必担心支持卸载 10 个不同的旧安装程序版本,这些安装程序将东西放在不同的地方等等,因为 MSI 系统会在您升级时负责干净地卸载所有内容.

希望有帮助!

Situation: I've already written an ActiveX control for my IE users which works perfectly. I build the .ocx, CAB it up, sign it, and put it on the site with an EMBED tag. Users load the page, the yellow bar shows up asking if they want to install it: all they have to do is click it, and we're off.

Now I need to build support for FF, Chrome, and Safari (on Mac). From my research, NPAPI is the way to do this, and Firebreath is supposed to make it easier. But from what I have read, deployment is not so easy. Windows users would have to run "regsvr32" on a DLL (which none of my web users would actually do). I have no idea what would happen on a Mac. I believe the user has to copy it to a directory like /Library/Internet Plugins/, which is also a non-starter for deployment. Firefox users would download/run an .xpi. Chrome is supposed to run a .crx.

Does anyone out there have experience with this? How do you do a easy-for-users-to-run deployment of an NPAPI plugin for the other big 3 browsers?

解决方案

This is a question that is raised a lot by FireBreath users, so it's probably about time I responded in more detail on a forum that is easier to find than the project google group.

First of all, to clear up the regsvr32 thing, FireBreath does indeed support "self registering" for all browsers; that means when you call regsvr32 it installs registry keys not just for IE but also for NPAPI browsers using the methods linked to by DReJ (+1 for that info, btw, thanks. Many don't know where to find it).

However, self-registering DLLs is highly discouraged in the installer world and by Microsoft. There are a lot of reasons for this. You've done a pretty good job of summarizing the other install options in your post; You can use a .cab on IE and a .XPI on firefox, but of course those don't help you on other browsers.

The method recommended by the FireBreath team (which I lead) is to use an MSI installer for all browsers. Personally, I dislike having things work differently on different browsers for an install, so I use javascript to detect the presence (or absence) of the plugin and then prompt the user to download and run the MSI installer.

FireBreath has "built-in" support for building MSI installers with WiX. If you install WiX 3.0 or later on your machine and re-run the prep script it will create a _WiXInstaller project that will build a basic MSI to install your plugin for all browsers as part of the Visual Studio build process. You can modify the .wxs template that will be left in your home directory to customize it.

More info can be found on the FireBreath wiki: http://www.firebreath.org/display/documentation/WiX+Installer+Help http://www.firebreath.org/display/~me@iaincollins.com/Potential+Installer+Improvements

If you are really in love with using your .cab installer for IE (I've had problems with them, but some seem to have good luck with them) you can distribute the MSI file inside your CAB and have it run when the CAB is installed. The advantage to this is that when you install the MSI it installs everything for IE, Firefox, Safari, Chrome, and Opera (as well as other browsers which are compatible with the same plugin technologies that those browsers use).

As a quick note, the reason that an MSI is the ideal solution for installing plugins (as opposed to using something that calls DllRegisterServer like regsvr32) is that the MSI is transaction based, so when you uninstall it will always reverse what was put in; that means that you don't have to worry about supporting uninstalling 10 different old installer versions that put things in different places, etc, because the MSI system takes care of uninstalling everything cleanly when you upgrade.

Hope that helps!

这篇关于以最少的用户步骤部署 NPAPI 插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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