简体   繁体   中英

How to detect chrome version in NSIS?

My webapp need to depend on chrome browser, so when the app installs, i have to detect the chrome browser version in Nsis script. I try to use the following script, but it does not work. The $R0 is empty string.

!define CHROME "\Software\Microsoft\Windows\CurrentVersion\Uninstall\Google Chrome"
ReadRegStr $R0 HKLM "${CHROME}" "UninstallString"

How to detect chrome version information in NSIS script ?

You should look into the current user settings instead of the local machine (or in addition to the local machine if the resulting string is empty):

ReadRegStr $R0 HKCU "${CHROME}" "UninstallString"

Also you should not have a backslash at the beginning of the key path. Did you noticed a warning during the script compilation?

ReadRegStr: registry path name begins with '\', may cause problems 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM