installation - 自动安装谷歌浏览器扩展程序不起作用!

标签 installation registry google-chrome-extension external nsis

我正在从事与此页面相关的工作

  • http://code.google.com/chrome/extensions/external_extensions.html

  • 我写了一个 NSIS 脚本,试图自动安装一个 chrome 扩展。
    (为什么?因为我们的扩展可以通过复选框与另一个产品安装流程一起提供,那么如果用户选择我们要添加的扩展,它将使用 NSIS 静默安装自动安装在用户 chrome 浏览器上)

    我尝试了很多场景,我需要帮助,在谷歌网站上,他们说你可以做到这一点
  • 使用首选项 JSON 文件
  • 使用 Windows 注册表

  • 他们还说“使用首选项文件”有一个错误(Windows 注意:在修复错误 41902 之前,您可能希望使用 Windows 注册表而不是首选项文件。)
  • http://code.google.com/p/chromium/issues/detail?id=41902#makechanges

  • 提醒:
    自动安装的扩展程序称为外部扩展程序
  • 所以我尝试了“使用 Windows 注册表”

  • 要通过注册表添加 google chrome 扩展:
  • 添加此 key :“HKEY_LOCAL_MACHINE\SOFTWARE\Google\Chrome\Extensions(我的扩展程序 ID)”
  • 添加带有 .crx 路径的“路径”
  • 添加“版本”与扩展版本

  • 这是我尝试过的(使用 NSIS 脚本):
  • 如果我添加一个注册表项
    它将安装扩展程序,但如果用户手动卸载,chrome 会打开黑名单标志,并且无法使用任何其他脚本重新安装扩展程序。剩下的唯一方法是用户手动安装。最糟糕的是,如果用户手动安装并手动卸载(它将关闭黑名单标志),并且当 chrome 重新启动时,它将自动重新安装扩展(无需任何用户操作),因为注册表项仍然存在。
  • 如果我在启动或关闭浏览器时删除注册表项,通过一种奇怪的方式(在 crx 中使用 dll(NPAPI)),Chrome 将在浏览器重新启动时自动删除扩展目录。
  • 如果我在用户卸载扩展时设法删除注册表项。我们被列入黑名单,因此在用户通过手动安装和卸载扩展程序关闭黑名单标志之前,自动安装程序将不再工作。
  • 如果我在 中创建目录"C:\Users\(用户名)\AppData\Local\Google\Chrome\User Data\Default\Extensions\(extensionID)\(version)_0\(我的文件在这里)" ,我遇到了很多麻烦,因为 chrome 会在重新启动浏览器后立即删除我的文件。

  • 有没有人遇到过这个问题,必须做些什么。
    我将尝试使用 JSON 文件,但在错误未修复之前,注册表是唯一的方法。

    感谢任何有时间阅读所有这些的人!
    任何帮助将不胜感激,谢谢!

    最佳答案

    [ 2013-11-11 ]
    [这个问题的答案即将过时,所以这里有一个更新的答案。]

    根据 recent post 在 Chromium 博客上,自动安装 Chrome 扩展程序在不久的将来不会成为一种选择:

    Starting in January [2014] on the Windows stable and beta channels, we’ll require all extensions to be hosted in the Chrome Web Store.



    作为替代方案,开发人员和供应商将能够使用内联安装功能:

    If your extensions are currently hosted outside the Chrome Web Store you should migrate them as soon as possible. There will be no impact to your users, who will still be able to use your extension as if nothing changed. You could keep the extensions hidden from the Web Store listings if you like. And if you have a dedicated installation flow from your own website, you can make use of the existing inline installs feature.



    所以,基本上,你需要做的是:
  • 在 Chrome 网上应用店托管您的扩展程序(可选择将其隐藏在列表中)。
  • 让您的安装程序打开指向您网站上的网页的 Chrome 浏览器窗口。
  • 在该页面上有用户启动扩展安装过程所需的所有信息和数据。 (这里的关键概念是 用户 必须启动安装过程,例如通过单击按钮。


  • 内联安装如何工作:

    The HTML page on your site from which you want inline installation to occur must contain one or more tags in the section referencing the items that the user can install. Each tag must have the following format:


    <link rel="chrome-webstore-item" href="https://chrome.google.com/webstore/detail/itemID">
    

    To actually begin inline installation, the chrome.webstore.install(url, successCallback, failureCallback) function must be called. This function can only be called in response to a user gesture, for example within a click event handler; an exception will be thrown if it is not.



    (强调我的)

    更多信息 inline installs feature .

    关于installation - 自动安装谷歌浏览器扩展程序不起作用!,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5887944/

    相关文章:

    c# - 创建 C# 安装程序的最佳方式

    c# - 查找预装应用程序的 MSI 安装包?

    c# - 删除子项错误 (C#)

    javascript - 为 Chrome 扩展程序存储数组的最佳方式是什么?

    google-chrome-extension - 尝试在onBeforeRequest上设置监听器时的“Error: Parameter 1 required”

    linux - 不使用ssh在linux上远程安装

    Python 打包 - 程序的 Distutils

    registry - Java 控制面板中 JRE 自动下载选项的 Windows 注册表是什么?

    javascript - 当点击任何网站的扩展名时,pinterest 如何设法在其上加载 iframe?

    c++ - 设置 Netbeans 8.0.2 以与 Qt 5.4 一起使用