从NSIS安装程序安装Chrome扩展? [英] Installing chrome extension from NSIS installer?
问题描述
我有一个也有firefox和chrome扩展的应用程序。我正在使用NSIS作为安装程序,现在我希望安装程序具有复选框,询问用户是否要为其浏览器安装扩展程序。
安装firefox扩展很简单,我只是将扩展文件复制到PROGRAMFILES \Mozilla Firefox\extensions {GUID},但我找不到方法(可以从NSIS安装程序中获得)。
是否有人知道如何实现这一目标?
更新:
感谢我所需要的。 (我无法回答我自己的问题,因为我不得不等待8个小时,因为我没有100个代表)
!define PRODUCT_VERSION1.0.0
!define CRXNAMEextension.crx
!define CRXIDqwertyuiopasdfghjklzxcvbnm
SetOutPath$ INSTDIR
文件$ {CRXNAME}
WriteRegStr HKLMSoftware\Google\Chrome\Extensions\ $ {CRXID}path$ INSTDIR\ $ {CRXNAME}
WriteRegStr HKLMSoftware\Google\Chrome\Extensions\ $ {CRXID}version$ {PRODUCT_VERSION}
WriteRegStr HKLMSoftware\Wow6432Node\Google\Chrome\扩展程序\ $ {CRXID}path$ INSTDIR \ $ {CRXNAME}
WriteRegStr HKLMSoftware \Wow6432Node\Google\Chrome\Extensions\ $ {CRXID}version $ {PRODUCT_VERSION}
I have an application that also has a firefox and chrome extension. I am using NSIS for the installer, now I want the installer to have checkboxs asking if the user want to install the extension for his browser.
To install the firefox extension it's easy I just copy the extension files to PROGRAMFILES\Mozilla Firefox\extensions{GUID}, but I couldn't find a way I could do it for chrome (from the NSIS installer).
Does someone knows how to achieve this?
Update:
Thanks what I needed. (I couldn't answer my own question yet because I have to wait 8 hours for not having 100 rep)
!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}"
这篇关于从NSIS安装程序安装Chrome扩展?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!