Archive: Detecting administrator rights?


Detecting administrator rights?
Hi,

I want to be able to detect whether the user has admin rights or not. I want to install a public JRE on his machine and to my knowledge this requires admin access. If he does not have admin access, I will try installing a private JRE but this should be done as a last resort.

Ideas?

Gili


http://nsis.sourceforge.net/archive/...ances=0,11,927


Not admin user may have some permissions too. This is how I do this:


Function .onInit

; Hand made permissions checkout
WriteRegStr HKLM "${REG_UNINST}" "TestString" "Some text"
IfErrors 0 cleanValue
MessageBox MB_OK "$(adminMsg)"
Abort
cleanValue:
DeleteRegValue HKLM "${REG_UNINST}" "TestString"
DeleteRegKey /ifempty HKLM "${REG_UNINST}"

FunctionEnd