Get current user name in a specific format.
<Binary Id="UserPrivileges" SourceFile="$(var.BinDir)\UserPrivileges.dll" />
<CustomAction Id="GetUserInfo" BinaryKey="UserPrivileges" DllEntry="GetUserInfo" Execute="immediate" Return="check" />
<CustomAction Id="GetUserNameFormatted" BinaryKey="UserPrivileges" DllEntry="GetUserNameFormat" Execute="immediate" Return="ignore" />
<!-- general username properties -->
<Publish Event="DoAction" Value="GetUserInfo" Order="1">1</Publish>
<!-- username in the DNS domain format -->
<Publish Property="USERNAME_FORMAT" Value="NameDnsDomain" Order="2">1</Publish>
<Publish Event="DoAction" Value="GetUserNameFormatted" Order="3">1</Publish>
<Publish Property="USERNAME_DNSDOMAIN" Value="[USER_FQN]" Order="4">1</Publish>
<!-- either keep USER_NAME or USERNAME_DNSDOMAIN -->
<Publish Property="USERNAME_FULL" Value="[USERNAME_DNSDOMAIN]" Order="5">1</Publish>
<Publish Property="USERNAME_FULL" Value="[USER_NAME]" Order="6">NOT USERNAME_FULL</Publish>