Adam
04-28-2008, 12:36 PM
Question
How can I detect administrator privileges
Answer
The article explains how to determine if the end user has administrative privileges using Setup Factory 7.0.
In general there are two main types of users on Windows NT-based operating systems (Windows NT 4.0, Windows 2000, Windows XP and Vista), these are:
- Administrators
- Users
Each type of user, or "User Group" has different privileges and access to different portions of the system. As a result it is often important to know which User Group your end user falls into, and the properties of each group.
The first, and most powerful group is the "Administrators". This group has access to the entire operating system, they are not limited to which registry keys they can edit, files the can modify, or what types of programs they can run. In general, users with Administrative privileges will be the users installing programs.
The most common, and restricted, group is the "Users" group. This group is made up of the people who work with the computer on a day-to-day basis. They only need access to certain programs and data files found on their local system or network. These users have restricted access to the operating system and the registry. The basic Users group grants people access the computer without giving them the ability to do damage to: the operating system, installed programs, important documents, or other security measures that may be place.
Members of the "Users" group cannot:
- Modify system wide registry settings
- Modify Operating System files
- Install programs accessible to other users
Members of the "Users" group can:
- Run programs installed by administrators
- Access the files within their user profile
- Modify their HKEY_CURRENT_USER registry settings
So if your installation needs to modify a registry value found outside HKEY_CURRENT_USER, or if you want the program being installed to be accessible to all users on the computer you must make sure that your installation is run by a user with administrative privileges.
To make this check easy, Setup Factory ships with an action to check for administrator rights:
UserInfo = System.GetUserInfo();
-- Reference UserInfo.IsAdmin to check for admin rights
-- If true, the user is an admin on an NT system, or is running a non-NT system.
-- If false, the user is not an admin on an NT system.
So when checking to make sure that your user is NOT an Administrator two checks have to be made:
- They are not running Windows 95, 98, or ME
- They are not an admin on an NT system
Conversely the following checks need to be made to determine that the user Is an Administrator:
- They are running Windows NT, 2000, or XP
- They are logged in with admin rights
In general it is easier to determine that the user is NOT an Administrator, simply because this makes it easy to include Windows 95, 98, and ME users, who will generally have "Administrator" privileges on their systems.
For more information please see the following topics in the Setup Factory Help:
Program Reference | Actions | System | System.GetUserInfo (http://www.indigorose.com/webhelp/suf70/Program_Reference/Actions/System.GetUserInfo.htm)
How can I detect administrator privileges
Answer
The article explains how to determine if the end user has administrative privileges using Setup Factory 7.0.
In general there are two main types of users on Windows NT-based operating systems (Windows NT 4.0, Windows 2000, Windows XP and Vista), these are:
- Administrators
- Users
Each type of user, or "User Group" has different privileges and access to different portions of the system. As a result it is often important to know which User Group your end user falls into, and the properties of each group.
The first, and most powerful group is the "Administrators". This group has access to the entire operating system, they are not limited to which registry keys they can edit, files the can modify, or what types of programs they can run. In general, users with Administrative privileges will be the users installing programs.
The most common, and restricted, group is the "Users" group. This group is made up of the people who work with the computer on a day-to-day basis. They only need access to certain programs and data files found on their local system or network. These users have restricted access to the operating system and the registry. The basic Users group grants people access the computer without giving them the ability to do damage to: the operating system, installed programs, important documents, or other security measures that may be place.
Members of the "Users" group cannot:
- Modify system wide registry settings
- Modify Operating System files
- Install programs accessible to other users
Members of the "Users" group can:
- Run programs installed by administrators
- Access the files within their user profile
- Modify their HKEY_CURRENT_USER registry settings
So if your installation needs to modify a registry value found outside HKEY_CURRENT_USER, or if you want the program being installed to be accessible to all users on the computer you must make sure that your installation is run by a user with administrative privileges.
To make this check easy, Setup Factory ships with an action to check for administrator rights:
UserInfo = System.GetUserInfo();
-- Reference UserInfo.IsAdmin to check for admin rights
-- If true, the user is an admin on an NT system, or is running a non-NT system.
-- If false, the user is not an admin on an NT system.
So when checking to make sure that your user is NOT an Administrator two checks have to be made:
- They are not running Windows 95, 98, or ME
- They are not an admin on an NT system
Conversely the following checks need to be made to determine that the user Is an Administrator:
- They are running Windows NT, 2000, or XP
- They are logged in with admin rights
In general it is easier to determine that the user is NOT an Administrator, simply because this makes it easy to include Windows 95, 98, and ME users, who will generally have "Administrator" privileges on their systems.
For more information please see the following topics in the Setup Factory Help:
Program Reference | Actions | System | System.GetUserInfo (http://www.indigorose.com/webhelp/suf70/Program_Reference/Actions/System.GetUserInfo.htm)