xbarns
5th March 2009 14:06 UTC
Reading Reg_Multi_SZ when building with Unicode NSIS
Hi all,
i need to read a REG_Multi_SZ string and i am using NSIS Unicode (2.42-1).
Sadly neither the Registry Plugin nor the "REG_MULTI_SZ Reader" can do it with the Unicode Build, if i build the same Script with Ansi NSIS it works just nice.
Does anyone have an idea how to Read the REG_Multi_SZ when utilizing Unicode NSIS? A code snipped would be much appreciated.
Btw. i am trying to read
Key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server
Value: InstalledInstances
Thanks :)
Anders
5th March 2009 22:07 UTC
the REG MULTI SZ Reader sample should work, just change the A to a W (or even removing the A should work) ex: RegCloseKeyA -> RegCloseKeyW
xbarns
6th March 2009 11:08 UTC
Ok i have adjusted the Script as you recommended and actually i do get something back but not what i have expected.
The registry Value contains 2 Strings "SQLEXRESS" and "SQLEINST2" and i get back:
SQLEXPRESS
刀䔀匀匀
SS
Completed
刀䔀匀匀 (this is actually displayed as 4 squares, checking against unicoide.org it reveals that it seems to be 0000)
I tried switching all the "t" to "w" but that did not help either, and it does not make a difference if i do RegCloseKeyW or RegCloseKey.
Any Ideas?
Anders
6th March 2009 20:32 UTC
sorry, just switching the function did not help, turns out it does direct memory location changes, so everything is off by *2 bytes, I fixed the wiki entry, try with the new code
xbarns
9th March 2009 21:34 UTC
Sorry for the late answer, only got to test it today.
It works nice, thanks a lot!!!!!