2

I have developed a Google Chrome Extension that I need to automate installation for my users.

I have published it in Google Web Store but I don't want a user to search for it in order to install, because this extension is part of other development, including a C# application.

I am creating an installer that installs the C# application but I need to add the automatic installation for my extension. How can I do it?

jstuardo
  • 3,901
  • 14
  • 61
  • 136

2 Answers2

2

Yes, you can. The procedure is described in the docs.

Summary:

  • The installer adds a registry entry that contains the extension ID.
  • Upon next Chrome restart (you may want to ask the user to do it), the extension will be downloaded and then the user will be prompted whether he/she wants to install it.
    • If yes, you live happily ever after, with the extension bearing "Installed by a third-party" mark in the extension list.
    • If no, the extension will be disabled, and you cannot enable it yourself (you have to ask the user to do that by going to chrome://extensions/ or the CWS listing)
  • If the user ever uninstalls the extension, it will be blacklisted from ever attempting that install procedure on this Chrome profile; if the user changes his mind, he'll have to install it directly from the Store.

Leave clear instructions for your users: that they must restart the browser and expect/accept the prompt.

Xan
  • 74,770
  • 16
  • 179
  • 206
  • Thanks. I have followed the guide but I have the last question though. When I installed the extension in development, I retrieved its ID. Then I created the CRX and PEM files. However, when I uploaded the extension to Google Web Store, I had to zip the extension folder and then upload it. I did not specify the ID anywhere. How the match will be made by the installer in order to install the right extension? – jstuardo Aug 31 '16 at 11:43
  • 1
    If you already uploaded, it's too late; the ID has changed. You need to use the Webstore one. In future, if you want to use your own PEM file (and therefore your own ID) you can include it in the initial upload as `key.pem` inside the ZIP. From the dashboard, you can get the `key` parameter for the manifest for your development version if you need to replicate the ID, but you can't extract the PEM file anymore. See [this question](https://stackoverflow.com/questions/21497781/how-to-change-chrome-packaged-app-id-or-why-do-we-need-key-field-in-the-manifest/). – Xan Aug 31 '16 at 11:46
  • I have uploaded the extension, but it is not published yet, since I have to pay $ 5 first, I will do it when I am ready for publishing. Can I delete the extension from my dashboard and then upload the new ZIP file with the key? – jstuardo Aug 31 '16 at 11:48
  • No, deleting an item from Web Store is not supported; you can only upload it again as a separate item. Unpublished extensions do not count towards your limit, so it's not too big a problem. However, do you really have a legitimate reason to worry about your ID? You can replicate it in development now with the `"key"` key. – Xan Aug 31 '16 at 11:50
  • Yes.... I am using NativeMessaging to communicate the extension with the C# application, so I need the extension ID beforehand in order for the NativeMessaging to work. – jstuardo Aug 31 '16 at 11:52
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/122288/discussion-between-xan-and-jstuardo). – Xan Aug 31 '16 at 11:54
1

The best way to do this is the way that Xan wrote in his answer.

If you need to force install Chrome extensions in your company without user interaction. You can do this with ExtensionInstallForcelist policy or with master_preferences file. Both ways described here.

Elad
  • 1,114
  • 8
  • 15