andreas.fabri
18th May 2006 12:13 UTC
how to get $(USER)
Hello,
During installation I want to modify the file in
c:/Documents and Settings/LOGIN-NAME/Local Settings/Application Data/Microsoft/VisualStudio/7.1/VCComponents.dat
where Developer Studio stores include paths.
How can I determine the user, that is the LOGIN-NAME
part in the above path?
I first thought that the environemnt variable $(USER)
was known, but that is not the case.
thanks,
andreas
Mr Inches
18th May 2006 13:09 UTC
The value of the APPDATA environment variable with get you most of the path you are after.
CancerFace
18th May 2006 14:29 UTC
Is LOGIN-NAME the user who is running the installation process?
If yes then the following (straight out of the System Plugin documentation) will give you the username:
System::Call "advapi32::GetUserName(t .r0, *i ${NSIS_MAX_STRLEN} r1) i.r2"
DetailPrint "User name - $0"
:)
CF
Anders
18th May 2006 14:55 UTC
The login name if changed does not match the users directory, use the $APPDATA or $LOCALAPPDATA variable