Archive: Small problem with WriteRegStr


Small problem with WriteRegStr
This is definately an upgrade that needs to happen. Currently, when writing to the registry, the script is only allowed to write DWORD or Strings. There are about 5 different datatypes that are allowed to be written (REG_SZ[default], REG_BINARY, REG_DWORD, REG_MULTI_SZ and REG_EXPAND_SZ) you can get more information on these guys here:

http://msdn.microsoft.com/library/de.../DataTypes.asp

The REG_EXPAND_SZ is needed when writing to the path environment variable or any other environment variable that has a variable in the value (%SYSTEMROOT%). It would be very valuable to be able to specify the data type for writing to the registry.
DWORD, REG_SZ and BINARY are all covered, EXPAND is definately needed.

I really enjoy this product, I will do this in perl for now, but it would be great to have this in the product so that I don't have to maintain the perl script also.


in version 1.59 this is posible i belive. just have to add 1 more string to your script..
ReadEnvStr $1 SYSTEMROOT
and then use $1 instead of %SYSTEMROOT% when writing to the registry.


Clarification
The aim here wasn't to get the value of %SYSTEMROOT%. I need to be able to specify the data type for the registry value. Specifically, need to be able to specify REG_EXPAND_SZ so that when %SYSTEMROOT% is used in a registry string, it will be parsed as whatever the system sees as the root of the system.


ok sorry for my ignorance i understand what you are trying to do now.

Edit:
I kinda looked into what you are asking. Not sure if this would go mainstream into NSIS because i can't find out if Win9x supports this or not.. everywhere i have read it only says Windows NT.. But if you want based off NSIS 1.59 i added this feature into it. you can use it via WriteRegExpand
same variables as WriteRegStr. you can get the exe at
http://www.edensrising.com/nsis/makensis.rar the sources are also there if you would perfer to compile it yourself. btw it is rar'ed because webserver treats exe's as cgi executables..


Awesome! Justin please include
Shultz,

This is awesome! I have a question about the OSVERSIONINFO, do Win2K and WinXP both return WINNT also? I am just concerned about compatability across all Win types. Thanks for this! It is a great help!

Did you submit this as a diff to Justin? I am sure he would include it if you made it easy for him to include.

Thanks again,

Sixty4Bit


i had my friend test it under WinXp and he said it returned the WinNT string so it should detect WinXP as WinNT.