How to Detect Other Windows Logons
During an install, is there a way to detect if there are other Window users logged into the machine? I want to prevent installation if there are other users logged on.
19 posts
!include LogicLib.nsh
#...
System::Call 'wtsapi32::WTSEnumerateSessions(i 0, i 0, i 1, *i .r0, *i .r1) i .r2'
${If} $2 != 0
${If} $1 != 1
MessageBox MB_OK "more than one user logged in"
${EndIf}
System::Call 'wtsapi32::WTSFreeMemory(i r0)'
${EndIf}