gpt4 book ai didi

nsis - 如何读取注册表中的子项

转载 作者:行者123 更新时间:2023-12-02 22:58:41 42 4
gpt4 key购买 nike

嗨,我的注册表结构如下

HKLM
SOFTWARE
MYAPP
VER1
VER2
VER3

就像这个列表取决于我在 MYAPP 上安装的补丁数量。现在我想读取 VER1、VER2 ...并且我想捕获最后一个 VERX。如何读取MYAPP下的子键并找出最后一个子键。

最佳答案

答案 - 如何读取注册表项(而不是值)。

来自NSIS Scripting Reference

4.9.2.5 EnumRegKey

user_var(output) root_key subkey index

Set user variable $x with the name of the 'index'th registry key in root_key\Subkey. Valid values for root_key are listed under WriteRegStr. Returns an empty string if there are no more keys, and returns an empty string and sets the error flag if there is an error.

StrCpy $0 0
loop:
EnumRegKey $1 HKLM Software $0
StrCmp $1 "" done
IntOp $0 $0 + 1
MessageBox MB_YESNO|MB_ICONQUESTION "$1$\n$\nMore?" IDYES loop
done:

就您而言:

EnumRegKey $1 HKLM "Software\MYAPP" $0 

关于nsis - 如何读取注册表中的子项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12944117/

42 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com