Go to the source code of this file.
Functions | |
CA_API UINT __stdcall | GetUserInfo (MSIHANDLE hInstall) |
Get current user information, including SID and DNS name. | |
CA_API UINT __stdcall | GetUserNameFormatted (MSIHANDLE hInstall) |
Get current user name in a specific format. |
CA_API UINT __stdcall GetUserInfo | ( | MSIHANDLE | hInstall | ) |
Get current user information, including SID and DNS name.
This custom action supports impersonation, see Impersonation in Immediate Custom Actions.
CA_API UINT __stdcall GetUserNameFormatted | ( | MSIHANDLE | hInstall | ) |
Get current user name in a specific format.
USERNAME_FORMAT | username format, one of EXTENDED_NAME_FORMAT, see http://msdn.microsoft.com/en-us/library/ms724268(VS.85).aspx
|
This custom action supports impersonation, see Impersonation in Immediate Custom Actions.
When trying to obtain the complete username for a user, call GetUserInfo. If you want to get the DNS username instead of the SAM username, also call GetUserNameFormatted with NameDnsDomain. The latter call will fail for a local user, ignore its return code.
<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>
© Application Security Inc. - All Rights Reserved | http://msiext.codeplex.com |