cowwoc
19th April 2005 23:32 UTC
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
Takhir
20th April 2005 13:15 UTC
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