Setup Project - Test If User Is An Administrator?

  • Thread starter Thread starter Alan Cohen
  • Start date Start date
A

Alan Cohen

Is there a good way to test if a user is an administrator at the start
of a setup, and abort (with an error message) if they are not?
 
there are several ways this is just one

If My.User.IsAuthenticated ANDALSO My.User.IsInRole("Administrators") Then
'Yes he / she is administrator
End If

I have seen code that just tryed to write at certain locations to see if
the user had apropriate rights on the system
low level but it is also a way of ensuring that your program can get
installed on the target system, from a certain point of view
it isn`t even as bad as it sounds :-)

hth

Michel posseth
 
Back
Top