I am working on a job in relation with this page
I wrote a NSIS script that is trying to auto install a chrome extensions. (Why ? because our extension can be offered with another product installation flow through a checkbox, then if user select our extension to be added, it will auto-install on the user chrome browser using NSIS silent installation)
I tried a lot of scenario and I need help, on google website, they say you can do this
- Using a preferences JSON file
- Using the Windows registry
They also say that "Using a preferences file" has a bug (Windows note: Until bug 41902 is fixed, you might want to use the Windows registry instead of the preferences file.)
Reminder: An extension that's installed automatically is known as an external extension
- So I tried "Using the Windows registry"
To add a google chrome extensions through registry:
- add this key: "HKEY_LOCAL_MACHINE\SOFTWARE\Google\Chrome\Extensions(my extension id)"
- add "path" with the path to a .crx
- add "version" with the version of the extension
This is what I tried (using NSIS script):
If I Add a registry key It will install the extension, BUT if user uninstall manually, chrome turns the blacklist flag on and the extension can't be reinstalled with any other script. The only way left is that user installs, manually. Worst, if user install manually and uninstall manually (it will turn the blacklist flag off), and when chrome will be restarted, it will reinstall the extensions automatically (without any user action) since the registry key is still there.
If I remove the registry key when we start or close the browser, through a freaky way (using a dll(NPAPI) within the crx), chrome will auto-delete the extensions directory when browser restarts.
If I manage to delete the registry key when user uninstall the extension. We get blacklisted, so the auto-installer won't work anymore until user turn blacklist flag off by manually installing&uninstalling the extension.
If I create the directory in "C:\Users\(username)\AppData\Local\Google\Chrome\User Data\Default\Extensions\(extensionID)\(version)_0\(my files here)", I run into a lot of trouble because chrome will delete my files as soon as it restarts the browser.
Does anyone have run into this problem, and what has to be done. I will try with the JSON file but until bug isn't fixed, Registry is the only way.
Thank for anyone who had the time to read all this ! Any help will be appreciated, thanks!