简体   繁体   English

如何在NSIS中检测Chrome版本?

[英]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. 我的webapp需要依赖chrome浏览器,因此,在安装该应用时,我必须在Nsis脚本中检测chrome浏览器的版本。 I try to use the following script, but it does not work. 我尝试使用以下脚本,但是它不起作用。 The $R0 is empty string. $R0为空字符串。

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

How to detect chrome version information in NSIS script ? 如何在NSIS脚本中检测Chrome版本信息?

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 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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