Re: Determining User Rights at run time

From: Rob Teixeira [MVP] (RobTeixeira_at_@msn.com)
Date: 06/30/04

  • Next message: Mike: "Prevent arbitrary code from writing to disk"
    Date: Tue, 29 Jun 2004 19:34:13 -0400
    
    

    There's some built-in support for ACL (access control lists) and secruity
    descriptors in .NET 2.0, but in .NET 1.1 you have to do it all through
    p/invoke (most of the functions you need are in advapi32.dll).
    There's also a C# wrapper sample project on GotDotNet.com that makes this a
    little easier. Here's the link, but I have to warn you I haven't used it
    yet, so I don't make any guarantees about it's stability or usability -
    http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=e6098575-dda0-48b8-9abf-e0705af065d9

    -Rob Teixeira [MVP]

    "Billg_sd" <Billg_sd@discussions.microsoft.com> wrote in message
    news:5740BE3D-63CB-4F85-891B-B97B2993EE62@microsoft.com...
    > Is there a programmatic way to determine if the user has sufficient local
    rights to update the registry (HKLM\SOFTWARE\MYPRODUCT) and create/modify a
    local file (C:\Program Files\MyProductDir)?
    >
    > I've written my own custom installer. I'd like to perform these tests
    before installation begins, without having to determine if the user is
    logged in as ADMINISTRATOR.
    >
    > -Billg_sd
    >


  • Next message: Mike: "Prevent arbitrary code from writing to disk"