I want to install some files to the 'shared documents' folder.
The documentation says...
$DOCUMENTSBut if I compile the following script and run it on NT4 or XP PRO I only get the users documents folder. Strangely it works on XP Home.
The documents directory. A typical path for the current user is C:\Documents and Settings\Foo\My Documents. The context of this constant (All Users or Current user) depends on the SetShellVarContext setting. The default is the current user.
(I should add that $SMPROGRAMS functions correctly, but not $DOCUMENTS)
Name "Test"
OutFile "Setup.exe"
Function .onInit
MessageBox MB_OK "$DOCUMENTS"
MessageBox MB_OK "$SMPROGRAMS"
SetShellVarContext "all"
MessageBox MB_OK "$DOCUMENTS"
MessageBox MB_OK "$SMPROGRAMS"
FunctionEnd
Section "default"
SectionEnd
Does anyone know why this is, or is there a suggested workaround?
From a C++ windows API point of view the Shared Documents file does exist on these systems and is retrieved by a call to SHGetSpecialFolderPath(...) so I am not sure why $DOCUMENTS would differ from this.
I'd just like to add that I really have preffered NSIS over other certain offerings that do a lot of (irritating) things by default and you spend ages trying to turn it all off. NSIS on the other hand just does what you tell it to. Nice. 😉