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
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]
> 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