Old 26th January 2012, 20:48   #1
cuberbox
Junior Member
 
Join Date: Jan 2012
Posts: 1
How to write empty value for REG_MULTI_SZ in registry

It seems there is a little issue with writing empty value for REG_MULTI_SZ.

Here is the code:
code:
${registry::Write} "HKEY_LOCAL_MACHINE\SOFTWARE\test" "CommandLine" "" "REG_MULTI_SZ" $R0


The result is:
code:
[HKEY_LOCAL_MACHINE\SOFTWARE\test]
"CommandLine"=hex(7):00,00,00,00



But this is not empty string - but string with one string separator.

The real "empty" result must be:
code:
[HKEY_LOCAL_MACHINE\SOFTWARE\test]
"CommandLine"=hex(7):00,00



This is the value afte creation of empty REG_MULTI_SZ in regedit.

And if I use this code:
code:
${registry::Write} "HKEY_LOCAL_MACHINE\SOFTWARE\test" "CommandLine" "$\n" "REG_MULTI_SZ" $R0

the result is
code:
"CommandLine"=hex(7):00,00,00,00,00,00


So - it seems that registry::Write is always adds extra \0 to the value, and this is new string for REG_MULTI_SZ. How I can avoid this from nsis script?
cuberbox is offline   Reply With Quote
Old 2nd February 2012, 16:24   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
You will have to call the Reg* APIs directly using the System plug-in.

Stu
Afrow UK is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump