home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 March / CMCD0304.ISO / Software / Freeware / Programare / nullsoft / nsis20.exe / Contrib / UserInfo / UserInfo.nsi < prev   
Text File  |  2003-05-02  |  778b  |  32 lines

  1. Name "UserInfo.dll test"
  2. OutFile UserInfo.exe
  3.  
  4. Section
  5.     ClearErrors
  6.     UserInfo::GetName
  7.     IfErrors Win9x
  8.     Pop $0
  9.     UserInfo::GetAccountType
  10.     Pop $1
  11.     StrCmp $1 "Admin" 0 +3
  12.         MessageBox MB_OK 'User "$0" is in the Administrators group'
  13.         Goto done
  14.     StrCmp $1 "Power" 0 +3
  15.         MessageBox MB_OK 'User "$0" is in the Power Users group'
  16.         Goto done
  17.     StrCmp $1 "User" 0 +3
  18.         MessageBox MB_OK 'User "$0" is just a regular user'
  19.         Goto done
  20.     StrCmp $1 "Guest" 0 +3
  21.         MessageBox MB_OK 'User "$0" is a guest'
  22.         Goto done
  23.     MessageBox MB_OK "Unknown error"
  24.     Goto done
  25.  
  26.     Win9x:
  27.         # This one means you don't need to care about admin or
  28.         # not admin because Windows 9x doesn't either
  29.         MessageBox MB_OK "Error! This DLL can't run under Windows 9x!"
  30.  
  31.     done:
  32. SectionEnd