Archive: $WINDIR in Windows 2003 Server


$WINDIR in Windows 2003 Server
I am trying my installer in a Windows 2003 Server and I have noticed that the installer resolves $WINDIR to c:\documents and settings\myUser\WINDOWS instead of c:\WINDOWS. The windir environment variable is set to c:\WINDOWS.

Have anybody else noticed this problem?

I am using NSIS 2.06

Thanks


That's normal Windows 2003 and terminal services behavior. I don't remember the exact reason, but that's the way it works. There is probably some information about this in MSDN. If you want to get the system Windows directory, you can call GetSystemWindowsDirectory using the System plug-in:

System::Call 'kernel32::GetSystemWindowsDirectory(t .r0, i ${NSIS_MAX_STRLEN})'
DetailPrint "Windows Directory: $0"

"On a system that is running Terminal Server, each user has a unique Windows directory. The system Windows directory is shared by all users, so it is the directory where an application should store initialization and help files that apply to all users.

With Terminal Services, the GetSystemWindowsDirectory function retrieves the path of the system Windows directory, while the GetWindowsDirectory function retrieves the path of a Windows directory that is private for each user. On a single-user system, GetSystemWindowsDirectory is the same as GetWindowsDirectory."

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


thx


Why doesn't the installer use the envionment variable %WINDIR% instead of GetWindowsDirectory()?