Prev Previous Post   Next Post Next
Old 30th January 2014, 21:11   #1
Junior Member
Bansaw's Avatar
Join Date: Jul 2010
Posts: 32
How do I get the name of the current logged in user ?

I am running my installer with "admin" privileges and not "highest".
This means that some people in the office require an admin person to come along and log so the installer can start.

However, my installer needs to find out the username of the person who launched the installer.
I tried this: ReadRegStr $0 HKCU "Volatile Environment" "USERNAME"

This worked on my machine and other machines I was logged into, but it didn't work on peoples machines who were not admins or had any kind of elevated privileges.

I also looked at:
System::Call "advapi32::GetUserName(t .r0, *i ${NSIS_MAX_STRLEN} r1) i.r2"

But this simply returns the name of the admin who has come along and logged in, and not the user who originally launched it.

How do I get the name of the person who originally launched my installer?
Bansaw is offline   Reply With Quote
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump