Benoni
4th January 2003 16:32 UTC
Reading registry Binary and
Is there anyway to read a registry binary value as I can only find ReadRegDWORD and ReadRegStr. Also, can you get the currently loged-on username and computername using ReadEnvStr or any other method, and is there somewhere I can get a list of other environment strings?
Thanks
kichik
4th January 2003 16:44 UTC
You can't read binary data from the registry using NSIS because NSIS can only handle the string data type. You can always write an extension DLL (plug-in) to do this. You can find an example in Contrib\ExDLL.
To get the user name under NT (NT, 2000, or XP) use the UserInfo DLL. To get a list of environment variables use nsExec to execute the command set:
ReadEnvStr$0 "COMSPEC"
>nsExec::ExecToLog "$0 /C set"
># or...
>nsExec::ExecToStack "$0 /C set"
I am not sure it will fit to a NSIS variable, so you can also direct it into a temporary file and read it from there (using "$0 /C set > $TEMP\file.txt" for example).
%COMPUTERNAME% holds the name of the computer but I am not sure it is available on Windows 9x too... You will have to check that.
Benoni
4th January 2003 17:40 UTC
Thanks for that.
I meant to ask in the original post if anyone knew how to get the date/time: anyone know?
kichik
4th January 2003 17:42 UTC
NSISdt by Robert Rainwater should help you there:
http://nsis.sourceforge.net/archive/download.php