Detecting "running as admin" as an Application Variable

I currently do a variety of tricks to determine whether FinalBuilder is running under admin privileges, but after I noticed that there is a IS64BITOS variable, I was wondering if a "ISRUNNINGASADMIN" or something similar that could be added for simplicity.  If there is already something like this, I couldn't find it, so just thought I'd suggest.

Ryan

Hi Ryan,

At the moment FinalBuilder doesn’t have a variable which returns the following;

- Is running as admin
- Is running in elevated privileges (mostly the same as “running as admin”)
- UAC state (on/off)

These are something which could be added to FinalBuilder. I have logged a support case of it. If you would like for me to keep you in the loop on its progress, feel free to email support. From there I will link you into the case.

Done - thanks!

Hi Ryan

As a work around until we add this feature, add a variable to your project (IsRunningAsAdmin) and add a Run Script action, set the language to Powershell and add this to the OnExecute script :

[code]If (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole(`[Security.Principal.WindowsBuiltInRole] “Administrator”)){Break}$FBVariables[‘IsRunningAsAdmin’] = $True[/code]