c++ Get user permission set

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • alag20
    New Member
    • Apr 2007
    • 84

    c++ Get user permission set

    Hi,
    I want to make an exe which can check the current users permission as if they are an Administrator etc to check if they can install my application. As my application is in .Net and some users may not already have this, hence I want to make a program which checks their permission. If it is an Admin then triger the install other wise just display an error message and exit!

    Can someone please help?
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    Have a look at this article?


    Code:
    WindowsPrincipal wp = new WindowsPrincipal(WindowsIdentity.GetCurrent());
    bool isAdmin = wp.IsInRole(WindowsBuiltInRole.Administrator);

    Comment

    • alag20
      New Member
      • Apr 2007
      • 84

      #3
      Originally posted by Plater
      Have a look at this article?


      Code:
      WindowsPrincipal wp = new WindowsPrincipal(WindowsIdentity.GetCurrent());
      bool isAdmin = wp.IsInRole(WindowsBuiltInRole.Administrator);
      The above is using .Net framework where as I am not sure even if the user has .Net framework! Something in C++ without .Net framework?

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        Well you asked your question in the .NET forum, I assumed you wanted .NET code.
        I will move you to the correct forum.

        Comment

        • alag20
          New Member
          • Apr 2007
          • 84

          #5
          Originally posted by Plater
          Well you asked your question in the .NET forum, I assumed you wanted .NET code.
          I will move you to the correct forum.
          This is C++ section - isnt it?

          Comment

          • Plater
            Recognized Expert Expert
            • Apr 2007
            • 7872

            #6
            It is now that I moved it. You had posted it in the .NET forum.

            Comment

            Working...