I have the following little program written in Elements v9.3.103.2211 using Oxygene with Island on Windows 8.1 Pro x64 with VS Shell 2015. The target platform is Windows x86:
namespace IsUserAnAdminTest;
type
Program = class
public
class method Main(args: array of String): Int32;
begin
if (rtl.IsUserAnAdmin) then
writeLn ('User has local admin rights')
else writeLn ('User does not have local admin rights');
if (rtl.IsDebuggerPresent) then
begin
writeLn;
writeLn ('Press [Enter] to continue ...');
readLn;
end;
end;
end;
end.
The current user is local admin, UAC is active. When I run the IDE without elevation I can debug the program without problems. When I run VS Shell elevated (the window title says “… Microsoft Visual Studio (Administrator)” the debugge freezes right after start (not the IDE). I see an empty command window, but nothing happens. If I set a breakpoint on the line “if (rtl.IsUserAnAdmin) then” the debugger never gets there. I can terminate the program by issuing the “Stop Debugging” command.