[izpack-users] rights check

CW2 Carl.Wilson at uk.thalesgroup.com
Thu Oct 4 12:47:18 CEST 2007



Dave Tschische wrote:
> 
> Hi!
> 
> I 'd like to know if there is an easy way to check if the user has
> sufficient rights (e.g. admin rights) before the installer is launched?
> I did not find anything about this issue in the docu.
> 
> Just want to avoid that the installation is started but then several
> substeps fail an the users is bothered with cryptic error messages....
> 
> Any suggestions?
> 
> Regards,
> 
> Dave
> -- 
> Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten 
> Browser-Versionen downloaden: http://www.gmx.net/de/go/browser
> _______________________________________________
> izpack-users mailing list
> izpack-users at lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/izpack-users
> 
> 

I had this problem as well, and it gets complicated when you have domain
administrators where it depends on the domain configuration.
I've had a look at getting this info from the Java security methods, but
gave up.
I've fallen back to running a process "net user " +
System.getProperty("user.name") + " /DOMAIN" and checking the results to see
whether that user is a member of the administrator's group
This isn't very satisfactory and only works if you're using the domain
you're logged into (don't ask for an explanation of this - I've got 2
networks here, it works ok on one but not on the other where the domain
controller isn't the domain I'm logged into)

I'm considering just running another external program, possibly some code
based in Jordan Russel's free INNO installer, which does actually check if
the user is an administrator, poweruser, etc.  Just write some code to
output 'administrator' or something when run /VERYSILENT.  It's not an
elegant solution, but it'll work and allow you to get the installer working.

I'll look out for a neater solution if someone can suggest something based
on Java.  Ideally I'd want the solution to work on Linux as well.
-- 
View this message in context: http://www.nabble.com/rights-check-tf4565872.html#a13037437
Sent from the izpack users mailing list archive at Nabble.com.



More information about the izpack-users mailing list