rpetges
29th March 2003 21:38 UTC
UserInfo::Getname Bug ?
I have the following code and when I try to use this on a Win9x platform, it shows always the messagebox that I need Admin rights... it works fine on NT based platforms.
Doesn't it just jump to the IsAdmin label (IfErrors IsAdmin) ? Even the UserInfo.nsi example scripts doesn't work.
Function _onGuiInit
ClearErrors
UserInfo::GetName
IfErrors IsAdmin
Pop $0
UserInfo::GetAccountType
Pop $1
StrCmp $1 "Admin" 0 +2
Goto IsAdmin
MessageBox MB_OK $(AC_AdminRights)
Abort
IsAdmin:
FunctionEnd
kichik
29th March 2003 21:41 UTC
It is stated in the readme that this plug-in doesn't work on Windows 9x. There is also a script in there that shows you how to tell if you're runnig on Windows 9x.
Unlike the time that I have written this plug-in I do know of a way to make both GetName and GetAccountType to work together while only GetName will work on Windows 9x. Please add this to the feature list in the SF project page.
kichik
29th March 2003 21:50 UTC
My mistake, in the example. There's no readme.
rpetges
29th March 2003 22:03 UTC
Kichik,
is there a way to do something like :
if Win9x then CheckRights
else do nothing
I know about the GetWindowsVersion function but it returns the VERSION, not the PLATFORM TYPE like 9x and NT.
kichik
29th March 2003 22:04 UTC
The example shows you how. The function call will just fail if it's not Windows NT platform.
rpetges
29th March 2003 22:14 UTC
Originally posted by kichik
The example shows you how. The function call will just fail if it's not Windows NT platform.
That's the problem, it will not fail :( ... it seems that the Error variable isn't set ?
rpetges
29th March 2003 23:44 UTC
I found a solution for my problem :)