Installing chrome extension from NSIS installer?

I have an application that also has firefox and chrome extension. I use NSIS for the installer, now I want the installer to have flags asking if the user wants to install the extension for their browser.

To install the firefox extension, I just copied the extension files to PROGRAMFILES \ Mozilla Firefox \ extensions {GUID}, but could not find a way to do this for chrome (from the NSIS installer).

Does anyone know how to achieve this?


Update:

External extensions

Thank you for what I need. (I could not answer my question, because I have to wait 8 hours, so as not to have 100 reputation)

+4
source share
2 answers
!define PRODUCT_VERSION "1.0.0" !define CRXNAME "extension.crx" !define CRXID "qwertyuiopasdfghjklzxcvbnm" SetOutPath "$INSTDIR" File "${CRXNAME}" WriteRegStr HKLM "Software\Google\Chrome\Extensions\${CRXID}" "path" "$INSTDIR\${CRXNAME}" WriteRegStr HKLM "Software\Google\Chrome\Extensions\${CRXID}" "version" "${PRODUCT_VERSION}" WriteRegStr HKLM "Software\Wow6432Node\Google\Chrome\Extensions\${CRXID}" "path" "$INSTDIR\${CRXNAME}" WriteRegStr HKLM "Software\Wow6432Node\Google\Chrome\Extensions\${CRXID}" "version" "${PRODUCT_VERSION}" 
+4
source

The only way I could think of is to open Chrome to the user at the specific URL where the extension is located. Of course, some user instructions in advance. A more evil way would be to do SendKey events for the user. Depends on how much you "dance with the devil";)

0
source

Source: https://habr.com/ru/post/1386713/


All Articles