Archive: small prob / question


small prob / question
hi !

i have an installer that works fine.

now i had included two things :
a copy routine for fonts and a copy routine for a video codec

the problem is : under win2k / xp a normal user cant install a videocodec or font

thats why an admin should be used to run

is it possible to determine if the curent user has admin privilegues ???
maybe a registry flag ?
or is this impossible at this time ? then maybe i'll ask justin to implement this.


This topic has rased a lot of questions in the past. Search the Forum for it. All I know, that you should try to write to HKLM (local machine) and if this succeeds, the user has administrator access...

Is this sufficient?
(see http://forums.winamp.com/showthread....ighlight=admin)

Good luck,
-Hendri.


This was the thread I started in the same vein, with my solution.

http://forums.winamp.com/showthread....threadid=79968


Make root environement test
Hi,

I am checking out, if the user is able to write to the root enviroment string. Then the user has the right to act as administrator(only for Winnt4/2000/XP).


;$R1=admin (0=no,1=yes)
StrCpy $R1 0
Strcpy $R3 "SYSTEM\ControlSet001\Control\Session Manager\Environment\envtest"
WriteRegStr HKLM $R3 "" "test"
IfErrors no_rootenv
ReadRegStr $R2 HKLM $R3 ""
StrCmp $R2 "" no_rootenv
DeleteRegKey HKLM $R3
ReadRegStr $R2 HKLM $R3 ""
StrCmp $R2 "" 0 no_rootenv
rootenv:
Strcpy $R1 1
no_rootenv:
ClearErrors


Re: Make root environement test

Originally posted by superrock
Hi,

I am checking out, if the user is able to write to the root enviroment string. Then the user has the right to act as administrator(only for Winnt4/2000/XP).


;$R1=admin (0=no,1=yes)
StrCpy $R1 0
Strcpy $R3 "SYSTEM\ControlSet001\Control\Session Manager\Environment\envtest"
WriteRegStr HKLM $R3 "" "test"
IfErrors no_rootenv
ReadRegStr $R2 HKLM $R3 ""
StrCmp $R2 "" no_rootenv
DeleteRegKey HKLM $R3
ReadRegStr $R2 HKLM $R3 ""
StrCmp $R2 "" 0 no_rootenv
rootenv:
Strcpy $R1 1
no_rootenv:
ClearErrors
Do you need ClearErrors there? IfErrors automatically clears the error flag (found that out a week or so ago when I thought it was still set until you clear it) so I don't think you need the ClearErrors if you are just trying to clear the error that was previously set before the jump.