+ Reply to Thread
Results 1 to 4 of 4

Thread: Checking User's rights?

  1. #1

    Default Checking User's rights?

    As I usually do, I searched the forum for something on this subject and didn't find anything applicable, so I'm posting my question here.

    According to the SetupBuilder manual, the user's privilege level can be checked via the %_SB_INSTALLERFLAG% built-in variable using code similar to below:

    If %_SB_INSTALLERFLAG% Equals "1" on Position "4" Then
    Set Variable %ADMIN_RIGHTS_SWITCH% to "ON"
    Else
    Set Variable %ADMIN_RIGHTS_SWITCH% to "OFF"
    End

    According to the excerpt below (from the SetupBuilder manual), the 4th bit of the %_SB_INSTALLERFLAG% should have a value of "1" if the user running the script had administrator privileges. If not, that bit should have a value of "0". I've tried this with both user accounts that do have administrator privileges on the machine and user accounts that have ordinary user rights. In all cases, that bit has a value of "1". Is there something I'm missing here, or is this something that may have changed with later versions of Windows? Ideas?

    Name:  _SB_INSTALLERFLAG Reference.jpg
Views: 453
Size:  56.3 KB

  2. #2
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: Checking User's rights?

    Hi Jerry,

    this if for pre-UAC aware systems only (or if UAC is completely disabled). In modern UAC environments, the installer always has admin rights if it is running elevated (e.g. "requireAdministrator" manifested). Do you have your installer running "asInvoker" (that means: per-user)?

    Friedrich

  3. #3
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: Checking User's rights?

    Jerry,

    BTW, please use "Get System Information" -> "Installer Elevation Type". This lets you determine whether a User is a Member of the Administrators Group with UAC Enabled.

    Does this help?

    Friedrich

  4. #4

    Default Re: Checking User's rights?

    Friedrich:

    You've answered my question. Thank you.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •