Old 9th November 2004, 23:30   #1
grahama
Senior Member
 
Join Date: Sep 2004
Location: Los Angeles
Posts: 223
Win98 and sysadmin check

This code works in 2000 and XP but fails in Windows 98

System::Call "kernel32::GetModuleHandle(t 'shell32.dll') i .s"
System::Call "kernel32::GetProcAddress(i s, i 680) i .r0"
System::Call "::$0() i .r0"
grahama is offline   Reply With Quote
Old 10th November 2004, 04:32   #2
grahama
Senior Member
 
Join Date: Sep 2004
Location: Los Angeles
Posts: 223
;continued
; So, is the the user the admin or not ?
strcmp $0 1 admin notAdmin
grahama is offline   Reply With Quote
Old 10th November 2004, 05:16   #3
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,165
from msdn:
Minimum DLL Version shell32.dll version 5.0 or later
Minimum operating systems Windows 2000

anyway, there is no such thing as admin on Win9x, just skip the whole check on 95/98/ME

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 10th November 2004, 05:31   #4
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
UserInfo plugin code about Win9x

if (GetVersion() & 0x80000000) // Not NT
{
group = "Admin";
}

Another home grown way I used - important thing is not admin group but if I can write registry (and Program files)

;Hand made admin checkout
Function .onInit
WriteRegStr HKLM "${REG_UNINST}" "TestString" "Some text"
IfErrors 0 cleanValue
MessageBox MB_OK "This application must be installed by an administrator.$\nClick 'OK' to terminate the installation."
Abort
cleanValue:
DeleteRegValue HKLM "${REG_UNINST}" "TestString"
FunctionEnd
Takhir is offline   Reply With Quote
Old 10th November 2004, 18:22   #5
grahama
Senior Member
 
Join Date: Sep 2004
Location: Los Angeles
Posts: 223
many many thanks Takhir and Anders
I am in my 6th week of PC system stuff as I come from the Mac world
It is a totally different universe and this list has really helped to demystify all the new jargon
For those who are following the thread, I changed DeleteRegValue to DeleteRegKey to trash the 'test' key as to leave no trace
grahama is offline   Reply With Quote
Old 10th November 2004, 18:57   #6
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
I had in mind to use this node for uninstall settings, but you are right - user can cancel installation, so key deletion is better.
Takhir is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump