Determining if the User Has Administrator Privileges

A frequently-asked question is how to determine if the current user running the installation has Administrator privileges.  This depends on what project type you are using.

For InstallScript and InstallScript MSI projects, there are a couple ways:

  1. Check if SYSINFO.WINNT.bAdmin_Logged_On is TRUE.  If so, the user has Administrator privileges.
  2. Check if Is(USER_ADMINISTRATOR,"") returns TRUE.  If so, the user has Administrator privileges.

For Basic MSI projects, you need to do this:

  1. Check if the Privileged property is set.  If so, the user has Administrator privileges, or the application has been assigned by a System Administrator, or both the user and machine policies AlwaysInstallElevated are set to TRUE.

That's it.

Creating a Setup.exe Bootstrapper Log for a Basic MSI Project

Leave a Comment

Security Code: