Windows installer for chrome extension - google-chrome

I have just created an extension that is to be installed on chrome for video chat. I would like to bundle it with the software that I am providing. How can I create an installer that allows me to do this.
The application is written in java and the chrome extension in the html, js, css code. I also have no problem in writing the code in vb but I just cant find any links where they have information on this.

You need create exe(or vb script) as part of your installer which will create in windows registry record for your extension:
Find or create the following key in the registry:
32-bit Windows: HKEY_LOCAL_MACHINE\Software\Google\Chrome\Extensions
64-bit Windows: HKEY_LOCAL_MACHINE\Software\Wow6432Node\Google\Chrome\Extensions
Create a new key (folder) under the Extensions key with the same name as the ID of your extension (for example, aaaaaaaaaabbbbbbbbbbcccccccccc).
In your extension key, create a property, "update_url", and set it to the value: "https://clients2.google.com/service/update2/crx" (this points to your extension's crx in the Chrome Web Store):
{
"update_url": "https://clients2.google.com/service/update2/crx"
}
Launch the browser and go to chrome://extensions; you should see the extension listed.
More info can be found in official docs

If you want to install a Chrome extension via other software, this might help.
However, I believe that the user now has to approve the installation under the Wrench icon.

Related

Programmatically installing a chrome extension to the default profile [duplicate]

I've written an extension for Google Chrome that will be released with the next version of our product. I want to understand what properties, paths for extraction, registry entries, etc. should I provide the installer of my product so that the end user doesn't have to install the extension on their own manually, and the installer does the complete job of installing the extension, and also notifies the user that the extension has been installed. As of now, the code that I have written is placed in a folder, and I use the "Load Unpackaged Extension" to load the extension. What should I do to achieve the aforementioned task?
Google's current policy on installing extensions via the registry (for Windows machines) is this:
Only extensions from the Google Extension Gallery (or Chrome Web Store - CWS) can be installed via the registry.
See this link - https://developer.chrome.com/extensions/external_extensions - for information on how this can be done. Keep in mind the following:
-This technique will still pop-up a msgbox to the user. its not completely silent.
-When using this technique, if the user subsequently removes the extension from her Chrome, the extension gets "blacklisted" on that chrome and will not re-auto-install until the user re-install it
manually. refer to Auto-installing a google chrome extension won't work ! for details.
Chrome has a couple ways of installing extensions programmatically:
http://www.chromium.org/administrators/pre-installed-extensions
Edit: yes, this policy has changed by now, as FuzzyAmi points out.
If you're using GNU/Linux, this is how you pre-install an extension from the chrome web store for all users:
/etc/chromium/policies/managed/yourextension_policy.json
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
{
"ExtensionInstallForcelist": [
"yourextensionuniqueidentifiersup;https://clients2.google.com/service/update2/crx",
"yourextensionuniqueidentifiersup"
]
}
Reference
metamask-chrome - AUR

create installer to make google chrome shortcut of a site

is there a way to create installer to make google chrome shortcut of a site?
I made a web app and instead of trying to get multiple computers to type the url, I created a shortcut of chrome with this command.
--app=example.com/blah/blah
Is there a way that i can create an shortcut with the command and compile it, with an icon?
You don't need to point to Chrome if that is already the default web browser from the machine. All you need to create is an URL shortcut. All MSI authoring tools should be able to do that.
With the free edition of Advanced Installer you can do like this:
if you don't have AI, download and install it
launch the application and create a "Simple" project, like in the first step from this tutorial
then just create a shortcut to URL in the Files and Folders page, using the option "New Shortcut To -> URL... " and set the URL desired in the configuration dialog of the new shortcut.
save and build the project, the MSI will be generated and you can now install it on the desired machines
Download this sample project file to see how it looks if you have problems following the steps above.

Install Chrome extension form outside the Chrome Web Store

I have developed a Chrome extension and I have packed it.
I sent my extension to some people to try it, but Chrome started to block extensions that it does not find in the store.
Is there any way to install my extension without getting blocked by Chrome?
EDIT
Is there any way to install extension as developer mode? I read that only extensions that installed in developer mode will not blocked.
For regular Windows users who are not skilled with computers, it is practically not possible to install and use extensions from outside the Chrome Web Store.
Users of other operating systems (Linux, Mac, Chrome OS) can easily install unpacked extensions (in developer mode).
Windows users can also load an unpacked extension, but they will always see an information bubble with "Disable developer mode extensions" when they start Chrome or open a new incognito window, which is really annoying. The only way for Windows users to use unpacked extensions without such dialogs is to switch to Chrome on the developer channel, by installing https://www.google.com/chrome/browser/index.html?extra=devchannel#eula.
Extensions can be loaded in unpacked mode by following the following steps:
Visit chrome://extensions (via omnibox or menu -> Tools -> Extensions).
Enable Developer mode by ticking the checkbox in the upper-right corner.
Click on the "Load unpacked extension..." button.
Select the directory containing your unpacked extension.
If you have a crx file, then it needs to be extracted first. CRX files are zip files with a different header. Any capable zip program should be able to open it. If you don't have such a program, I recommend 7-zip.
These steps will work for almost every extension, except extensions that rely on their extension ID. If you use the previous method, you will get an extension with a random extension ID. If it is important to preserve the extension ID, then you need to know the public key of your CRX file and insert this in your manifest.json. I have previously given a detailed explanation on how to get and use this key at https://stackoverflow.com/a/21500707.
For Windows, you can also whitelist your extension through Windows policies. The full steps are details in this answer, but there are quicker steps:
Create the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\ExtensionInstallAllowlist.
For each extension you want to whitelist, add a string value whose name should be a sequence number (starting at 1) and value is the extension ID.
For instance, in order to whitelist 2 extensions with ID aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa and bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb, create a string value with name 1 and value aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, and a second value with name 2 and value bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb. This can be sum up by this registry file:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome]
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\ExtensionInstallAllowlist]
"1"="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
"2"="bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
EDIT: actually, Chromium docs also indicate how to do it for other OS.
EDIT (06/05/2022): ExtensionInstallWhitelist is deprecated since Chrome 100, it has been renamed to ExtensionInstallAllowlist (answer updated)

How to install a Chrome extension programmatically?

I've written an extension for Google Chrome that will be released with the next version of our product. I want to understand what properties, paths for extraction, registry entries, etc. should I provide the installer of my product so that the end user doesn't have to install the extension on their own manually, and the installer does the complete job of installing the extension, and also notifies the user that the extension has been installed. As of now, the code that I have written is placed in a folder, and I use the "Load Unpackaged Extension" to load the extension. What should I do to achieve the aforementioned task?
Google's current policy on installing extensions via the registry (for Windows machines) is this:
Only extensions from the Google Extension Gallery (or Chrome Web Store - CWS) can be installed via the registry.
See this link - https://developer.chrome.com/extensions/external_extensions - for information on how this can be done. Keep in mind the following:
-This technique will still pop-up a msgbox to the user. its not completely silent.
-When using this technique, if the user subsequently removes the extension from her Chrome, the extension gets "blacklisted" on that chrome and will not re-auto-install until the user re-install it
manually. refer to Auto-installing a google chrome extension won't work ! for details.
Chrome has a couple ways of installing extensions programmatically:
http://www.chromium.org/administrators/pre-installed-extensions
Edit: yes, this policy has changed by now, as FuzzyAmi points out.
If you're using GNU/Linux, this is how you pre-install an extension from the chrome web store for all users:
/etc/chromium/policies/managed/yourextension_policy.json
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
{
"ExtensionInstallForcelist": [
"yourextensionuniqueidentifiersup;https://clients2.google.com/service/update2/crx",
"yourextensionuniqueidentifiersup"
]
}
Reference
metamask-chrome - AUR

Add external extension by using registry

I use Windows 7(64bit) and repeat steps in Google Document.
This is what I added in register.
In HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Google\Chrome\Extensions\nbfjanngloflombfddlmkgnambnfhgjc
path="C:\Extension.crx"
version="2.1"
But extension isn't install.
Before testing .crx file distribution,
I installed and uninstalled this extension with unpacked files many times by UI(chrome://extensions) for development and tested setting policy by using register. (But I removed all of them now.)
Does it cause any problem?
But when I tested same thing in another clean PC(Windows XP 32bit) nothing is changed, too.
I already checked some common mistakes in Google Document several times, but I can't find any mistakes.
- Not specifying the same id/version as the one listed in the .crx
- Key created in the wrong location in the registry
- Registry entry points to the wrong path to the .crx file (or path specified but no filename)
- Permissions problems on a network share
Are there other common mistakes I should check to install external extension?
According to this page - https://developer.chrome.com/extensions/external_extensions -
it is no longer possible to use the registry method to install locally-hosted .crx files.
in fact, the only allowed extension are those from Google's Extension gallery.
See a quote below from Google's policy page:
An extension that's installed automatically is known as an external extension. Google Chrome supports two ways of installing external extensions:
-Using a preferences JSON file (Mac OS X and Linux only)
-Using the Windows registry (Windows only)
Both ways support installing an extension hosted at an update_URL. In the Windows registry, the update_URL must point to the Chrome Web Store where the extension is hosted.
The extension-ID cannot be chosen at random.
I've installed your .crx file in Chromium 18 (Linux), and Chrome 18 (Windows 7 in VirtualBox), and the correct extension-ID is: lhmigopickaaleaaelbppeabnbdgcdhe
The version number has to match. In the manifest.json file, in the extension, I see "version": "1.0". So, the version entry in the registry has to be 1.0.
I was not able to install the extension via the registry using the steps from the Documentation. I've found two right ways to install the extension through the registry. Create a .reg file, and paste the text below to install the extension:
set_page_color_chrome-extension.reg (based on this file, md5: 10a1b95c249a2481bc88d3d1aead0e33).
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Google\Chrome\Extensions\lhmigopickaaleaaelbppeabnbdgcdhe]
"version"="1.0"
"path"="C:\\set_page_color.crx"
Replace HKEY_LOCAL_MACHINE with HKEY_CURRENT_USER if you're running in permission trouble, or if you want to install the extension only for the current user.