Skip to content
⌘ NSIS Forum Archive

How to get current username?

5 posts

Andrei_KC#

How to get current username?

Hi.

I'm very new to NSIS. In fact, I haven't done anything on it yet. I'm still reviewing installer authoring tools like NSIS to match the needs of what I'm going to make. As I've been reading the crucial things I need from NSIS in the documentation, specifically http://nsis.sourceforge.net/Docs/Chapter4.html#4.2.3 I didn't see any $USERNAME (somehow similar to %USERNAME% in cmd.exe). Is there a way to easily get the current user's name? I need that value for some other things I'll do within the installer.

Thanks in advance.
jpderuiter#
You can use the UserMgr plugin for example:
jpderuiter#
Or using the system plugin, which is installed with NSIS by default:
Are you a developer who uses NSIS to distribute your application? Are you a Winamp plug-in developer who wants to use NSIS to distribute your plug-in? Have suggestions for other people like you? This is the place.
Andrei_KC#
jpderuiter,

Thank you for the fast response! Granted I haven't started on using NSIS yet, I see there are more than one solution to my question, which is a good sign! The second approach looks promising.

Though, I hope they think of adding that constant in future releases.

Thanks again!
Afrow UK#
Are you a developer who uses NSIS to distribute your application? Are you a Winamp plug-in developer who wants to use NSIS to distribute your plug-in? Have suggestions for other people like you? This is the place.


Stu