更新 IE 插件
是否可以让我的 Internet Explorer 插件自行更新,而无需使用 .msi 手动卸载/重新安装?我一直在考虑尝试以编程方式执行此操作,但我不确定需要做什么(注册 .dll 等)。
谢谢,内森
Is it possible to get my Internet Explorer plugin to update itself without requiring a manual uninstall/reinstall using the .msi? I have been thinking of trying to do this programmatically but I am unsure as to what would need to be done(registering .dll's etc).
Thanks, Nathan
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只需在后台下载新的 MSI。完成后,提示用户,如果他们同意,则运行新的 MSI。
RE:避免用户输入:
您可以在未经他们许可的情况下执行此操作...但由于安装新的附加组件需要重新启动浏览器,因此这可能不是随机执行的最佳操作。当您知道商店将关闭时,您可能会安排它发生,但如果它们在黑色星期五午夜开门怎么办?你必须想清楚。
另一种方法是实现一个存根 DLL,它公开扩展实现的所有接口,并将该存根注册为 IE 加载的存根。然后你的存根可以在真正的 dll 上调用 loadlibrary 并通过 thunk 所有调用。当您想要安装新版本时,您可以下载新的实现 dll,并让存根卸载旧版本,然后加载新版本。如果您正确执行此操作,那么对用户来说可能是无意义的...当新的 dll 需要新的注册表项或您需要更新存根...等时,困难就会出现。所有这些问题都可以解决,但需要付出努力爆炸。
我的建议是保持简单,直到你绝对需要这样做。
Just download the new MSI in the background. When it's done, prompt the user and if they agree, run the new MSI.
RE: avoiding user input:
You can do it without their permission... but since installing a new add-on requires restarting the browser, that may not be the best thing to randomly do. You might time it to happen when you know the stores will be closed, but what if they open at midnight for Black Friday? You have to think it through.
An alternative is to implement a stub DLL that exposes all the interfaces that your extension implements and register that stub as the one that IE loads. Then your stub can call loadlibrary on the real dll and thunk all the calls through. When you want to install a new version, you download the new implementation dll and have the stub unload the old one and then load the new one. If you do this properly it can be seemless to the user... the difficulty comes when the new dll needs new registry entries or you need to update the stub... etc. All of these problems can be solved, but the effort required explodes.
My advice is keep it simple until you absolutely have to go to these lengths.