In an InstallShield basic MSI project: how can I check whether a user name is in the administrator group?
(Not the current user with which I know it's possible to do so.)
In an InstallShield basic MSI project: how can I check whether a user name is in the administrator group?
(Not the current user with which I know it's possible to do so.)
You could run "net localgroup administrators" and parse the output. I suspect there is a better way, but if not...
Users can belong to the 'Administrators' group on the local server or could be part of the 'Domain Admins' or 'Enterprise Admins' groups defined inside your AD. Ideal solution would be to create a DLL with a method called IsUserAdmin(user_name) that takes in a user name parameter and returns either true or false.
Internally, the method will call the IADsUser::Groups method to determine the groups the supplied user belongs to and will return true if the groups enumerated belongs to one of those administrator groups above. If not it will return false. You may invoke this DLL inside your InstallShield projects. Be wary of nested groups.