简体   繁体   中英

How to create a registry key

How can I create a registry key with NSIS? I couldn't find the appopriate command in NSIS doc.

(I understand all security issues)

Thanks!

You cannot create a empty registry key with the native NSIS instructions but the key is created for you when you set a value:

WriteRegStr HKCU "Software\Test" "" "The Default"

;or

WriteRegStr HKCU "Software\Test" "Foo" "Bar"

Install NSIS Registry plug-in

Use following function to Create registry keys.

Create Registry Key
${registry::CreateKey} "[fullpath]" $var
$var == 1   # [fullpath] already exists
$var == 0   # [fullpath] successfully created
$var == -1  # error

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