Archive: Path Manipulation thinger


Path Manipulation thinger
This is in reference to the path manipulation functions here: http://nsis.sourceforge.net/archive/....php?pageid=91

Why was WriteRegStr used in these functions instead of WriteRegExpandStr? Probably not a big deal, but just thought I'd ask. I thought that WriteRegExpandStr might be better because it is supposed to handle the % character (like %WINDOWS% or something like that).

Just wondering. Handy functions though.


It's REG_SZ here, that's why.


Right, but I thought it should be REG_EXPAND_SZ like the HKLM path. Picking a nit I know but anyhow. Thanks guys.


Is it REG_EXPAND_SZ on your computer? Maybe I have turned it into REG_SZ with some of my pre-tests.


It's REG_SZ on mine (Windows 2000).


Sunjammer, are you looking at your Path variable in HKCU\Environment or in HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment? If you are looking at HKCU\Environment then it would probably be REG_SZ because you might have used the NSIS path manipulation functions.

I checked the machines around my desk here (3 Win2000, 1 WinXP) and all of them have the Path variable in HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment as a REG_EXPAND_SZ, which makes sense because I remember reading somewhere that if the Path string contains %SystemRoot% it needs to be a REG_EXPAND_SZ.