Talk:Check if the current user is an Administrator

From NSIS Wiki
Jump to navigationJump to search

Macro 2 crashed.

Since some users still use NT4, I tried the second version first. When testing as an administrator, it worked. When testing as plain user, the installer crashed on a WinXPSP2-system.

Solution: Macro 1 works, so I use that one instead, and assume that all NT4-users are administrators.

How about Vista? Does it work in Vista? We need to specify this.

UAC/elevation issues

This does not work on UAC-enabled systems (like Vista, 7, 8, 8.1). A user, that has admin rights will always be reported to be Administrator (which is correct), even if the installer is not running with elevated rights - which makes this check rather useless.

The expected behavior should be: If program is elevated, do report admin rights, if not elevated, do not report admin rights.

Are you sure? The first macro seems to work correctly on my Win8 system. Anders 19:53, 4 March 2014 (UTC)