I'm running into an issue with AccessControl::SetFileOwner.
I've created a script that sets the ownership of a file to the current logged in user:
This works well in workgroups but does not work in a domain environment 🤪. In a domain, it actually assigns the local admin, instead of the logged in user. Im not sure if this is due to "RequestExecutionLevel admin".
AccessControl::GetCurrentUserName "" "$0"
Pop $0
AccessControl::SetFileOwner "$INSTDIR\myfile.txt" $0
Anyhow Id like it to assign the actual user that is logged on. I've tried to use UserMgr::GetCurrentDomain in conjuction with AccessControl::GetCurrentUserName but I believe my syntax was wrong.. (I'm new to NSIS so couldn't figure out the format 🤨)
Any ideas? Any help is greatly appreciated !!! 🙂 😁