The user starts the application package installer. One of the components of the package requires admin rights and the installer must determine whether it is worth running this file during installation or not: if the user is admin - run, if not - skip the file.
What means of WinAPI can get such information about the current user?