PDA

View Full Version : Limit installation only to admin users



yonitr
01-05-2005, 02:52 AM
Hi,
I'm trying to limit the installation only to admin users. I added the "AdminUser" condition to the product properties -> install conditions and even to the feature's conditions and it doesn't help. The installation doesn't abort if the user is not logged in as an administrator in the computer.
By the way, I support Windows XP and 2000 in my installation, and not 9x (I don't know if it's relevant).

Thanks

Tim Owers
01-05-2005, 04:27 AM
As a final check to see if the current user really is an Admin or not, try adding this piece of script to a CA somewhere during startup (e.g. after LaunchConditions in the UI sequence)...

nResult = Is( USER_ADMINISTRATOR , "");
if nResult = TRUE then
SprintfBox (INFORMATION, "DEBUG", "AdminUser = TRUE");
elseif (nResult = FALSE) then
//nResult returned 0
MessageBeep ( 0 );
SprintfBox (INFORMATION, "DEBUG", "AdminUser = FALSE");
else
//The Is function was unable to answer the question.
MessageBeep ( 0 );
SprintfBox (INFORMATION, "DEBUG", "Unable to determine if this machine has administrator privileges.");
endif;

smeaow
01-05-2005, 04:29 AM
Hi
Setting the Install Condition should help. Check if the correct condition is set in the Launch Condition table , this will help isolating the issue.