Skip to content
⌘ NSIS Forum Archive

Environmental variables changed creating a new user

2 posts

coppolo#

Environmental variables changed creating a new user

Hi all,

After I created a new user, I make some shortcuts in the start menù, but I find those shortcuts in the "newuser" menù, not in the current user menù. (but I want them in the current user menù!)
It seems like UserMgr pluging changed the environmental variable when creating the user.

Any suggestions?

Many thanks,
Luca

This is my nsis code:

UserMgr::CreateAccountEx "newuser" "password" "-" "-" "-" "UF_PASSWD_CANT_CHANGE|UF_DONT_EXPIRE_PASSWD"
Pop $0
${If} $0 != "OK"
Quit
${EndIf}

UserMgr::AddToGroup ${AEPUSER} "Users"
Pop $0
${If} $0 != "OK"
Quit
${EndIf}

UserMgr::BuiltAccountEnv ${AEPUSER} ${AEPPWD}
Pop $0
${If} $0 != "OK"
Quit
${EndIf}

CreateDirectory "$SMPROGRAMS\myapp"
CreateShortCut "$SMPROGRAMS\myapp\myapp.lnk" "$INSTDIR\myapp.exe" "" "$INSTDIR\myapp.exe" 0
jpderuiter#
See my reply here:
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.