cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Not applicable

Check for Administrtors group or Power User

Is there an option for Install Anywhere to check if the user has administrator priviledges or is in power users group ?
HKEY_LOCAL_MACHINE registry updates do not work without this priviledge, so it seems like it would be a common thing to test for.
Labels (1)
0 Kudos
(1) Reply
nosrednayduj
Level 7

It is in the security service. Here's my rule:

import com.zerog.ia.api.pub.*;
import com.installshield.wizard.service.ServiceException;
import com.installshield.wizard.service.security.SecurityService;

public class IsAdminRule extends CustomCodeRule {

public boolean evaluateRule() {
SecurityService ss = (SecurityService) ruleProxy.getService(SecurityService.class);
boolean retval = false;
try {
retval = ss.isCurrentUserAdmin();
} catch (ServiceException se) {
return false;
}
return retval;
}
}
0 Kudos